Greetings!

I have a treeview and all its columns are delegated.

Requirement:- When I drag a row and try to drop it to another row, I want to show some indication in target row either by drawing a rectangle (highlighting the target row).

In the constructor of the delegate, the event filter has been installed.

QTreeView* pTreeView = dynamic_cast<QTreeView*>(parent); //parent is treeview
pTreeView->viewport()->installEventFilter(this);

And in the eventFilter of this delegate (derived from QStyledItemDelegate), I could catch the MouseMove (or) DragMove event. Also I can get the mouse position and the index on which the cursor is present.

Issue:- With the mouse position, I am trying to draw a rectangle in the paint function. BUT WHEN THE DRAG IS ACTIVE, THE PAINT METHOD IS NOT GETTING CALLED.

It would be great, if somebody throw some light on this issue... Why the paint is not getting called? Is there any other approach to tackle this issue.

P.S: I vastly searched this forum. Two of them had exact issue, but no answer for this.

Regards