[Qt-interest] ItemIsUserCheckable and checking all selected items

Paul Harris harris.pc at gmail.com
Wed May 27 17:46:07 CEST 2009


Hi,

I have a subclassed QAbstractListModel attached to a QListView.  I have
setSelectionMode(ExtendedSelection)

I would like to be able to select multiple rows, and then press the
spacebar, and have it toggle the checkboxes on ALL of the selected rows.

How can I make this happen?

I was thinking of a hack in my model::setData() ... give the model the
list's selectionModel so that it knows what other items are selected, and
then the setData() method can do the work of toggling all the checks.  But
this seems to go against the class design...

thanks,
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090527/45e625b6/attachment.html 


More information about the Qt-interest-old mailing list