PDA

View Full Version : Drag and drop over scrollArea



akshaysulakhe
10th September 2013, 09:38
Hello friends,
I have a QScrollArea which contains around 10 images(Qlabels). From the left hand side i can drag and drop in this area. But when i drop, i am not actually dropping on the scrollArea, but the labels itself. Because of that my Dropevent function in the scrollArea never gets called. How can i drag drop over these labels. Kindly let me know. Thank you.

aamer4yu
10th September 2013, 10:27
Ignore the drag events from the child (labels)

or you can have a filter installed on the scroll area to intercept the drag events entering the scroll area before it is delivered to the child labels

akshaysulakhe
10th September 2013, 11:27
Hello aamer4yu,
Think of the scroll area like the container and the labels as the content. There is no empty space in the container. So whenever i am dragging and dropping. The drop event will always show the parent widget as the labels(QWidget). I am not sure i can ignore them. The 2nd method you said looks promising. Can you tell me how i can intecept the drag events? Thank you for your time.