dialog.h: #ifndef DIALOG_H #define DIALOG_H #include <QDialog> #include "masterthread.h" //这里的写法有点..为什么不直接加头文件 QT_BEGIN_NAMESPACE class QLabel; class QLineEdit; class QSpinBox; class QPushButton; class QComboBox; QT_END_NAMESPACE class Dia
多线程时出现如下警告信息: A mutex must be unlocked in the same thread that locked it: 原因可能有二: 1.创建QMutex不在当前线程: 2.QWaitCondition::wait 调用前没有调用QMutex::lock: 解决方法: 1.在run函数中创建QMutex: ... m_pMutex = new QMutex(); ... 2.wait前调用lock: QMutexLocker locker(m_pMutex); m_