开发者

Qt animation - member doesn't exist

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜