QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
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#include "moc_qgsstackedwidget.cpp"
18
19#include <QStackedWidget>
20#include <QSize>
21
22
24 : QStackedWidget( parent )
25 , mSizeMode( SizeMode::ConsiderAllPages ) //#spellok
26{
27}
28
30{
31 switch ( mSizeMode )
32 {
33 case SizeMode::ConsiderAllPages: //#spellok
34 return QStackedWidget::sizeHint();
36 return currentWidget() ? currentWidget()->sizeHint() : QSize();
37 }
38 return QSize();
39}
40
42{
43 switch ( mSizeMode )
44 {
45 case SizeMode::ConsiderAllPages: //#spellok
46 return QStackedWidget::sizeHint();
48 return currentWidget() ? currentWidget()->minimumSizeHint() : QSize();
49 }
50 return QSize();
51}
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