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);
精彩评论