• 4237阅读
  • 0回复

QT 性能提升的技巧 [复制链接]

上一主题 下一主题
离线yj_yulin
 

只看楼主 倒序阅读 楼主  发表于: 2009-03-13
When writing Qt applications there are a few pointers that you can keep in mind to avoid adding
unneeded 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 of
signals 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上看到的。
与一般的说法还真有点不一样的哦。
快速回复
限100 字节
 
上一个 下一个