QTreeView or QHeaderView resize cursor
-
I have a class that inherits from QTreeView, I would like the mouse cursor to change to the Qt::SizeHorCursor cursor when the mouse is over the column boundary of the QHeaderView columns. This doesn't seem to be built into QHeaderView or QTreeView automatically. I have enabled mouse tracking of both the QTreeView and the QHeaderView but I do not get the mouseMove events unless the left mouse button is pressed which doesn't help me to implement my own routine to change the cursor.
Has anyone already solved this that can share code samples?
Thanks
ddolby -
What Qt version do you use?
Do you set resize mode of header view (http://qt-project.org/doc/qt-4.8/qheaderview.html#ResizeMode-enum) to interactive? -
I am running Qt 4.8.3 and the resize mode is interactive.
-
Hi, try to add
@
setMouseTracking(true);
@to your view class
-
as I indicated in my original post. I have enabled mouse tracking.
-
Hi @ddolby
We do have the same problem, interestingly seems that this problem is new on our application (like it came with a Qt upgrade). Did you found a solution?