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


C++ QStateMachine::stop方法代码示例

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


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

示例1: testLoadBackupRestoreStateOnEntryExit

void HomeScreenStatePluginTest::testLoadBackupRestoreStateOnEntryExit()
{
    HbInstance::instance();
    HbMainWindow mainWindow;
    mainWindow.show();   
    QCoreApplication::sendPostedEvents();
   
    QStateMachine *sm = new QStateMachine;
    HsBackupRestoreState *brs = new HsBackupRestoreState;

    sm->addState(brs);
    sm->setInitialState(brs);    
    

    QFinalState *fs = new QFinalState;
    sm->addState(fs);

    brs->addTransition(this, SIGNAL(finishStateMachine()), fs);

    sm->start();   
    QCoreApplication::sendPostedEvents();  
    emit finishStateMachine();

    sm->stop();
    // main window deleted -> HsGui must be deleted also
    delete HsGui::takeInstance();
    delete sm;
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:28,代码来源:t_hsbackuprestorestate.cpp

示例2: createArrangeCollection

// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
//
void MenuStatesTest::createArrangeCollection()
{
#ifdef Q_OS_SYMBIAN
    User::ResetInactivityTime();//it should help for Viewserver11 panic
#ifdef UT_MEMORY_CHECK
    __UHEAP_MARK;
#endif//UT_MEMORY_CHECK
#endif//Q_OS_SYMBIAN
    {
        HsMenuViewBuilder builder;
        HsMenuModeWrapper menuMode;
        HsMainWindowMock mainWindow;
        QStateMachine *machine = new QStateMachine(0);

        const QString collectionName("testCollection" +
                                     QDateTime::currentDateTime().
                                     toString("ddmmyyyy_hh_mm_ss_zzz"));
        const int collectionId = HsMenuService::createCollection(collectionName);

        HsCollectionState *collectionState =
            new HsCollectionState(builder, menuMode, mainWindow, machine);

        collectionState->mCollectionId = collectionId;

        machine->setInitialState(collectionState);

        AddToHomeScreenMockState *mockState = new AddToHomeScreenMockState(machine);

        // create a transition to the new child state which will be triggered by
        // an event with specified operation type
        HsMenuEventTransition *transition = new HsMenuEventTransition(
            HsMenuEvent::ArrangeCollection, collectionState, mockState);
        collectionState->addTransition(transition);

        machine->start();
        qApp->sendPostedEvents();
        collectionState->createArrangeCollection();
        qApp->sendPostedEvents();

        QVERIFY(mockState->enteredValue());
        qApp->removePostedEvents(0);
        machine->stop();

        delete machine;
    }
#ifdef Q_OS_SYMBIAN
#ifdef UT_MEMORY_CHECK
    __UHEAP_MARKEND;
#endif//UT_MEMORY_CHECK
#endif//Q_OS_SYMBIAN
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:55,代码来源:t_collectionsstate.cpp


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