PDA

View Full Version : Items gets unselected when clicked on empy space in QIconView?



darpan
26th July 2006, 08:42
Hi,
I have a QIconView on a dialog, I inserted some items in QIconView, I also activated the Multiseclection true for the QIconView. When I click the QIconViewItem then item get selected. When all the items in QIconView are selected and I click on empty space of QIconView then all the items get unselected.
But i wants that when I click on empty space then selected items remains selected.
How i can do this?


Thanks and Regards

wysota
26th July 2006, 09:08
I think you'd have to monitor the selection by connecting to QIconView::selectionChanged() signal and when you get the undesired behaviour (items get unselected), select them again.

darpan
27th July 2006, 12:39
Hi,
I can have many items in QIconView so i can't select all items again. How i can override(subclass) QIconView method so that when user click on empty space then selection is not changed.


Thanks and Regards

jpn
27th July 2006, 12:48
Override QWidget::mousePressEvent(), check if you can find any item (http://doc.trolltech.com/3.3/qiconview#findItem) at the pressed point and either ignore or pass the event to the base class when appropriate.