Chinaunix首页 | 论坛 | 博客
  • 博客访问: 349209
  • 博文数量: 42
  • 博客积分: 1896
  • 博客等级: 上尉
  • 技术积分: 615
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-19 14:47
文章分类

全部博文(42)

文章存档

2012年(1)

2011年(21)

2010年(16)

2009年(4)

分类: C/C++

2011-03-11 22:58:36

QString:
1.Using % instead of + to connect multi string to one, it's more efficient.
2.在定义了Macro:QT_NO_CAST_FROM_ASCII的代码使用QLatin1String来包装const char *更高效。

QThread:
1.
The child of a QObject must always be created in the thread where the parent was created.This implies, among other things, that you should never pass the QThread object (this) as the parent of an object created in the thread (since the QThread object itself was created in another thread).

2.
Event driven objects may only be used in a single thread. Specifically, this applies to the timer mechanism and the network module. For example, you cannot start a timer or connect a socket in a thread that is not the object's thread.

3.
You must ensure that all objects created in a thread are deleted before you delete the . This can be done easily by creating the objects on the stack in your run() implementation.
阅读(585) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~