Results 1 to 7 of 7

Thread: How can I implement rubber-band with graphics view items?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Sep 2009
    Posts
    49
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How can I implement rubber-band with graphics view items?

    Check this:
    http://doc.trolltech.com/4.5/qgraphicsview.html#dragMode-prop
    and you have three types of drag mode supported including rubber band selection mode.

    To find out if an item is selected by clicking it or when it comes under rubber band selection region you can use this condition in paint event:
    Qt Code:
    1. if (option->state & QStyle::State_Selected) {
    2. // draw a rectangle around selected object
    To copy to clipboard, switch view to plain text mode 
    Prashant


    qt-sdk-win-opensource-2009.03.1.exe
    Python 2.6.3
    PyQt-Py2.6-gpl-4.6-1
    Win XP, 32 Bit

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

    FinderCheng (8th November 2009)

Similar Threads

  1. Graphics View: Drawing Items that don't scale
    By Disperato in forum Qt Programming
    Replies: 5
    Last Post: 6th July 2009, 17:16
  2. Graphics View and the Pixmap
    By spawn9997 in forum Qt Programming
    Replies: 2
    Last Post: 26th June 2009, 22:12
  3. Replies: 6
    Last Post: 8th June 2009, 21:44
  4. Replies: 5
    Last Post: 17th February 2009, 04:35
  5. Cann't move movable items on custom graphics view
    By wojtekw in forum Qt Programming
    Replies: 2
    Last Post: 3rd March 2008, 21:30

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.