-
paint method
hi
I have a statement like in the following;
if( option->state & QStyle::State_MouseOver)
{
....
}
in the paint method.
The problem is that the bitwise operation always return 0 so I couldn't go through the if. Do I need to do extra things before if?
Thanks in advance.
-
Re: paint method
Obviously the state never has that flag set. Are we talking about QGraphicsItem subclass or what? Did you tell the item you want to receive hover events for it?
-
Re: paint method
Hi,
We are talking about QGraphicsItem subclass and no I didn't tell the item to receive hover events. I'am not very fimiliar with QGraphicsItem so I will be very thankful if you give me some tips about how to do it.
Thanks in advance.
-
Re: paint method
use setAcceptHoverEvents(bool) of QGraphicsItem..this will enable your graphics item to get the hover events..only then would the option->state variable have mouseover state.
-
Re: paint method
Hi,
Thanks both of you for your help again.
-
Re: paint method
Hi,
I have faced with another paint method problem now. How could I make the item enter its QGraphicsItem:: paint method from the outside?
update(boundingRect()) did work but I want immediate piant access.
thanks in advance.
-
Re: paint method