[Qt-interest] QListView's selectionModel is broken?

Ellen Kestrel dragonflykes at gmail.com
Tue Mar 17 17:40:43 CET 2009


I have a QListView which has its data supplied by a QStringListModel, and I
want to display information when each item in the QListView is clicked.  So,
I tried

connect (listView->selectionModel (), SIGNAL (currentChanged (const
QModelIndex&, const QModelIndex&)), this, SLOT (display ()));

When I run the program, the slot is never run.  There are no "No such
signal/slot" messages - it looks like the currentChanged signal is simply
never emitted.  I have done the exact same thing with a QTreeView, and it
worked exactly the way I wanted it to.  I also tried connecting the
currentRowChanged and selectionChanged signals, but those didn't work
either.  Is there something special you have to do with a QListView, or is
this a bug?  If it's a bug, is there a way to work around it?

-- EK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090317/9f68894e/attachment.html 


More information about the Qt-interest-old mailing list