Results 1 to 2 of 2

Thread: Enabling/Disabling QGraphicsItem Selectability en masse

  1. #1
    Join Date
    Mar 2011
    Posts
    25
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Enabling/Disabling QGraphicsItem Selectability en masse

    I have a QGraphicsScene with some items selectable and some items not selectable. We also use layers and all items in a layer are parented to the layer item (for showing/hiding layers). I have a situation where I would like to temporarily disable all selections on all items in the scene and then restore them.

    Is it possible to do this at a high level so that the individual selectable flags aren't changed on the lower level items? Otherwise, I have to scan all of the items in the scene to disable selections, and then restore them in a similar fashion. It might be OK performance wise, but I'm concerned about it, plus if there's an easy way that I'm not seeing, I'd rather try that first.

    Thank you,
    Doug

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

    Default Re: Enabling/Disabling QGraphicsItem Selectability en masse

    You can reimplement mouse events for the view or the scene and call the base class implementation only if you want to allow selecting items.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Enabling Infrared in Qt 4.6.2
    By S P in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 8th July 2010, 11:02
  2. QGroupBox enabling problem
    By Annihilator in forum Newbie
    Replies: 10
    Last Post: 16th April 2010, 16:58
  3. enabling/disabling a QMainWindow?
    By TheRonin in forum Qt Programming
    Replies: 20
    Last Post: 5th April 2007, 12:36
  4. enabling a QTreeWidgetItem as false
    By Kapil in forum Newbie
    Replies: 2
    Last Post: 3rd March 2006, 07:32
  5. Enabling/Disabling QActions in QMenus
    By rshabsin in forum Qt Programming
    Replies: 3
    Last Post: 15th February 2006, 22:13

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
  •  
Qt is a trademark of The Qt Company.