Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

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

    Chinese
    1
    1
    1468
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      tcsjzdnlh last edited by

      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 ); )

      1 Reply Last reply Reply Quote 0
      • First post
        Last post