From 7c44e7a82e79f1fdb85a9d5dbedb24f84467c525 Mon Sep 17 00:00:00 2001 From: AlexandraTrifan Date: Fri, 5 Jul 2024 17:15:38 +0300 Subject: [PATCH] gui/src/mapstackedwidget: adjust stacked widget size based on current page. Signed-off-by: AlexandraTrifan --- gui/src/mapstackedwidget.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gui/src/mapstackedwidget.cpp b/gui/src/mapstackedwidget.cpp index d6340fc273..a8197021e0 100644 --- a/gui/src/mapstackedwidget.cpp +++ b/gui/src/mapstackedwidget.cpp @@ -22,6 +22,7 @@ QString MapStackedWidget::getKey(QWidget *w) void MapStackedWidget::add(QString key, QWidget *w) { map[key] = w; + w->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); addWidget(w); qDebug(CAT_MAPSTACKWIDGET) << key << "added to stack"; } @@ -55,7 +56,9 @@ bool MapStackedWidget::show(QString key) QWidget *w = map[key]; if(w) { if(indexOf(map[key]) != -1) { + this->currentWidget()->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); setCurrentWidget(w); + w->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); qDebug(CAT_MAPSTACKWIDGET) << key << " found - showing"; return true; } else {