好吧,我正在开发一个Qt应用程序,我想使用Qt State Framework来制作一些动画.
第一: 如何使用状态转换将水平布局中包含的一组按钮设置为另一个垂直布局?
第二: 如何在状态下显示小部件?例如菜单:当用户单击菜单中的按钮时,显示小部件(之前已使用widget-> hide()隐藏)... ???
这是一个代码示例:
boxInsert = new BoxInsert(this);
boxInsert->hide ();
btn1 = new QPushButton("Introducir", this);
btn2 = new QPushButton("Informe", this);
btn3 = new QPushButton("Salir", this);
QStateMachine *machine = new QStateMachine(this);
QState *st1 = new QState(machine);
st1->setObjectName ("menuMode");
st1->assignProperty (btn1, "pos", QPointF(center - btn1->width () / 2, 20));
st1->assignProperty (btn2, "pos", QPointF(center - btn1->width () / 2, 40));
st1->assignProperty (btn3, "pos", QPointF(center - btn1->width () / 2, 60));
st1->assignProperty (boxInsert, "visible", QVariant(false));
QState *st2 = …Run Code Online (Sandbox Code Playgroud)