user1872099
user1872099

Reputation: 95

Qt repaint paintEvent called but widget not updating

My paintEvent has access to a pointer whose value changes from time to time and what gets painted depends on these values. With basic debugging I'm sure that this function is being called but the window does not get updated. The new stuff only appears on the window when it loses focus to another application.

If this is about performance I can set a static variable in the paintEvent to check if the pointer has been updated or not to avoid unnecessary repaints. It would be nice if Qt would just paint when I told it to.

I was hoping someone could help me out or point me in the direction of the right documentation. Thanks.

Upvotes: 4

Views: 7659

Answers (1)

Reza Ebrahimi
Reza Ebrahimi

Reputation: 3689

you must call update() method to repaint your widget.

Upvotes: 5

Related Questions