Search code examples
qtdrag-and-dropqt4ogreqlistwidget

Get mouse position of the QDragEnterEvent


As the photo below shows, I want to get the mouse position on the canvas while dropping a QListWidgetItem to the canvas, this mouse position will facilitate to me getting the object I dropped the item on.

More explanation: The dragging and dropping will be in my canvas class, I want to check if the dragging and dropping is from the QListWidgetItems, and if so it will get the current mouse position.

Drag QListWidgetItem to the Ogre canvas


Solution

  • QDragEnterEvent inherits from QDropEvent.

    Have you tried...pos()?