PDA

View Full Version : QStyledItemDelegate and QStyle::State_MouseOver



moti.lahiani
19th January 2011, 06:36
Hello all
I implemented myDelegate class that inherit QStyledItemDelegate.
in the paint() i check if the index.columne is 2 do some painting
when i run and hover a row all other columnes are marked as hover (by color)
except the columne 2
i try to use the following in the paint method
if (option.state & QStyle::State_MouseOver)
painter->fillRect(option.rect, Qt::red);
and its colored the columne 2 in red and all other columne in the system hover color

my question is how do i take/know the system color for the hover in the ::paint

if this post is Incomprehensible please let me know and i try to explain it with more details or code
thanks a lot