Failed to create a timer (当前程序已使用了 Window 管理器对象
原因:QTimer::singleShot(timeout, &loop;, SLOT(quit()));
…
}
新建singleShot太多
解决办法:换一种实现方式即可
QTimer t;
t.setSingleShot (true);
connect (& t, & QTimer; :: timeout, & loop ;, & QEventLoop; :: quit);
t.start (timeout);