Results 1 to 3 of 3

Thread: Drag and Drop

  1. #1
    Join Date
    Feb 2010
    Posts
    52
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Default Drag and Drop

    Hi all, I wonder if anyone can help with some drag and drop issues.

    I have a tree with various items in it. I want to be able to drag an item into text editors etc.. which if fairly straightforward to achieve, (by creating suitable QDrag and QMimeData objects and executing QDrag::exec()). However, I want to extend this basic functionality as follows,

    a) Be able to show a representation of the object being dragged in a little preview window attached to the cursor during the drag operation. (I've done this before in Java /Swing simply by creating a window with no decorations and moving it in response to mouse move events). This doesn't seem possible in Qt, (at least on Windows), as the event queue seems blocked during drags. Is there any way around this problem ?

    b) I want to be able to use keyboard modifiers to change the data being dragged. For example, if the object being dragged represents a database table, I want to be able to drag the table name, however, if the alt key is pressed the tablename is inserted as a fully qualified table name. Is there any way to achieve this ?

    Thanks,
    Chris.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Drag and Drop

    Quote Originally Posted by chris_helloworld View Post
    a) Be able to show a representation of the object being dragged in a little preview window attached to the cursor during the drag operation. (I've done this before in Java /Swing simply by creating a window with no decorations and moving it in response to mouse move events). This doesn't seem possible in Qt, (at least on Windows), as the event queue seems blocked during drags. Is there any way around this problem ?
    QDrag::setPixmap()

  3. #3
    Join Date
    Feb 2010
    Posts
    52
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Default Re: Drag and Drop

    Thanks,
    I will give this a go. It doesn't directly resolve my requirements though as it cant be changed after the drag has started, and hense doesnt support my second requirement.

    Cheers,
    Chris.

Similar Threads

  1. Drag Drop Tab and more
    By BingoMaster in forum Newbie
    Replies: 1
    Last Post: 26th October 2009, 06:55
  2. drag and drop
    By christopher in forum Newbie
    Replies: 1
    Last Post: 19th August 2006, 20:59
  3. drag and drop
    By vijay anandh in forum Qt Programming
    Replies: 1
    Last Post: 26th April 2006, 11:46
  4. drag and drop
    By vijay anandh in forum Qt Programming
    Replies: 1
    Last Post: 12th April 2006, 11:54
  5. Drag and Drop (drop example)
    By din9 in forum Qt Programming
    Replies: 1
    Last Post: 23rd January 2006, 18: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.