Results 1 to 5 of 5

Thread: Resizing and transforming of QGraphicsItem's

  1. #1
    Join Date
    Apr 2008
    Posts
    196
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    1

    Default Resizing and transforming of QGraphicsItem's

    Hey @all,

    i've started to create a simple drawing editor for my own.
    So, i have 2 questions about that:
    1.) How can i draw "self resizing objects" (Rectangle, ellipse, ...).
    With "self resizing objects" i mean, that i click with the mouse onto the graphicsscene and move the mouse while the left mouse key is pressed,
    to draw e.g. rectangles in different sizes?
    2.) Is there already a function or something similar to QGraphicsItem::ItemIsMoveable or QGraphicsItem::ItemIsSelectable which draws a border around the object with 8 small rectangles, so i can resize, transform or rotate the object?

    I've already read the diagram scene example, but there aren't such functions used.

    Thanks in advance

    Best Regards
    NoRulez

  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: Resizing and transforming of QGraphicsItem's

    Quote Originally Posted by NoRulez View Post
    1.) How can i draw "self resizing objects" (Rectangle, ellipse, ...).
    With "self resizing objects" i mean, that i click with the mouse onto the graphicsscene and move the mouse while the left mouse key is pressed,
    to draw e.g. rectangles in different sizes?
    Reimp mousepress, mousemove and mouserelease. On press you create a new item. on move you alter the rect and on release you "close" the item (=do nothing)

    2.) Is there already a function or something similar to QGraphicsItem::ItemIsMoveable or QGraphicsItem::ItemIsSelectable which draws a border around the object with 8 small rectangles, so i can resize, transform or rotate the object?
    No, but search the forum there were some threads about this one year ago, I think. And in the book from Johan you will find an example for that.

  3. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Resizing and transforming of QGraphicsItem's

    Check this Fotowall application

  4. #4
    Join Date
    Apr 2008
    Posts
    196
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    1

    Default Re: Resizing and transforming of QGraphicsItem's

    I read the Book, but there isn't an example about this.

    Best Regards
    NoRulez

  5. #5
    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: Resizing and transforming of QGraphicsItem's

    see page 220ff. "Interacting Using a Custom Item".

Similar Threads

  1. mouseDoubleClickEvent on QGraphicsItem's
    By been_1990 in forum Qt Programming
    Replies: 11
    Last Post: 7th August 2009, 02:52
  2. QXmlQuery not transforming XSL
    By jwc in forum Qt Programming
    Replies: 4
    Last Post: 24th June 2009, 09:26
  3. Transforming coordinates
    By Benjamin in forum Qt Programming
    Replies: 2
    Last Post: 22nd May 2009, 14:18
  4. How to get QGraphicsItem's filled color
    By wisconxing in forum Newbie
    Replies: 1
    Last Post: 2nd February 2009, 14:48
  5. mapping / transforming coordinates
    By bjh in forum Qt Programming
    Replies: 1
    Last Post: 24th October 2007, 15:33

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.