TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Tip for resizing Qt windows while retaining good user responsiveness

6 点作者 qwertzlcoatl超过 11 年前

3 条评论

NaterGator超过 11 年前
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&#x27;s resize implementation.<p>Instead he could build a graphics scene using QGraphicsScene (<a href="http://qt-project.org/doc/qt-5.1/qtwidgets/qgraphicsscene.html" rel="nofollow">http:&#x2F;&#x2F;qt-project.org&#x2F;doc&#x2F;qt-5.1&#x2F;qtwidgets&#x2F;qgraphicsscene.ht...</a>) 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&#x27;s scene graph which will be a boon for both performance (<a href="http://blog.qt.digia.com/blog/2013/09/02/new-scene-graph-renderer/" rel="nofollow">http:&#x2F;&#x2F;blog.qt.digia.com&#x2F;blog&#x2F;2013&#x2F;09&#x2F;02&#x2F;new-scene-graph-ren...</a>) and portability. Qt will efficiently manage resizes and draw the scene optimally without overhead associated with a re-purposed widget.<p>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超过 11 年前
Is there any good reference to tips on building GUI libraries? I&#x27;m doing one for a game and I&#x27;m always on the lookout for more tips on architecture and speed optimization.
axilmar超过 11 年前
Qt has layout managers. There is no need for such things.