

Tip for resizing Qt windows while retaining good user responsiveness - qwertzlcoatl
http://robertfelten.com/2013/08/20/tip-for-resizing-qt-windows/

======
NaterGator
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...](http://qt-
project.org/doc/qt-5.1/qtwidgets/qgraphicsscene.html)) 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...](http://blog.qt.digia.com/blog/2013/09/02/new-scene-graph-renderer/))
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.

------
mrlinx
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.

------
axilmar
Qt has layout managers. There is no need for such things.

