QStateMachine* machine = new QStateMachine(this);
QState* s1 = new QState(machine);
QMouseEventTransition* mouseTrans =
new QMouseEventTransition(ui->label, QEvent::MouseButtonRelease,
Qt::LeftButton, s1);
QObject::connect(mouseTrans, SIGNAL(triggered()), msgBox, SLOT(show()));
machine->setInitialState(s1);
machine->start();