Results 1 to 6 of 6

Thread: QGraphicsScene doesn't accept Drops

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    258
    Thanks
    22
    Thanked 19 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QGraphicsScene doesn't accept Drops

    Thank you all for replying to my post.
    The reimplementation of dragMoveEvent did the trick .
    I was really frustated yesterday after I couldn't get it to work after 5 hours of trial and error experiments. Today I was demoralized enough to give up and try another approach. I made the QGraphicsView catch the Event.

    This also failed so I looked up the Qt Drag and Drop online documentation and searched for examples and noticed that in the examples dragMoveEvent is also implemented. I did the same and QGraphicsView could successfully catch the events. But it didn't come to my mind to apply this knowledge to GraphiscScene. I just tried it now after reading your replies and it works. Thanks jpn

  2. #2
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    124
    Thanked 38 Times in 30 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGraphicsScene doesn't accept Drops

    It's because QGraphicsScene provides a default implementation of dragMoveEvent that checks if there are items on the scene under the cursor that accept drop events. If not, the event will be ignored, and you won't be allowed to drop.
    Bitto / Andreas Aardal Hanssen - andreas dot aardal dot hanssen at nokia
    Nokia Software Manager, Qt Development

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.