• 4580阅读
  • 2回复

状态栏编程问题? [复制链接]

上一主题 下一主题
离线mecland
 
只看楼主 倒序阅读 楼主  发表于: 2008-07-17
— 本帖被 XChinux 执行加亮操作(2008-07-17) —
在QMainWindow中用addWidget添加了一个QLabel, 但在QMainWindow中的其它函数中使用QLabel的setText时出现

QObject: Cannot create children for a parent that is in a different thread.

错误
离线weizhy
只看该作者 1楼 发表于: 2008-07-17
Gui控件是不允许在主线程之外的线程里创建和操作的

见assistant:
In GUI applications, the main thread is also called the GUI thread because it's the only thread that is allowed to perform GUI-related operations.
离线mecland
只看该作者 2楼 发表于: 2008-07-17
我是在主线程中进行操作,只是更新是通过工作线程发出的用户事件来触发的
快速回复
限100 字节
 
上一个 下一个