diff --git a/src/ui/form/home/pages/homemainpage.cpp b/src/ui/form/home/pages/homemainpage.cpp index 8900b4a5..449cb30e 100644 --- a/src/ui/form/home/pages/homemainpage.cpp +++ b/src/ui/form/home/pages/homemainpage.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include @@ -39,7 +39,7 @@ void HomeMainPage::setupUi() setupStackedLayout(); layout->addLayout(sideBar); - layout->addLayout(m_stackedLayout, 1); + layout->addWidget(m_stackedPages, 1); this->setLayout(layout); } @@ -74,18 +74,18 @@ void HomeMainPage::setupSideBarButtons() void HomeMainPage::setupStackedLayout() { - m_stackedLayout = new QStackedLayout(); + m_stackedPages = new QStackedWidget(); - m_stackedLayout->addWidget(new HomePage(ctrl())); - m_stackedLayout->addWidget(new AboutPage(ctrl())); + m_stackedPages->addWidget(new HomePage(ctrl())); + m_stackedPages->addWidget(new AboutPage(ctrl())); } void HomeMainPage::setCurrentTab(TabIndex tabIndex) { - if (m_stackedLayout->currentIndex() == tabIndex) + if (m_stackedPages->currentIndex() == tabIndex) return; - m_stackedLayout->setCurrentIndex(tabIndex); + m_stackedPages->setCurrentIndex(tabIndex); buttonAt(tabIndex)->animateClick(); } diff --git a/src/ui/form/home/pages/homemainpage.h b/src/ui/form/home/pages/homemainpage.h index 2c79cb67..ffc271c6 100644 --- a/src/ui/form/home/pages/homemainpage.h +++ b/src/ui/form/home/pages/homemainpage.h @@ -3,7 +3,7 @@ #include "homebasepage.h" -QT_FORWARD_DECLARE_CLASS(QStackedLayout) +QT_FORWARD_DECLARE_CLASS(QStackedWidget) class HomeMainPage : public HomeBasePage { @@ -30,7 +30,7 @@ private: private: QVector m_buttons; - QStackedLayout *m_stackedLayout = nullptr; + QStackedWidget *m_stackedPages = nullptr; }; #endif // HOMEMAINPAGE_H