> Sent: Friday, 29 January 2016 2:45 PM
> 
> Hi
> I have a `QTreeView`, I control the background colors of items trough a
css.
> When the pointer is over an item his background is greyed.
> 
> I use the signal `entered` to detect which item, aka `QModelIndex`, aka
row,
> is hovered. If I use that signal, is because I have to show a
`QPushButton`
> over a part of the row, the position of the button is at the very right of
the
> row though.
> 
> If no row is hovered, then the button is hidden.
> 
> The click event is related trough the actual hovered row.
> 
> so far so good, all is working but one thing, the background color. When I
> move the pointer over the button, the treeview set the row behind the
> button to "not hovered". I used the paint function in the past, but
because of
> some narrow minded people forcing me to set the background in the css
> stylesheet, I'm facing that issue...
> 
> using the attribute `WA_TransparentForMouseEvents` can't help since I need
> to click on the button.
> 
> so any idea, is welcome.
> 
> I don't know if it can be helpful, but the `QTreeView` is inherited to
> MyTreeView, and this class contains the `QPushButton`
> 
> 
> regards,
> Nicolas

Hi Nicolas, 

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.  

Regards, 

Tony


_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to