使用PyQt5的时候,在使用多线程的时候,会报错: QObject: Cannot create children for a parent that is in a different thread. (Parent is QLabel(0x2c1964c0ba0), parent’s thread is QThread(0x2c18e6db8e0), current thread is QT
QObject::connect: Cannot queue arguments of type 'QMap<QString,QString>',(Make sure 'QMap<QString,QString>' is registered using qRegisterMetaType().). 上述错误,只有在跨线程信号传递时才会出现. 因为QMap是QT可识别的基本类型
问题:运行后点击QPushButton时,控制台报错,并且点击没有响应点击事件 //信号与槽关联connect(startButton, &QPushButton::click, this, &ThreadDlg::slotStart); //点击报错,控制台打印的错误信息QObject::connect: signal not found in QPushButton 解决方案: