QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
qgslayoutcombobox.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslayoutcombobox.h
3 --------------------------------------
4 Date : March 2019
5 Copyright : (C) 2019 Nyall Dawson
6 Email : nyall dot dawson 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#ifndef QGSLAYOUTCOMBOBOX_H
17#define QGSLAYOUTCOMBOBOX_H
18
19#include <QComboBox>
20#include "qgis_sip.h"
21#include "qgis_gui.h"
22#include "qgslayoutmanager.h"
23
30class GUI_EXPORT QgsLayoutComboBox : public QComboBox
31{
32 Q_OBJECT
33
34 public:
35
40 explicit QgsLayoutComboBox( QWidget *parent SIP_TRANSFERTHIS = nullptr, QgsLayoutManager *manager = nullptr );
41
45 void setLayoutManager( QgsLayoutManager *manager );
46
52 QgsLayoutManagerProxyModel::Filters filters() const;
53
59 void setFilters( QgsLayoutManagerProxyModel::Filters filters );
60
65 void setAllowEmptyLayout( bool allowEmpty );
66
71 bool allowEmptyLayout() const;
72
76 QgsMasterLayoutInterface *currentLayout() const;
77
81 QgsMasterLayoutInterface *layout( int index ) const;
82
83 public slots:
84
88 void setCurrentLayout( QgsMasterLayoutInterface *layout );
89
90 signals:
91
94
95 private slots:
96 void indexChanged( int i );
97 void rowsChanged();
98
99 private:
100 QgsLayoutManagerModel *mModel = nullptr;
101 QgsLayoutManagerProxyModel *mProxyModel = nullptr;
102
103};
104
105#endif // QGSLAYOUTCOMBOBOX_H
The QgsLayoutComboBox class is a combo box which displays available layouts from a QgsLayoutManager.
void layoutChanged(QgsMasterLayoutInterface *layout)
Emitted whenever the currently selected layout changes.
List model representing the print layouts and reports available in a layout manager.
QSortFilterProxyModel subclass for QgsLayoutManagerModel.
Manages storage of a set of layouts.
Interface for master layout type objects, such as print layouts and reports.
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53