Im trying to develop a program which have many of my custom widget. In my widget i have a crosshair mouse pointer and when i move it in one of my widgets all of them must sense it and the crosshair must react on every single widget.
I have a self.update() on the end of the paintEnent function. every thing seems good but a very huge CPU usage.
as you said ’ If a widget is simple enough (like ours is) you can often get away with simply redrawing the entire thing any time anything happens. But for more complicated widgets this can get very inefficient. For these cases the paintEvent
includes the specific region that needs to be updated. We’ll make use of this in later, more complicated examples.’
I have tried to do this but not successful. please make a good example.