QGIS API Documentation 3.37.0-Master (08041ddf763)
Loading...
Searching...
No Matches
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
33class GUI_EXPORT QgsLayoutItemComboBox : public QComboBox
34{
35 Q_OBJECT
36
37 public:
38
45 explicit QgsLayoutItemComboBox( QWidget *parent SIP_TRANSFERTHIS = nullptr, QgsLayout *layout = nullptr );
46
52 void setCurrentLayout( QgsLayout *layout );
53
59 QgsLayout *currentLayout();
60
67 void setItemType( QgsLayoutItemRegistry::ItemType itemType );
68
73 QgsLayoutItemRegistry::ItemType itemType() const;
74
79 void setExceptedItemList( const QList< QgsLayoutItem * > &exceptList );
80
85 QList< QgsLayoutItem * > exceptedItemList() const;
86
92 void setAllowEmptyItem( bool allowEmpty );
93
99 bool allowEmptyItem() const;
100
109 void setItemFlags( QgsLayoutItem::Flags flags );
110
119 QgsLayoutItem::Flags itemFlags() const;
120
125 QgsLayoutItem *item( int index ) const;
126
130 QgsLayoutItem *currentItem() const;
131
132 public slots:
133
137 void setItem( const QgsLayoutItem *item );
138
139 signals:
140
143
144 private slots:
145 void indexChanged( int i );
146 void rowsChanged();
147
148 private:
149 std::unique_ptr< QgsLayoutProxyModel > mProxyModel;
150
151};
152
153#endif // QGSLAYOUTITEMCOMBOBOX_H
The QgsLayoutItemComboBox class is 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