[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] QComboBox.itemData() returns invalid QVariant
From:       David Boddie <david () boddie ! org ! uk>
Date:       2006-08-31 20:25:12
Message-ID: 200608312225.13322.david () boddie ! org ! uk
[Download RAW message or body]

On Wed, 30 Aug 2006 09:43:55 -0700, Tom Brown wrote:

> I am running into trouble with QComboBox.itemData(). I can add an item with
> data to the combobox, but when I try to get the data back out, itemData()
> returns an invalid QVariant. For example:
>
> id = 1
> self.addItem(rev, QVariant(id))
> self.itemData(0).toInt() --> 0, False
> self.itemData(0).isValid() --> False
>
> I searched the mailing list and didn't see anybody else with the same
> issue. I must be doing something wrong. Any ideas?

I tried the above code, substituting in what I thought were appropriate
values for "rev" (a string) and "self" (a QComboBox), and the itemData()
calls returned valid QVariants, so maybe the problem is elsewhere in
your code.

Can you provide some more context?

David

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic