View Single Post
Posts: 239 | Thanked: 194 times | Joined on Jul 2010 @ Amsterdam
#25
Originally Posted by Berserk View Post
Nice program! very easy to use
I'll look into the code for that transition effect, I wonder how you did that
I've a MainForm class in which a QStackedWidget resides. I've put both Edit list view and List view into that stacked widget.
Whenever the Edit List button in the List view is clicked or the Save/Cancel button in the Edit view is clicked the state of the view is changed by a QStateMachine.

Because both views have the same transition effects I've created a base class for both views called SlideWidget. This class hold the QStates, QPropertyAnimations and QStateMachine and functions to switch states and a signal to indicate which state has finished animating.

Code:
signalTransitionInFinished()
signalTransitionOutFinished()
The transition out (widget slides up) change calls are started in the MainForm bit in the changeWidget function.
When the transition is done the slot stateOutFinished is called. This function starts the transition in (widget slides down).
__________________
Please give or donate your 2 cents to help me keep on going.