diff --git a/src/gui/EditWidget.cpp b/src/gui/EditWidget.cpp index f7030c9d7..cfae5d7e6 100644 --- a/src/gui/EditWidget.cpp +++ b/src/gui/EditWidget.cpp @@ -70,7 +70,16 @@ void EditWidget::addPage(const QString& labelText, const QIcon& icon, QWidget* w void EditWidget::setPageHidden(QWidget* widget, bool hidden) { - int index = m_ui->stackedWidget->indexOf(widget); + int index = -1; + + for (int i = 0; i < m_ui->stackedWidget->count(); i++) { + auto* scrollArea = qobject_cast(m_ui->stackedWidget->widget(i)); + if (scrollArea != nullptr && scrollArea->widget() == widget) { + index = i; + break; + } + } + if (index != -1) { m_ui->categoryList->setCategoryHidden(index, hidden); }