Results 1 to 4 of 4

Thread: drag_drop blocks drag_select, please help

Hybrid View

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

    Default Re: drag_drop blocks drag_select, please help

    Why did you reimplement the mouseMove event? It's enough to reimplement QListWidget::mimeData() to provide your own mime data for items in the list.

  2. #2
    Join Date
    Sep 2008
    Posts
    23
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11
    Thanks
    1

    Default Re: drag_drop blocks drag_select, please help

    Ok, I blocked the reimplement of mouseMove event and reimplement QListWidget::mimeData() as following:
    Qt Code:
    1. QMimeData * MyListWgt::mimeData ( const QList<QListWidgetItem *> items ) {
    2. QList<QUrl> list;
    3. list.append(QUrl(currentItem()->text())); // only QUrl in list will be text of actual item
    4.  
    5. // mime stuff
    6. QMimeData *mimeData = new QMimeData;
    7. mimeData->setUrls(list);
    8. return mimeData;
    9. }
    To copy to clipboard, switch view to plain text mode 
    It did not solve the problem. The icons in the listwidget are not consistent after drap&drop (sometimes missing the caption with only icons shown, sometimes missing both). What I want is just pass the selected item info into the drop window with the items in the drag windown unchanged (like copy, but don't really duplicate the items).

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

    Default Re: drag_drop blocks drag_select, please help

    Did you reimplement dropMimeData() as well?

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.