setData & QVariant
Petri Damstén
petri.damsten at gmail.com
Tue Nov 3 06:44:44 CET 2009
On Monday 02 November 2009 22:38:53 Aaron J. Seigo wrote:
> On October 31, 2009, Petri Damstén wrote:
> > On Friday 30 October 2009 19:53:29 Aaron J. Seigo wrote:
> > > On October 30, 2009, Petri Damstén wrote:
> > > > I'm trying to fix BUG 212342. It seems like if variable is put to
> > > > QVariant and then as a parameter to setData it does not work. If same
> > > > variable is
> > >
> > > odd ...
> > >
> > > what does a simple app like this give you:
> > >
> > > #include <qvariant.h>
> > > #include <iostream>
> > > using namespace std;
> > >
> > > int main()
> > > {
> > > QVariant v;
> > > cout << v.isNull() << " " << v.isValid() << endl;
> > > return 0;
> > > }
> >
> > test$ ./mytest
> > 1 0
>
> so it isn't in QVariant (which would have surprised me), and the code in
> DataEngine hasn't changed recently. the check in setData is for (v.isNull()
> || !v.isValid()), perhaps you can put some debug in there to see what is
> happening?
Seems that v is null for Free Space. Modified test:
#include <qvariant.h>
#include <iostream>
using namespace std;
int main()
{
QVariant v;
qlonglong ll = 1024;
v.setValue(ll);
cout << v.toLongLong() << " " << v.isNull() << " " << v.isValid() << endl;
return 0;
}
gives:
test$ ./mytest
1024 1 1
Petri
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20091103/a90a432c/attachment.sig
More information about the Plasma-devel
mailing list