Results 1 to 2 of 2

Thread: How change selected item rectangle on QGraphicsScene

  1. #1
    Join Date
    May 2010
    Location
    Russia
    Posts
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default How change selected item rectangle on QGraphicsScene

    Hi all.
    I need to change selected item rectangle (rectangle that draws around selected item) properties (for example rectangle pen width), does anybody knows how can i do it?
    Last edited by xray2000; 18th May 2010 at 16:22.

  2. #2
    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: How change selected item rectangle on QGraphicsScene

    Subclass the graphics item and reimp the paint method. There you can check the option parameter if the item is selected. If so react on it and set a pen or what you want and call the base class implementation.

Similar Threads

  1. Replies: 2
    Last Post: 29th March 2010, 13:34
  2. popupmenu for QTreeWidget's item when a particular item selected.
    By vinod sharma in forum Best Practices in Qt Programming
    Replies: 1
    Last Post: 22nd January 2010, 11:45
  3. Replies: 1
    Last Post: 20th January 2010, 09:38
  4. how to zoomin the selected rectangle?
    By lengshuang in forum Qt Programming
    Replies: 0
    Last Post: 25th April 2009, 03:42
  5. QGraphicsView : change selected rectangle style
    By kghose in forum Qt Programming
    Replies: 2
    Last Post: 28th July 2008, 19:12

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.