QT状态机框架 中的 QHistoryState的问题



  • QT状态机框架 中的 QHistoryState的问题

    //------------------------------------------------------------------------------------------
    @ QHistoryState *s1h = new QHistoryState(s1);

    QState *s3 = new QState();
    s3->assignProperty(label, "text", "In s3");
    QMessageBox *mbox = new QMessageBox(mainWindow);
    mbox->addButton(QMessageBox::Ok);
    mbox->setText("Interrupted!");
    mbox->setIcon(QMessageBox::Information);
    QObject::connect(s3, SIGNAL(entered()), mbox, SLOT(exec()));
    s3->addTransition(s1h);
    machine.addState(s3);
    
    s1->addTransition(interruptButton, SIGNAL(clicked()), s3);@
    

    //----------------------------------------------------------------------------------------

    --
    这是库文档里面给出的 关于 QHistoryState的例子片段,
    我想问一下 这一句 s3->addTransition(s1h); ,
    s3迁移 到 s1h的 触发条件是什么?
    (就想这样的:s3->addTransition( button, SIGNAL(clicked()), s1h ); )


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.