QGIS API Documentation 3.43.0-Master (32433f7016e)
qgslayoutitemcombobox.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslayoutitemcombobox.h
3 --------------------------------------
4 Date : October 2017
5 Copyright : (C) 2017 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 QGSLAYOUTITEMCOMBOBOX_H
17#define QGSLAYOUTITEMCOMBOBOX_H
18
19#include <QComboBox>
20#include "qgis_sip.h"
21#include "qgslayoutitem.h"
23#include "qgis_gui.h"
24#include "qgslayoutmodel.h"
25
26
32class GUI_EXPORT QgsLayoutItemComboBox : public QComboBox
33{
34 Q_OBJECT
35
36 public:
43 explicit QgsLayoutItemComboBox( QWidget *parent SIP_TRANSFERTHIS = nullptr, QgsLayout *layout = nullptr );
44
50 void setCurrentLayout( QgsLayout *layout );
51
57 QgsLayout *currentLayout();
58
65 void setItemType( QgsLayoutItemRegistry::ItemType itemType );
66
71 QgsLayoutItemRegistry::ItemType itemType() const;
72
77 void setExceptedItemList( const QList<QgsLayoutItem *> &exceptList );
78
83 QList<QgsLayoutItem *> exceptedItemList() const;
84
90 void setAllowEmptyItem( bool allowEmpty );
91
97 bool allowEmptyItem() const;
98
107 void setItemFlags( QgsLayoutItem::Flags flags );
108
117 QgsLayoutItem::Flags itemFlags() const;
118
123 QgsLayoutItem *item( int index ) const;
124
128 QgsLayoutItem *currentItem() const;
129
130 public slots:
131
135 void setItem( const QgsLayoutItem *item );
136
137 signals:
138
141
142 private slots:
143 void indexChanged( int i );
144 void rowsChanged();
145
146 private:
147 std::unique_ptr<QgsLayoutProxyModel> mProxyModel;
148};
149
150#endif // QGSLAYOUTITEMCOMBOBOX_H
A combo box which displays items of a matching type from a layout.
void itemChanged(QgsLayoutItem *item)
Emitted whenever the currently selected item changes.
Base class for graphical items within a QgsLayout.
QFlags< Flag > Flags
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Definition qgslayout.h:49
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53