QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
layout
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 "qgis_gui.h"
20
#include "
qgis_sip.h
"
21
#include "
qgslayoutitem.h
"
22
#include "
qgslayoutitemregistry.h
"
23
#include "
qgslayoutmodel.h
"
24
25
#include <QComboBox>
26
32
class
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
140
void
itemChanged
(
QgsLayoutItem
*
item
);
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
QgsLayoutItemComboBox::item
QgsLayoutItem * item(int index) const
Returns the item currently shown at the specified index within the combo box.
Definition
qgslayoutitemcombobox.cpp:137
QgsLayoutItemComboBox::setCurrentLayout
void setCurrentLayout(QgsLayout *layout)
Sets the layout containing the items to list in the combo box.
Definition
qgslayoutitemcombobox.cpp:35
QgsLayoutItemComboBox::currentLayout
QgsLayout * currentLayout()
Returns the current layout containing the items shown in the combo box.
Definition
qgslayoutitemcombobox.cpp:50
QgsLayoutItemComboBox::setExceptedItemList
void setExceptedItemList(const QList< QgsLayoutItem * > &exceptList)
Sets a list of specific items to exclude from the combo box.
Definition
qgslayoutitemcombobox.cpp:107
QgsLayoutItemComboBox::currentItem
QgsLayoutItem * currentItem() const
Returns the item currently selected in the combo box.
Definition
qgslayoutitemcombobox.cpp:73
QgsLayoutItemComboBox::itemType
QgsLayoutItemRegistry::ItemType itemType() const
Returns the filter for the item types to show in the combo box.
Definition
qgslayoutitemcombobox.cpp:102
QgsLayoutItemComboBox::setItemType
void setItemType(QgsLayoutItemRegistry::ItemType itemType)
Sets a filter for the item type to show in the combo box.
Definition
qgslayoutitemcombobox.cpp:97
QgsLayoutItemComboBox::QgsLayoutItemComboBox
QgsLayoutItemComboBox(QWidget *parent=nullptr, QgsLayout *layout=nullptr)
QgsLayoutItemComboBox creates a combo box to display a list of items in a layout.
Definition
qgslayoutitemcombobox.cpp:26
QgsLayoutItemComboBox::setAllowEmptyItem
void setAllowEmptyItem(bool allowEmpty)
Sets whether an optional empty layout item is present in the combobox.
Definition
qgslayoutitemcombobox.cpp:117
QgsLayoutItemComboBox::setItem
void setItem(const QgsLayoutItem *item)
Sets the currently selected item in the combo box.
Definition
qgslayoutitemcombobox.cpp:55
QgsLayoutItemComboBox::itemFlags
QgsLayoutItem::Flags itemFlags() const
Returns the layout item flags used for filtering the available items.
Definition
qgslayoutitemcombobox.cpp:132
QgsLayoutItemComboBox::allowEmptyItem
bool allowEmptyItem() const
Returns true if the model includes the empty item choice.
Definition
qgslayoutitemcombobox.cpp:122
QgsLayoutItemComboBox::setItemFlags
void setItemFlags(QgsLayoutItem::Flags flags)
Sets layout item flags to use for filtering the available items.
Definition
qgslayoutitemcombobox.cpp:127
QgsLayoutItemComboBox::exceptedItemList
QList< QgsLayoutItem * > exceptedItemList() const
Returns the list of specific items excluded from the combo box.
Definition
qgslayoutitemcombobox.cpp:112
QgsLayoutItemComboBox::itemChanged
void itemChanged(QgsLayoutItem *item)
Emitted whenever the currently selected item changes.
QgsLayoutItemRegistry::ItemType
ItemType
Item types.
Definition
qgslayoutitemregistry.h:323
QgsLayoutItem
Base class for graphical items within a QgsLayout.
Definition
qgslayoutitem.h:106
QgsLayoutItem::Flags
QFlags< Flag > Flags
Definition
qgslayoutitem.h:340
QgsLayout
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Definition
qgslayout.h:51
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
qgslayoutitem.h
qgslayoutitemregistry.h
qgslayoutmodel.h
Generated on
for QGIS API Documentation by
1.17.0