[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: [PyKDE] Listbox item value
From: Derek Fountain <derekfountain () yahoo ! co ! uk>
Date: 2003-05-28 12:36:01
[Download RAW message or body]
Given this bit of (total newbie) code:
---
#!/usr/bin/python
import sys
from qt import *
app=QApplication(sys.argv)
list=QListBox()
list.insertItem("Item 1")
list.setCurrentItem(0)
list.clearSelection()
print "Currently selected: " + str(list.currentItem())
list.setCurrentItem(-1)
print "Currently selected: " + str(list.currentItem())
app.setMainWidget(list)
list.show()
app.exec_loop()
---
what would you expect to be printed? On my SuSE-8.1 box with PyQt-3.3.2 I get
0 and 0 which puzzles me. If I comment out the "list.setCurrentItem(0)" line,
I get -1 and -1, which is what I'd expect to receive in all cases. Can't I
set a list to have no selected item once it's had one selected?
Can someone give me a clue what's going on?
--
"...our desktop is falling behind stability-wise and feature wise to KDE
...when I went to Mexico in December to the facility where we launched gnome,
they had all switched to KDE3." - Miguel de Icaza, March 2003
_______________________________________________
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