Results 1 to 5 of 5

Thread: Drag 'n Drop problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Drag 'n Drop problem

    I meant this:
    Qt Code:
    1. void QTemplateWidget::dragEnterEvent (QDragEnterEvent *event)
    2. {
    3. event->accept();
    4. }
    To copy to clipboard, switch view to plain text mode 

    and

    Qt Code:
    1. if(!event->mimeData()->hasText())
    2. {
    3. event->ignore();
    4. return;
    5. }
    To copy to clipboard, switch view to plain text mode 

    The docs suggest:

    Qt Code:
    1. void Window::dragEnterEvent(QDragEnterEvent *event)
    2. {
    3. if (event->mimeData()->hasFormat("text/plain"))
    4. event->acceptProposedAction();
    5. }
    To copy to clipboard, switch view to plain text mode 

    You shouldn't accept every type that exists like you do.

  2. #2
    Join Date
    Jan 2006
    Location
    Frankfurt, Germany
    Posts
    34
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Drag 'n Drop problem

    yeah, thanks.

Similar Threads

  1. Drag and Drop problem
    By ScoOteR in forum Qt Programming
    Replies: 16
    Last Post: 19th May 2010, 14:57
  2. Problem with Drag Drop for QWT Graph
    By Ankitha Varsha in forum Qwt
    Replies: 2
    Last Post: 23rd January 2008, 05:21
  3. Problem wirh Drag and Drop for QWT Graph
    By Ankitha Varsha in forum Qwt
    Replies: 1
    Last Post: 22nd January 2008, 12:23
  4. Problem with a cursor during Drag and Drop
    By mtrpoland in forum Qt Programming
    Replies: 1
    Last Post: 28th December 2007, 15:46
  5. Drag n Drop problem
    By ScoOteR in forum Qt Programming
    Replies: 1
    Last Post: 21st March 2007, 10:52

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.