| 3 | #include <QPropertyAnimation> |
| 4 | |
| 5 | SlidingStackedWidget::SlidingStackedWidget(QWidget *parent) |
| 6 | |
| 7 | : QStackedWidget(parent) |
| 8 | { |
| 9 | if (parent != nullptr) |
| 10 | { |
| 11 | m_mainwindow = parent; |
| 12 | } |
| 13 | else |
| 14 | { |
| 15 | m_mainwindow = this; |
| 16 | } |
| 17 | |
| 18 | // parent should not be 0; at least not tested for any other case yet !! |
| 19 | // Now, initialize some private variables with default values |
| 20 | m_vertical = false; |
| 21 | // setVerticalMode(true); |
| 22 | m_speed = 500; |
| 23 | m_animationtype = QEasingCurve::OutBack; // check out the QEasingCurve documentation for different styles |
| 24 | m_now = 0; |
| 25 | m_next = 0; |
| 26 | m_wrap = false; |
| 27 | m_pnow = QPoint(0, 0); |
| 28 | m_active = false; |
| 29 | } |
| 30 | |
| 31 | void SlidingStackedWidget::setVerticalMode(bool vertical) |
| 32 | { |