PDA

View Full Version : QTreeWidget - Drag and drop - highlight tree widget item with focus



lpkincaid
17th November 2008, 23:26
I have a QTreeWidget subclass with drop enabled. As I drag into the tree widget, I want the QTreeWidgetItem to highlight indicating the tree node where the drop will occur.

I am receiving the events dragEnterEvent, dragMoveEvent, and dropEvent.

How do I get the highlight behavior as the drag is occurring?

Thank you in advance

aamer4yu
18th November 2008, 06:57
May be u will need a delegate...
if mouse is over a item, set some user defined role for this item.
Then in the paint function of the delegate, use this role to paint the background :)