本文整理汇总了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;
}
示例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
}