[Interest] how to add a buton to the hovered item from a qtreeview
Nicolas Jäger
jagernicolas at legtux.org
Fri Jan 29 05:37:53 CET 2016
Hi,
> I think that you will need to use WA_TransparentForMouseEvents, and then
> handle the MouseDown event in MyTreeView to check where along the row the
> user has clicked to see if it is within the button.
in that case I won't really clicked on the button right? in that case I won't have the css
QPushButton:clicked{...}
used, right ?
today I try to figure, without success, if it would be possible to add some custom sub-controle like
the `hover`, and to set the sub-control from the code. For example, if I could have:
MyTreeview:item:WasLastSelected{ color-background: red}
since in MyTreeView object I have an eventFilter linked to the button, I can detect when my mouse
move over the button. So, if when this event is triggered I could set WasLastSelected = true
it would solved my problem (it's a guess, but I guess, it's a good guess)
Regads,
Nicolas
More information about the Interest
mailing list