Qt 跨线程访问对象的问题
1.在我的主线程里有一个QWidget* wid指针,
2.在我定义的一个QThread中,我需要用QPixmap::grabWidget(wid)这个方法对wid这个对象截图。
结果:程序在运行的时候报错。
ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to objects owned by a different thread. Current thread f8e7d38. Receiver '' (of type 'QWidget') was created in thread 3e5250",