PDA

View Full Version : QTreeView: mouse move on an item to highlight it as pre-selection



jasonhxs
13th August 2014, 16:00
Hi,

As pre-selection, when mouse move on an item in QTreeView, I want to raise the border of the item, but no solution yet. Any suggestion will be appreciated, thanks.

anda_skoa
13th August 2014, 16:33
You could overwrite the view's mouseMoveEvent() handler and use itemAt() to find the item you are currently at.

There is also an entered() signal.

Cheers,
_

jasonhxs
14th August 2014, 04:44
Hi,

Thanks, yes, I catch it, do you know how to raise the border of item in QTreeView?

anda_skoa
14th August 2014, 12:15
You can use a custom item delegate that draws differently if the cell is hovered over.

Cheers,
_

jasonhxs
18th August 2014, 05:37
Hi,

I use style sheet with item hover setting, thanks.

anda_skoa
18th August 2014, 07:00
Ah, even simplier :)

Cheers,
_