[PyQt] Why doesn't QListWidget emit indexesMoved(QModelIndexList)
signal?
LIM Fung-Chai
lim.fung.chai at gmail.com
Tue Feb 24 02:56:07 GMT 2009
Hi,
After creating a QListWidget, I enabled dragging and set drag-drop-mode to
QAbstractItemView.InternalMove. I am able to re-order the QListWidgetItems
within this widget by selecting and dragging the selected items around. But
when I drop the selected items, shouldn't an indexedMoved signal be emitted?
Here is my code:
def moved (self, indexes):
print "moved"
app = QApplication (sys.argv)
widget = QListWidget()
widget.setAcceptDrops (True)
widget.setDragEnabled (True)
widget.setDragDropMode (QAbstractItemView.InternalMove)
QObject.connect (widget, SIGNAL ("indexesMoved(QModelIndexList)"), moved)
QListWidgetItem ("item 1", widget)
QListWidgetItem ("item 2", widget)
QListWidgetItem ("item 3", widget)
QListWidgetItem ("item 4", widget)
widget.show()
app.exec_()
When I moved an item around, moved() should have been invoked, but is not.
Why? I am using PyQt v3.17.6. Thanks in advance.
Regards,
Fung Chai.
--
FWIW: $\lnot \exists x \, {\rm Right} (x) \leftarrow \forall x \, {\rm
Wrong} (x)$ \hfill -- Stephen Stills
Freedom's just another word for nothin' left to lose -- Kris Kristofferson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090224/63fe2db5/attachment.html
More information about the PyQt
mailing list