摘要:
http://blog.csdn.net/lutx/article/details/7353957近来用Qt编写一段多线程的TcpSocket通信程序,被其中Qt中报的几个warning搞晕了,一会儿是说“Cannot create children for a parent that is in a different thread”,有时候又是“QSocketNotifier: socket notifiers cannot be enabled from another thread”,还经常又Assert failure:Cannot send events toobjects own 阅读全文
posted @ 2012-11-30 13:05
snlDream
阅读(357)
评论(0)
推荐(0)
摘要:
POINT 1:QThread类的实例与普通类的实例没什么不同,只是运行着的run()函数会不同例1:class MThread :public QThread { public: MThread(); ~MThread(); void run(); void foo(); ... };class MDialog :public QDialog { ... MThread *mythread; }; MDialog::MDialog() { mythread = new MThread; ... }需要注意的是,在QT中,QThread对象的实例mythread是属于创建它... 阅读全文
posted @ 2012-11-30 10:27
snlDream
阅读(208)
评论(0)
推荐(0)