Results 1 to 5 of 5

Thread: Cannot cancel Drag when Dialog exec() is fired [Windows]

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,335
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    317
    Thanked 871 Times in 858 Posts

    Default Re: Cannot cancel Drag when Dialog exec() is fired [Windows]

    I think QDrag::cancel() works only on drag operations created internally by Qt, not on drag operations started in your own application code. An example of this might be reordering the rows / columns in a table widget when a "movable" property is set.

    If the QDrag instance is your own, then you can try calling deleteLater() using its pointer. If that doesn't work, then maybe you will have to redesign your interaction so this problem can't occur.

    In my experience, if you start a drag operation and then click the ESC key, this will cancel the drag. I would think that this same interaction mode is supported in Qt. So you could also try posting a QKeyEvent to the QDrag instance to simulate a user key press.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  2. #2

    Default Re: Cannot cancel Drag when Dialog exec() is fired [Windows]

    Tried deleteLater(), ESC key simulating and mouse release simulating but, unfortunately, same problem occurs.

    I have no problem when calling QDialog::show(), so I will try to re-implement my code using this method.

    Thank you for your replies.

Similar Threads

  1. Replies: 16
    Last Post: 11th June 2014, 07:16
  2. Strange failure (dialog exec close qt 5.1)
    By giancarlo.fir in forum Qt for Embedded and Mobile
    Replies: 4
    Last Post: 29th October 2013, 10:07
  3. Replies: 1
    Last Post: 15th August 2009, 11:23
  4. mouseMoveEvent during drag is not fired
    By gruszczy in forum Qt Programming
    Replies: 7
    Last Post: 24th February 2009, 21:04
  5. QDialog::exec() cereates no modal dialog
    By sboesch in forum Qt Programming
    Replies: 8
    Last Post: 27th March 2006, 17:03

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.