Items gets unselected when clicked on empy space in QIconView?
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
Re: Items gets unselected when clicked on empy space in QIconView?
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.
Re: Items gets unselected when clicked on empy space in QIconView?
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
Re: Items gets unselected when clicked on empy space in QIconView?
Override QWidget::mousePressEvent(), check if you can find any item at the pressed point and either ignore or pass the event to the base class when appropriate.