PDA

View Full Version : How to prevent QListWidget from itemdragging



Arthur
14th April 2006, 12:53
Hello,

In the designer I set 'dragenabled' to false.
The help says:
"This property holds whether the view supports dragging of its own items."

Unfortunately I can still drag items...(target platform is Win32) how can I prevent my QListWidget from doing this?

Regards,
Arthur

wysota
14th April 2006, 12:56
Could you provide a minimal compilable example which reproduces the problem?

Arthur
14th April 2006, 13:23
Here it is.

wysota
14th April 2006, 13:32
This example is far from being minimal :)

You can drag items because movement property of your listwidget is set to Snap. Try changing it to QListView::Static.

Arthur
14th April 2006, 14:08
Sorry I couldn't 'isolate' the problem otherwise than just inserting my GUI file :p

wysota
14th April 2006, 16:38
Sorry I couldn't 'isolate' the problem otherwise than just inserting my GUI file :p

The point of making a minimal example is that the author often finds and resolves the problem while trying to reproduce it. Another point is that it's easier for others to do anything with that example (modify it or whatever) and they don't have to read a bunch of code to understand it.

Arthur
17th April 2006, 21:41
Ok, next time I'll behave ;-)

Changing it to QListView::Static worked by the way, thanks.