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

List:       pykde
Subject:    [PyKDE] Re: QListBoxItem.isSelected() does not exist
From:       Jeffrey Barish <jeff_barish () earthlink ! net>
Date:       2005-03-31 0:40:53
Message-ID: d2fgsj$d8$1 () sea ! gmane ! org
[Download RAW message or body]

Giovanni Bajo wrote:

> Jeffrey Barish <jeff_barish@earthlink.net> wrote:
> 
>> Here's one that I'm pretty sure is a bug.  In the following complete
>> code sample, the line that is commented out tests whether the
>> listboxitem is selected.  However, that line produces an
>> AttributeError.  The line above it works correctly, but according to
>> the documentation selected() is obsolete.
> 
> Works for me:
> 
>>>> "isSelected" in dir(QListBoxText)
> True
>>>> "selected" in dir(QListBoxText)
> False
> 
> I also tried a cut-down version of your sample and everything appears
> to work as expected:
> 
>>>> a = QApplication([])
>>>> l = QListBox(None)
>>>> i = QListBoxText(l, "foo")
>>>> i.isSelected
> <built-in method isSelected of QListBoxText object at 0x008158A0>
>>>> i.selected
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> AttributeError: selected
>>>> l.firstItem() is i
> True
> 
> Which version of Qt/PyQt are you using?
> 
> Giovanni Bajo
Yes, that could explain it.  I am using version 2.3.2, which is what
comes with the kopsis package for the Zaurus.  Perhaps isSelected
became standard in version 3.  Is that the version you are running?
-- 
Jeffrey Barish

_______________________________________________
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