Results 1 to 3 of 3

Thread: Mouse Event

  1. #1
    Join Date
    Feb 2009
    Posts
    189
    Thanks
    2

    Default Mouse Event

    Dear Friends
    I have an GraphicsItem. I want to select it and move it only when the user presses left mouse on the item.How could I achieve this???Can anyone help me please???

  2. #2
    Join Date
    Dec 2007
    Posts
    40
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Mouse Event

    refer to:
    QGraphicsItem::setAcceptedMouseButtons ( Qt::MouseButtons buttons )
    QGraphicsItem::mousePressEvent()

    also refer to QGraphicsItem::GraphicsItemFlags
    Let your work talk for you

  3. #3
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Mouse Event

    use mousePressEvent() and check for Qt::LeftButton

Similar Threads

  1. Replies: 4
    Last Post: 19th February 2009, 11:10
  2. how to send a emulated mouse event to QListWidget
    By yxmaomao in forum Qt Programming
    Replies: 4
    Last Post: 22nd July 2008, 02:49
  3. pass mouse event information to another widget
    By Rooster in forum Qt Programming
    Replies: 5
    Last Post: 12th July 2008, 04:23
  4. Enter event mouse position
    By bunjee in forum Qt Programming
    Replies: 9
    Last Post: 7th May 2008, 18:53
  5. The event fired by the mouse click on the frame
    By Placido Currò in forum Qt Programming
    Replies: 8
    Last Post: 3rd March 2007, 09:05

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.