Results 1 to 4 of 4

Thread: [QGraphicsItem] isMovable && dragLeaveEvent

  1. #1
    Join Date
    Nov 2007
    Posts
    6

    Question [QGraphicsItem] isMovable && dragLeaveEvent

    Hi all,

    I have a GraphicsPixmapItem and have set the flags to isMoveable.

    Now I would like to know where the drag ended.

    I've reimplemented the dragLeaveEvent method, but they seem not to triggered.

    It must be possible, but I don't know how.
    Do I also need to enable something in te QGraphicsScene?


    Thanks in advance,

    Spitz

  2. #2
    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: [QGraphicsItem] isMovable && dragLeaveEvent

    You dont need to override the drag events...
    just set the flags,, and thats it. remove the drag code and verify

  3. #3
    Join Date
    Nov 2007
    Posts
    6

    Default Re: [QGraphicsItem] isMovable && dragLeaveEvent

    But how do I know when the drag was ended to ask the current cursor position?

    I need to know when a drag starts/ends.

    Thanks,

    Spitz

  4. #4
    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: [QGraphicsItem] isMovable && dragLeaveEvent

    What do u need it for ??
    You can also check mouseReleaseEvent if it suits ur need,, bec when drag will end, the user will definitely release the mouse

Tags for this Thread

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.