QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
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 "qgis_gui.h"
20#include "qgis_sip.h"
22
23#include <QComboBox>
24
26
33class GUI_EXPORT QgsLayoutComboBox : public QComboBox
34{
35 Q_OBJECT
36
37 public:
38
43 explicit QgsLayoutComboBox( QWidget *parent SIP_TRANSFERTHIS = nullptr, QgsLayoutManager *manager = nullptr );
44
48 void setLayoutManager( QgsLayoutManager *manager );
49
56
63
68 void setAllowEmptyLayout( bool allowEmpty );
69
74 bool allowEmptyLayout() const;
75
80
84 QgsMasterLayoutInterface *layout( int index ) const;
85
86 public slots:
87
92
93 signals:
94
97
98 private slots:
99 void indexChanged( int i );
100 void rowsChanged();
101
102 private:
103 QgsLayoutManagerModel *mModel = nullptr;
104 QgsLayoutManagerProxyModel *mProxyModel = nullptr;
105};
106
107#endif // QGSLAYOUTCOMBOBOX_H
bool allowEmptyLayout() const
Returns true if the combobox includes the empty layout ("not set") choice.
void setLayoutManager(QgsLayoutManager *manager)
Sets the layout manager containing the layouts to list in the combo box.
void layoutChanged(QgsMasterLayoutInterface *layout)
Emitted whenever the currently selected layout changes.
QgsMasterLayoutInterface * currentLayout() const
Returns the layout currently selected in the combo box.
QgsLayoutComboBox(QWidget *parent=nullptr, QgsLayoutManager *manager=nullptr)
QgsLayoutComboBox creates a combo box to display a list of items in a layout manager.
void setCurrentLayout(QgsMasterLayoutInterface *layout)
Sets the currently selected layout in the combo box.
void setAllowEmptyLayout(bool allowEmpty)
Sets whether an optional empty layout ("not set") option is present in the combobox.
QgsLayoutManagerProxyModel::Filters filters() const
Returns the current filters used for filtering available layouts.
void setFilters(QgsLayoutManagerProxyModel::Filters filters)
Sets the current filters used for filtering available layouts.
QgsMasterLayoutInterface * layout(int index) const
Returns the layout at the specified index.
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