app using "excessive" CPU
-
@Bonnie you nailed it. I moved the load to the c'tor, and everything works much better now.
A couple of notes:
- I turned on my event filter, and it's no longer spewing zillions of events, so I guess my keyPress idea would have worked (if Windows wasn't so lame).
- I tried making my painter a member variable and initializing it in the c'tor, but that didn't work. Any idea why?
Thanks to everyone who looked at this.
-
@Bonnie you nailed it. I moved the load to the c'tor, and everything works much better now.
A couple of notes:
- I turned on my event filter, and it's no longer spewing zillions of events, so I guess my keyPress idea would have worked (if Windows wasn't so lame).
- I tried making my painter a member variable and initializing it in the c'tor, but that didn't work. Any idea why?
Thanks to everyone who looked at this.
@mzimmers To add to @Bonnie it is actually explained in the documentation https://doc.qt.io/qt-5/qpainter.html :
"Warning: When the paintdevice is a widget, QPainter can only be used inside a paintEvent() function or in a function called by paintEvent()."