PDA

View Full Version : Disabling drop over some controls



RenatoFerreira
13th June 2015, 21:50
Hi!!

I have a QListWidget, that should have only a simple static function in my application, but is accepting drops and I'm not being able to disable it. I have been trying to change some parameters like DragEnabled, DragDropMode and others without success.

I want to control precisely where the object can be dropped. Is it really possible to be done?

Thank-you,
Renato A. Ferreira

RenatoFerreira
13th June 2015, 23:57
Well... I managed to solve the problem.

How:

* Promoting the widget to a local class (right click over the element in form editor and then clicking in "Promote to...");
* Overriding the dragEnterEvent method to avoid it from accepting the action. An empty implementation did the job.

aamer4yu
15th June 2015, 11:54
Or you could have used QWidget::setAcceptDrops :rolleyes: