QT 性能提升的技巧

weixin_38066087 2019-09-19 06:08:38
When writing Qt applications there are a few pointers that you can keep in mind to avoid addingunneeded overhead to your code.-----Evaluate if you really need to inherit QObject. Sometimes you do it just out of habit.-----Avoid the Q_OBJECT macro if you can. You need the macro if you add new signals, slots or properties, or if you use the qobject_cast function with your class.-----If performance counts, use custom events to pass information between threads instead ofsignals and slots.-----Try to avoid copying data by adding implicit sharing to your complex data carrying classes.See more at http://doc.trolltech.com/4.5/shared.html .从Ensuring Maximum Performance with Qt上看到的。与一般的说法还真有点不一样的哦。
...全文
34 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

433

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧