Results 1 to 4 of 4

Thread: turning off bounding rectangle around QGraphicsPixmapItem

  1. #1
    Join Date
    Sep 2009
    Posts
    60
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default turning off bounding rectangle around QGraphicsPixmapItem

    I have QGraphicsScene with a bunch of QGraphicsPixmapItems in it. When I click on the item, the bounding rectangle around the pixmap is displayed. How do I turn off displaying the bounding rectangle?

  2. #2
    Join Date
    Sep 2009
    Posts
    60
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: turning off bounding rectangle around QGraphicsPixmapItem

    Any suggestions?

  3. #3
    Join Date
    Oct 2006
    Posts
    279
    Thanks
    6
    Thanked 40 Times in 39 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: turning off bounding rectangle around QGraphicsPixmapItem

    This is the default way of a QGraphicsItem to show it has been selected.
    If you don't need the feature you could call
    Qt Code:
    1. item->setFlag(QGraphicsItem::ItemIsSelectable, false)
    To copy to clipboard, switch view to plain text mode 
    otherwise you have to subclass QGraphicsPixmapItem and override the paint method.

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: turning off bounding rectangle around QGraphicsPixmapItem

    Quote Originally Posted by spud View Post
    otherwise you have to subclass QGraphicsPixmapItem and override the paint method.
    ... and chance the QStyleOptionGraphicsItem (e.g. remove QStyle::State_HasFocus). Search the forum. This question was asked several times.

Similar Threads

  1. turning widgets to original state
    By helvin in forum Qt Programming
    Replies: 2
    Last Post: 21st September 2009, 08:35
  2. Getting the bounding rectangle
    By ioannis in forum Qt Programming
    Replies: 1
    Last Post: 22nd May 2009, 00:41
  3. Html text bounding rectangle
    By bunjee in forum Qt Programming
    Replies: 8
    Last Post: 15th May 2008, 11:25
  4. Turning off ToolTips
    By steg90 in forum Qt Programming
    Replies: 11
    Last Post: 16th May 2007, 17:00
  5. QTableWidget (resizing rows, turning off selection, etc.)
    By kiss-o-matic in forum Qt Programming
    Replies: 6
    Last Post: 11th January 2007, 01:57

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.