Skip to content

Commit

Permalink
gui/src/mapstackedwidget: adjust stacked widget size based on current…
Browse files Browse the repository at this point in the history
… page.

Signed-off-by: AlexandraTrifan <[email protected]>
  • Loading branch information
AlexandraTrifan authored and adisuciu committed Sep 6, 2024
1 parent ac0adee commit 0651300
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gui/src/mapstackedwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 0651300

Please sign in to comment.