Results 1 to 15 of 15

Thread: Drag-n-Drop with cut and not copy

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: Drag-n-Drop with cut and not copy

    Ok, the example speaks for itself. Here's a workaround:
    Qt Code:
    1. void TextEdit::dropEvent(QDropEvent *event)
    2. {
    3. QDropEvent drop(event->pos(), Qt::MoveAction, event->mimeData(),
    4. event->mouseButtons(), Qt::ShiftModifier, event->type()); // <-- Qt::ShiftModifier is important
    5. QTextEdit::dropEvent(&drop);
    6. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by jacek; 18th February 2007 at 12:04. Reason: wrapped too long line
    J-P Nurmi

  2. The following user says thank you to jpn for this useful post:

    KjellKod (18th February 2007)

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.