Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Drag ListWidget item outside my main app.
Qt 6.11 is out! See what's new in the release blog

Drag ListWidget item outside my main app.

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 694 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ealioneE Offline
    ealioneE Offline
    ealione
    wrote on last edited by
    #1

    I have a simple app that consist of two ListWidgets, between which I can drag items in order to interactively add them from one list to the other.

    What I need to do now though is by dragging and dropping an item anywhere outside my main app to be able to delete said item. I can't find a way to capture the drop event outside my app though.

    Any ideas on how can a behaviour similar to what I described be achieved?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Just a quick idea but what about checking the target of the QDrag after exec returned. If it doesn't return something belonging to your application you can then act accordingly

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved