QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
#include <qgscheckablecombobox.h>
Public Slots | |
void | setCheckedItems (const QStringList &items) |
Set items which should be checked/selected. More... | |
Signals | |
void | checkedItemsChanged (const QStringList &items) |
Emitted whenever the checked items list changed. More... | |
Public Member Functions | |
QgsCheckableComboBox (QWidget *parent=nullptr) | |
Constructor for QgsCheckableComboBox. More... | |
QStringList | checkedItems () const |
Returns currently checked items. More... | |
QVariantList | checkedItemsData () const |
Returns userData (stored in the Qt::UserRole) associated with currently checked items. More... | |
QString | defaultText () const |
Returns default text which will be displayed in the widget when no items selected. More... | |
bool | eventFilter (QObject *object, QEvent *event) override |
Filters events to enable context menu. More... | |
void | hidePopup () override |
Hides the list of items in the combobox if it is currently visible and resets the internal state. More... | |
Qt::CheckState | itemCheckState (int index) const |
Returns the checked state of the item identified by index. More... | |
QString | separator () const |
Returns separator used to separate items in the display text. More... | |
void | setDefaultText (const QString &text) |
Set default text which will be displayed in the widget when no items selected. More... | |
void | setItemCheckState (int index, Qt::CheckState state) |
Sets the item check state to state. More... | |
void | setSeparator (const QString &separator) |
Set separator used to separate items in the display text. More... | |
void | toggleItemCheckState (int index) |
Toggles the item check state. More... | |
Protected Slots | |
void | deselectAllOptions () |
Removes selection from all items. More... | |
void | selectAllOptions () |
Selects all items. More... | |
void | showContextMenu (QPoint pos) |
Display context menu which allows selecting/deselecting all items at once. More... | |
Protected Member Functions | |
void | resizeEvent (QResizeEvent *event) override |
Handler for widget resizing. More... | |
Properties | |
QStringList | checkedItems |
QString | defaultText |
QString | separator |
QComboBox subclass which allows selecting multiple items.
Definition at line 123 of file qgscheckablecombobox.h.
QgsCheckableComboBox::QgsCheckableComboBox | ( | QWidget * | parent = nullptr | ) |
Constructor for QgsCheckableComboBox.
Definition at line 77 of file qgscheckablecombobox.cpp.
QStringList QgsCheckableComboBox::checkedItems | ( | ) | const |
Returns currently checked items.
|
signal |
Emitted whenever the checked items list changed.
QVariantList QgsCheckableComboBox::checkedItemsData | ( | ) | const |
Returns userData (stored in the Qt::UserRole) associated with currently checked items.
Definition at line 155 of file qgscheckablecombobox.cpp.
QString QgsCheckableComboBox::defaultText | ( | ) | const |
Returns default text which will be displayed in the widget when no items selected.
|
protectedslot |
Removes selection from all items.
Definition at line 220 of file qgscheckablecombobox.cpp.
|
override |
Filters events to enable context menu.
Definition at line 231 of file qgscheckablecombobox.cpp.
|
override |
Hides the list of items in the combobox if it is currently visible and resets the internal state.
Definition at line 193 of file qgscheckablecombobox.cpp.
Qt::CheckState QgsCheckableComboBox::itemCheckState | ( | int | index | ) | const |
Returns the checked state of the item identified by index.
index | item index |
Definition at line 173 of file qgscheckablecombobox.cpp.
|
overrideprotected |
Handler for widget resizing.
Definition at line 278 of file qgscheckablecombobox.cpp.
|
protectedslot |
Selects all items.
Definition at line 209 of file qgscheckablecombobox.cpp.
QString QgsCheckableComboBox::separator | ( | ) | const |
Returns separator used to separate items in the display text.
|
slot |
Set items which should be checked/selected.
items | items to select |
Definition at line 267 of file qgscheckablecombobox.cpp.
void QgsCheckableComboBox::setDefaultText | ( | const QString & | text | ) |
Set default text which will be displayed in the widget when no items selected.
text | default text |
Definition at line 128 of file qgscheckablecombobox.cpp.
void QgsCheckableComboBox::setItemCheckState | ( | int | index, |
Qt::CheckState | state | ||
) |
Sets the item check state to state.
index | item index |
state | check state |
Definition at line 178 of file qgscheckablecombobox.cpp.
void QgsCheckableComboBox::setSeparator | ( | const QString & | separator | ) |
Set separator used to separate items in the display text.
separator | separator to use |
Definition at line 114 of file qgscheckablecombobox.cpp.
|
protectedslot |
Display context menu which allows selecting/deselecting all items at once.
Definition at line 202 of file qgscheckablecombobox.cpp.
void QgsCheckableComboBox::toggleItemCheckState | ( | int | index | ) |
Toggles the item check state.
index | item index |
Definition at line 183 of file qgscheckablecombobox.cpp.
|
readwrite |
Definition at line 129 of file qgscheckablecombobox.h.
|
readwrite |
Definition at line 128 of file qgscheckablecombobox.h.
|
readwrite |
Definition at line 127 of file qgscheckablecombobox.h.