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. Intra and inter application drag and drop; how know if a drag originated in self/this?

Intra and inter application drag and drop; how know if a drag originated in self/this?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 667 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.
  • B Offline
    B Offline
    bootchk
    wrote on last edited by
    #1

    Using Qt, if you start a drag ( create a QDrag and call exec_() on it), is there any way to distinguish DragMoveEvents() from drags that started in this app instance, from drags that started in another app instance?

    The context is, my app already implements drag of document elements without using the Qt D&D mechanisms. (Its for repositioning, I just call QGraphicItem.setPos().) Lets refer to that as a 'local drag.' But I want to support drag to other applications ('external drag'.) I plan to create a QDrag only when the mouse (with button down) leaves my main window. But it seems like there might be a grab in effect, and this app instance might receive DragMoveEvents() for a local drag that started in this (especially if the user moves the mouse back into any window of this app.)

    I suppose I could just set a flag.

    Or possibly I should forego my implementation of a 'local drag', except that entails extra conversions back and forth to QMimeData. (Qt's D&D, as opposed to my own implementation, isn't more useful to the user, the user can still see that the document element is being dragged because I ghost it.)

    I don't think that QDrag.source() widget pointer will distinguish local from external drag. It seems to me that drops from external apps could not refer to widgets in the drag source app. I.E. a QDrag.source() always refers to a widget in the app that is receiving a drag, even an external drag that started in another app. I.E. 'source' cannot mean 'source app's widget', only: 'the widget in this app where the drag first entered this app's windows.'

    Or am I missing the fact that I won't receive QDragMoveEvents() in the same widget that started a drag?

    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