小编Lui*_*ega的帖子

布局中的Qt状态机转换

好吧,我正在开发一个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)

c++ qt qstatemachine

10
推荐指数
1
解决办法
1439
查看次数

标签 统计

c++ ×1

qstatemachine ×1

qt ×1