Skip to content

Instantly share code, notes, and snippets.

@NWYLZW
Last active May 13, 2021 12:23
Show Gist options
  • Save NWYLZW/d33b950df392ca08632579087fb8ebe1 to your computer and use it in GitHub Desktop.
Save NWYLZW/d33b950df392ca08632579087fb8ebe1 to your computer and use it in GitHub Desktop.
sample QThread
class testThread
: public QThread {
Q_OBJECT
public:
bool isLock = true;
void run() {
while (1) {
sleep(1);
qDebug() << "in thread..." << "isLock:" << isLock;
if (!isLock) break;
}
qDebug() << "thread is stop...";
}
public slots:
void lock() {
isLock = false;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment