开发者

Qt animation - member doesn't exist

开发者 https://www.devze.com 2023-03-27 17:31 出处:网络
This code: QStateMachine *machine = new QStateMachine; QState *state1 = new QState(machine->rootState());

This code:

 QStateMachine *machine = new QStateMachine;

     QState *state1 = new QState(machine->rootState());

I'm 开发者_JAVA百科getting an error:

C:\Users..\Animated_Button\main.cpp:13: error: 'class QStateMachine' has no member named 'rootState'


Indeed, according to the documentation, QStateMachine has no method named rootState. According to this, it was removed at one point. The article states this:

QStateMachine::rootState() is gone; the state machine now is the root state.

So the code you have comes from an outdated source. You should try doing this:

 QStateMachine *machine = new QStateMachine;

 QState *state1 = new QState(machine);
0

精彩评论

暂无评论...
验证码 换一张
取 消