QGIS API Documentation  3.6.0-Noosa (5873452)
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"
22 #include "qgslayoutitemregistry.h"
23 #include "qgis_gui.h"
24 #include "qgslayoutmodel.h"
25 
33 class 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 
50  void setCurrentLayout( QgsLayout *layout );
51 
58  void setItemType( QgsLayoutItemRegistry::ItemType itemType );
59 
64  QgsLayoutItemRegistry::ItemType itemType() const;
65 
70  void setExceptedItemList( const QList< QgsLayoutItem * > &exceptList );
71 
76  QList< QgsLayoutItem * > exceptedItemList() const;
77 
82  QgsLayoutItem *item( int index ) const;
83 
87  QgsLayoutItem *currentItem() const;
88 
89  public slots:
90 
94  void setItem( const QgsLayoutItem *item );
95 
96  signals:
97 
99  void itemChanged( QgsLayoutItem *item );
100 
101  private slots:
102  void indexChanged( int i );
103  void rowsChanged();
104 
105  private:
106  std::unique_ptr< QgsLayoutProxyModel > mProxyModel;
107 
108 };
109 
110 #endif // QGSLAYOUTITEMCOMBOBOX_H
Base class for graphical items within a QgsLayout.
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:46
The QgsLayoutItemComboBox class is a combo box which displays items of a matching type from a layout...
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Definition: qgslayout.h:49