Stefan Peter
Stefan Peter

Reputation: 361

Why does drag and drop in Qt stops working?

in our software build in qt 4.8.5 in some cases the drag and drop stops working. There are two places where it should work. One when dragging a file to a certain spot at the application and a second in a QTreeWidget where you can put some leafs into folders.

But on some machines (Windows) both methods just stop working or are not working from the start. Then only a forbidden cursor appears. After a restart of the application drag and drop is working again. It seems not to be a problem with different privileges in windows.

I have no clue where to look for this problem. Any advice is appreciated.

Upvotes: 4

Views: 2358

Answers (2)

subham prasad
subham prasad

Reputation: 31

i've been facing same problem, so i reinstalled qt again and it starting working properly but next day i started facing same issue , so now instead of uninstalling and installing again qt creator , just clean cache and temp file

Upvotes: 0

Stefan Peter
Stefan Peter

Reputation: 361

After some days of searching the web I could find the cause of the problem.

https://bugreports.qt-project.org/browse/qtbug-28601

In our software you can toggle the size of the module which uses a call to setWindowFlags. After that no more drag and drop events are processed.

I could workaround the problem by calling:

setAttribute( Qt::WA_AcceptDrops, false );
setAttribute( Qt::WA_AcceptDrops, true );

at the widgets which need the drag and drop. Hopefully we're updating to Qt 5.x soon. :/

Upvotes: 2

Related Questions