How to use of animation in Qt for stacked widgets?

i am using stacked widget and i want to have the following effect : when i press a pushbutton , the button should move to the center and gradually fade out at the same time. while the button is fading the next page of the stacked widget should gradually fade in or any kind of animation would do. tried many thing but i got unsatisfactory results. the animation should work work on windows and linux.

Answers


I don't think that you can get fading effects directly from QStackedWidget.

However, you can easily achieve the effect you need by using QPropertyAnimation and QStateMachine. You can find how to do it in Animation/States example (should be in /qt/examples/animation/states/ subdirectory of your Qt installation).


Need Your Help

Mocking Hibernate's SessionFactory using EasyMock

java hibernate unit-testing junit easymock

I am trying to write a unit test for the following class:

why is my circle filled Black even though i haven't set it to be filled

javafx colors pane hbox borderpane

I am currently working on an assignment where i must print a circle in the center of the primary stage and 4 buttons on the bottom center area of the primary stage which move the circle, up, down, ...