Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
4.1.5
-
None
Description
The following QTreeView subclass demonstrates the issue:
class TreeView : public QTreeView
{
public:
TreeView()
protected:
void dragEnterEvent(QDragEnterEvent *e)
void dragMoveEvent(QDragMoveEvent *e)
{ qDebug() << "Move" << e->pos(); checkEvent(e); }private:
void checkEvent(QDropEvent *e)
};
When dragging anything into the widget at a point where there is not a top-level item, then the cursor shows an accepted state for the very first pixel, and then with the next mouse move updates the cursor. Since a drop at that point would fail this is misleading to the user.
Not accepting the QDragEnterEvent at that point (i.e. call checkEvent from that event handler as well) makes Qt never deliver any QDragMoveEvents anymore (as the QDragManager's current target is not set in QApplication::notify).