QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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:
42 explicit QgsLayoutComboBox( QWidget *parent SIP_TRANSFERTHIS = nullptr, QgsLayoutManager *manager = nullptr );
43
47 void setLayoutManager( QgsLayoutManager *manager );
48
55
62
67 void setAllowEmptyLayout( bool allowEmpty );
68
73 bool allowEmptyLayout() const;
74
79
83 QgsMasterLayoutInterface *layout( int index ) const;
84
85 public slots:
86
91
92 signals:
93
96
97 private slots:
98 void indexChanged( int i );
99 void rowsChanged();
100
101 private:
102 QgsLayoutManagerModel *mModel = nullptr;
103 QgsLayoutManagerProxyModel *mProxyModel = nullptr;
104};
105
106#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