如果我有
class Worker : public QObject
{
Q_OBJECT
public:
Worker();
public slots:
void doStuff();
}
像这样运行它(假设我们在Foo
类中):
auto worker = new Worker;
connect(this, &Foo::stuffRequested, worker, &Worker::doStuff);
QThread workerThread;
worker->moveToThread(&workerThread);
workerThread.start();
现在,如果我频繁发出stuffRequested()
,以致工人无法跟上情况了?信号调用是否排队?