当前位置: 首页>>代码示例>>C++>>正文


C++ QEventLoop::disconnect方法代码示例

本文整理汇总了C++中QEventLoop::disconnect方法的典型用法代码示例。如果您正苦于以下问题:C++ QEventLoop::disconnect方法的具体用法?C++ QEventLoop::disconnect怎么用?C++ QEventLoop::disconnect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QEventLoop的用法示例。


在下文中一共展示了QEventLoop::disconnect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: inPort

void KPAOS4Checker::check()
{
    QString inPort(Settings::get().getMidiInPort());
    QString outPort(Settings::get().getMidiOutPort());

    if(inPort.isEmpty() || outPort.isEmpty())
    {
        SettingsDialog settingsDialog(nullptr);
        settingsDialog.exec();
        inPort = Settings::get().getMidiInPort();
        outPort = Settings::get().getMidiOutPort();
    }

    if(Midi::get().openPorts(inPort, outPort))
    {
        QEventLoop el;
        el.connect(this, &KPAOS4Checker::stopLoop, &el, &QEventLoop::quit);
        el.connect(&stompDelayObj, &Stomp::onOffReceived, this, &KPAOS4Checker::onOfReceived);
        el.connect(mTimer, &QTimer::timeout, this, &KPAOS4Checker::timerTimeout);
        mTimer->start(500);
        stompDelayObj.requestOnOff();
        el.exec();
        el.disconnect(this, &KPAOS4Checker::stopLoop, &el, &QEventLoop::quit);
        el.disconnect(&stompDelayObj, &Stomp::onOffReceived, this, &KPAOS4Checker::onOfReceived);
        el.disconnect(mTimer, &QTimer::timeout, this, &KPAOS4Checker::timerTimeout);
    }
}
开发者ID:virango,项目名称:Toaster,代码行数:27,代码来源:KPAOS4Checker.cpp

示例2: 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);
}
开发者ID:,项目名称:,代码行数:31,代码来源:

示例3: slotEnter

void Vkeybord::slotEnter()
{
    m_lbWaitKeyIn->setText(ui->lineEdit->text());
    qDebug()<<"parent name : "<<m_lbWaitKeyIn->parent()->objectName()<<" ,lb objname : "<<m_lbWaitKeyIn->objectName()<<" lbText: "<<m_lbWaitKeyIn->text();

    ui->lineEdit->setText("");
    m_ani->setStartValue(QPoint(0,0));
    m_ani->setEndValue(QPoint(0,height()));

    QEventLoop loop;
    loop.connect(m_ani,SIGNAL(finished()),&loop,SLOT(quit()));
    m_ani->start();
    loop.exec();
    hide();

    loop.disconnect();
}
开发者ID:roger0816,项目名称:BRC,代码行数:17,代码来源:Vkeybord.cpp


注:本文中的QEventLoop::disconnect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。