Results 1 to 4 of 4

Thread: Items gets unselected when clicked on empy space in QIconView?

  1. #1
    Join Date
    Mar 2006
    Posts
    47
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11

    Default 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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default 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.

  3. #3
    Join Date
    Mar 2006
    Posts
    47
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11

    Default 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

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default 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.
    J-P Nurmi

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.