QGIS API Documentation 4.1.0-Master (5bf3c20f3c9)
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
18#include <QSize>
19#include <QStackedWidget>
20
21#include "moc_qgsstackedwidget.cpp"
22
24 : QStackedWidget( parent )
25{}
26
28{
29 switch ( mSizeMode )
30 {
31 case SizeMode::ConsiderAllPages: //#spellok
32 return QStackedWidget::sizeHint();
34 return currentWidget() ? currentWidget()->sizeHint() : QSize();
35 }
36 return QSize();
37}
38
40{
41 switch ( mSizeMode )
42 {
43 case SizeMode::ConsiderAllPages: //#spellok
44 return QStackedWidget::sizeHint();
46 return currentWidget() ? currentWidget()->minimumSizeHint() : QSize();
47 }
48 return QSize();
49}
QgsStackedWidget(QWidget *parent=nullptr)
Constructor for QgsStackedWidget.
QSize minimumSizeHint() const override
@ 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