Results 1 to 6 of 6

Thread: Drawing rectangles in QT

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Jan 2012
    Posts
    66
    Platforms
    Windows
    Thanks
    20
    Thanked 2 Times in 2 Posts

    Default Re: Drawing rectangles in QT

    Then you should reimplement some protected functions in your QGraphicsItems, particularly mousePressEvent, mouseMoveEvent, and mouseReleaseEvent. mousePressEvent would notify the item to draw a line (probably another QGraphicsItem), from the initial click location to mouseMoveEvent's current location. mouseReleaseEvent could call scene().itemAt() to determine which node is at the mouse release location. Something like that.

  2. The following user says thank you to wayfaerer for this useful post:

    andreahmed (26th February 2012)

Similar Threads

  1. Replies: 1
    Last Post: 19th April 2011, 11:17
  2. Replies: 0
    Last Post: 14th November 2010, 13:36
  3. Replies: 1
    Last Post: 9th August 2010, 19:44
  4. editable rectangles
    By parmar ranjit in forum Qt Programming
    Replies: 3
    Last Post: 20th February 2008, 09:59
  5. Replies: 4
    Last Post: 17th January 2006, 17:46

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.