QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
qgsstackedwidget.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsstackedwidget.cpp
3 --------------------
4 begin : January 2024
5 copyright : (C) 2024 by Stefanos Natsis
6 email : uclaros at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#include "qgsstackedwidget.h"
17
18#include <QStackedWidget>
19#include <QSize>
20
21
23 : QStackedWidget( parent )
24 , mSizeMode( SizeMode::ConsiderAllPages ) //#spellok
25{
26}
27
29{
30 switch ( mSizeMode )
31 {
32 case SizeMode::ConsiderAllPages: //#spellok
33 return QStackedWidget::sizeHint();
35 return currentWidget() ? currentWidget()->sizeHint() : QSize();
36 }
37 return QSize();
38}
39
41{
42 switch ( mSizeMode )
43 {
44 case SizeMode::ConsiderAllPages: //#spellok
45 return QStackedWidget::sizeHint();
47 return currentWidget() ? currentWidget()->minimumSizeHint() : QSize();
48 }
49 return QSize();
50}
QgsStackedWidget(QWidget *parent=nullptr)
Constructor for QgsStackedWidget.
QSize minimumSizeHint() const override
SizeMode
Possible modes for calculating a QgsStackedWidget's size.
@ ConsiderAllPages
The sizes of all pages are considered when calculating the stacked widget size.
@ CurrentPageOnly
Only the size of the current page is considered when calculating the stacked widget size.
QSize sizeHint() const override