Results 1 to 3 of 3

Thread: How to disable the automatic selectioning in a QGraphicsscene?

  1. #1
    Join Date
    Sep 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Question How to disable the automatic selectioning in a QGraphicsscene?

    Hi,

    when I put some QGraphicItems in a QGraphicsscene and give this Items the ItemIsSelectible flag, one item can be selected with a mouse click (all other items are deselected automatically then). If I hold down CTRL key while clicking, the other items hold their selection state. But how can I achive this with another key than CTRL or for example in a special mode, where I do not need to hold down a key for adding items to the selection with clicking on it. I tried nearly everything, but I do not know where to catch and avoid this automatic deselection behaviour. Does anyone know how this could be done?

    Thanks

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to disable the automatic selectioning in a QGraphicsscene?

    if you programatically use QGraphicsItem::setSelected, does that help?

  3. #3
    Join Date
    Sep 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to disable the automatic selectioning in a QGraphicsscene?

    I can select an item with setSelected(), but this does not avoid, that when I click on an item all other items are deselected and I need to avoid this. I tried to reimplement mousePressEvent on both, items and scene, and called setSelected() there but it does not work, because after the event the selected item is deselected from this magic automatic deselection and I do not know where this happens. Even if I avoid the propagation of the mousePressEvent to the base class the deselection occurs.

Similar Threads

  1. Automatic rescale QwtPlotMarker
    By gpsgek in forum Qwt
    Replies: 0
    Last Post: 23rd May 2010, 17:26
  2. automatic reading TXT file
    By sunnysun520 in forum Qt Programming
    Replies: 10
    Last Post: 1st July 2009, 16:00
  3. Automatic UI Verification
    By binggan194 in forum Qt Programming
    Replies: 2
    Last Post: 3rd April 2009, 08:46
  4. Automatic Splitter
    By Katuakina in forum Qt Tools
    Replies: 1
    Last Post: 5th October 2007, 10:29
  5. Automatic Resizing
    By ToddAtWSU in forum Qt Programming
    Replies: 7
    Last Post: 22nd January 2007, 19:41

Tags for this Thread

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.