The author would benefit greatly from using the appropriate UI components to accomplish his goal instead of kludging a rate limiting mechanism onto his MainWindow's resize implementation.
Instead he could build a graphics scene using QGraphicsScene (http://qt-project.org/doc/qt-5.1/qtwidgets/qgraphicsscene.ht...) with a nice normalized coordinate system which logically represents the namespace size in the SSD on UI elements designed to be rectangles. Adding a view of that scene onto his window is trivial, and as an added bonus he gets the power of Qt's scene graph which will be a boon for both performance (http://blog.qt.digia.com/blog/2013/09/02/new-scene-graph-ren...) and portability. Qt will efficiently manage resizes and draw the scene optimally without overhead associated with a re-purposed widget.
His approach does achieve the desired goal and is probably appropriate in some circumstances, but in this instance he should take a step back and assess if there is a greater fundamental problem with his design.
Is there any good reference to tips on building GUI libraries? I'm doing one for a game and I'm always on the lookout for more tips on architecture and speed optimization.
The author would benefit greatly from using the appropriate UI components to accomplish his goal instead of kludging a rate limiting mechanism onto his MainWindow's resize implementation.
Instead he could build a graphics scene using QGraphicsScene (http://qt-project.org/doc/qt-5.1/qtwidgets/qgraphicsscene.ht...) with a nice normalized coordinate system which logically represents the namespace size in the SSD on UI elements designed to be rectangles. Adding a view of that scene onto his window is trivial, and as an added bonus he gets the power of Qt's scene graph which will be a boon for both performance (http://blog.qt.digia.com/blog/2013/09/02/new-scene-graph-ren...) and portability. Qt will efficiently manage resizes and draw the scene optimally without overhead associated with a re-purposed widget.
His approach does achieve the desired goal and is probably appropriate in some circumstances, but in this instance he should take a step back and assess if there is a greater fundamental problem with his design.