- Notifications
You must be signed in to change notification settings - Fork0
Animated Main Window Layout
License
NotificationsYou must be signed in to change notification settings
huseyinkozan/QAnimatedMainWindowLayout
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Create
QAnimatedMainWindowLayout * amwl = new QAnimatedMainWindowLayout;
Add widgets
amwl->addLeftWidget(leftGroupBox);amwl->addRightWidget(rightGroupBox);amwl->addTopWidget(topGroupBox);amwl->addBottomWidget(bottomGroupBox);amwl->addCenterWidget(centerGroupBox);
Do fine tunes
amwl->setEasingCurve(QEasingCurve::OutBack);amwl->setAnimationDuration(500);
Initialize stretch values
// disable animation for initializationamwl->setAnimationEnabled(false);amwl->setLeftPercentage(leftDoubleSpinBox->value());amwl->setRightPercentage(rightDoubleSpinBox->value());amwl->setTopPercentage(topDoubleSpinBox->value());amwl->setBottomPercentage(bottomDoubleSpinBox->value());amwl->setCenterPercentage(centerDoubleSpinBox->value());amwl->setAnimationEnabled(true);
Set some of the widgets layout
frame->setLayout(amwl);
Now, on every change on stretch property will done with an animation.