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

Ellen Kestrel dragonflykes at gmail.com
Tue Mar 17 18:28:27 CET 2009


Selection models don't *have* a clicked signal.  I think you could probably
use a mouseclick event, but that's a lot more work than I really want to do
on this.

2009/3/17 Jesús Fernández <jsfdez at gmail.com>

> Sorry, I haven't read the entire mail, and what about clicked signal?
>
>
> 2009/3/17 Ellen Kestrel <dragonflykes at gmail.com>
>
>> I did.  In fact, I quote from my message:
>>
>> "I also tried connecting the currentRowChanged and selectionChanged
>> signals, but those didn't work either."
>>
>> 2009/3/17 Jesús Fernández <jsfdez at gmail.com>
>>
>> Try QItemSelectionModel::selectionChanged instead
>>>
>>> 2009/3/17 Ellen Kestrel <dragonflykes at gmail.com>
>>>
>>>> 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
>>>>
>>>> _______________________________________________
>>>> Qt-interest mailing list
>>>> Qt-interest at trolltech.com
>>>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Qt-interest mailing list
>>> Qt-interest at trolltech.com
>>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>>
>>>
>>
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>
>>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090317/07c7cc02/attachment.html 


More information about the Qt-interest-old mailing list