本文整理汇总了C++中QEventLoop::deleteLater方法的典型用法代码示例。如果您正苦于以下问题:C++ QEventLoop::deleteLater方法的具体用法?C++ QEventLoop::deleteLater怎么用?C++ QEventLoop::deleteLater使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QEventLoop
的用法示例。
在下文中一共展示了QEventLoop::deleteLater方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: waitForRequestFinished
// Wait for request to complete
bool QOrganizerItemRequestQueue::waitForRequestFinished(
QOrganizerAbstractRequest* req, int msecs)
{
// Verify that request exists in this manager
if (!m_abstractRequestMap.keys().contains(req))
return false;
// Verify that request is active
if (req->state() != QOrganizerAbstractRequest::ActiveState)
return false;
// Create an event loop
QEventLoop *loop = new QEventLoop(this);
// If request state changes quit the loop
QObject::connect(req, SIGNAL(stateChanged(QOrganizerAbstractRequest::State)), loop, SLOT(quit()));
// Set a timeout for the request
// NOTE: zero means wait forever
if (msecs > 0)
QTimer::singleShot(msecs, loop, SLOT(quit()));
// Start the loop
loop->exec();
loop->disconnect();
loop->deleteLater();
return (req->state() == QOrganizerAbstractRequest::FinishedState);
}