QGIS API Documentation 3.41.0-Master (d5b93354e9c)
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | List of all members
QgsLayoutItemComboBox Class Reference

The QgsLayoutItemComboBox class is a combo box which displays items of a matching type from a layout. More...

#include <qgslayoutitemcombobox.h>

Inheritance diagram for QgsLayoutItemComboBox:
Inheritance graph
[legend]

Public Slots

void setItem (const QgsLayoutItem *item)
 Sets the currently selected item in the combo box.
 

Signals

void itemChanged (QgsLayoutItem *item)
 Emitted whenever the currently selected item changes.
 

Public Member Functions

 QgsLayoutItemComboBox (QWidget *parent=nullptr, QgsLayout *layout=nullptr)
 QgsLayoutItemComboBox creates a combo box to display a list of items in a layout.
 
bool allowEmptyItem () const
 Returns true if the model includes the empty item choice.
 
QgsLayoutItemcurrentItem () const
 Returns the item currently selected in the combo box.
 
QgsLayoutcurrentLayout ()
 Returns the current layout containing the items shown in the combo box.
 
QList< QgsLayoutItem * > exceptedItemList () const
 Returns the list of specific items excluded from the combo box.
 
QgsLayoutItemitem (int index) const
 Returns the item currently shown at the specified index within the combo box.
 
QgsLayoutItem::Flags itemFlags () const
 Returns the layout item flags used for filtering the available items.
 
QgsLayoutItemRegistry::ItemType itemType () const
 Returns the filter for the item types to show in the combo box.
 
void setAllowEmptyItem (bool allowEmpty)
 Sets whether an optional empty layout item is present in the combobox.
 
void setCurrentLayout (QgsLayout *layout)
 Sets the layout containing the items to list in the combo box.
 
void setExceptedItemList (const QList< QgsLayoutItem * > &exceptList)
 Sets a list of specific items to exclude from the combo box.
 
void setItemFlags (QgsLayoutItem::Flags flags)
 Sets layout item flags to use for filtering the available items.
 
void setItemType (QgsLayoutItemRegistry::ItemType itemType)
 Sets a filter for the item type to show in the combo box.
 

Detailed Description

The QgsLayoutItemComboBox class is a combo box which displays items of a matching type from a layout.

Definition at line 33 of file qgslayoutitemcombobox.h.

Constructor & Destructor Documentation

◆ QgsLayoutItemComboBox()

QgsLayoutItemComboBox::QgsLayoutItemComboBox ( QWidget *  parent = nullptr,
QgsLayout layout = nullptr 
)
explicit

QgsLayoutItemComboBox creates a combo box to display a list of items in a layout.

The items can optionally be filtered by type. If layout is not set, no items will be shown until setCurrentLayout() is called

Definition at line 24 of file qgslayoutitemcombobox.cpp.

Member Function Documentation

◆ allowEmptyItem()

bool QgsLayoutItemComboBox::allowEmptyItem ( ) const

Returns true if the model includes the empty item choice.

See also
setAllowEmptyItem()
Since
QGIS 3.8

Definition at line 120 of file qgslayoutitemcombobox.cpp.

◆ currentItem()

QgsLayoutItem * QgsLayoutItemComboBox::currentItem ( ) const

Returns the item currently selected in the combo box.

Definition at line 71 of file qgslayoutitemcombobox.cpp.

◆ currentLayout()

QgsLayout * QgsLayoutItemComboBox::currentLayout ( )

Returns the current layout containing the items shown in the combo box.

See also
setCurrentLayout()

Definition at line 48 of file qgslayoutitemcombobox.cpp.

◆ exceptedItemList()

QList< QgsLayoutItem * > QgsLayoutItemComboBox::exceptedItemList ( ) const

Returns the list of specific items excluded from the combo box.

See also
setExceptedItemList()

Definition at line 110 of file qgslayoutitemcombobox.cpp.

◆ item()

QgsLayoutItem * QgsLayoutItemComboBox::item ( int  index) const

Returns the item currently shown at the specified index within the combo box.

See also
currentItem()

Definition at line 135 of file qgslayoutitemcombobox.cpp.

◆ itemChanged

void QgsLayoutItemComboBox::itemChanged ( QgsLayoutItem item)
signal

Emitted whenever the currently selected item changes.

◆ itemFlags()

QgsLayoutItem::Flags QgsLayoutItemComboBox::itemFlags ( ) const

Returns the layout item flags used for filtering the available items.

Returns nullptr if no flag based filtering is occurring.

See also
setItemFlags()
Since
QGIS 3.16

Definition at line 130 of file qgslayoutitemcombobox.cpp.

◆ itemType()

QgsLayoutItemRegistry::ItemType QgsLayoutItemComboBox::itemType ( ) const

Returns the filter for the item types to show in the combo box.

See also
setItemType()

Definition at line 100 of file qgslayoutitemcombobox.cpp.

◆ setAllowEmptyItem()

void QgsLayoutItemComboBox::setAllowEmptyItem ( bool  allowEmpty)

Sets whether an optional empty layout item is present in the combobox.

See also
allowEmptyItem()
Since
QGIS 3.8

Definition at line 115 of file qgslayoutitemcombobox.cpp.

◆ setCurrentLayout()

void QgsLayoutItemComboBox::setCurrentLayout ( QgsLayout layout)

Sets the layout containing the items to list in the combo box.

See also
currentLayout()

Definition at line 33 of file qgslayoutitemcombobox.cpp.

◆ setExceptedItemList()

void QgsLayoutItemComboBox::setExceptedItemList ( const QList< QgsLayoutItem * > &  exceptList)

Sets a list of specific items to exclude from the combo box.

See also
exceptedItemList()

Definition at line 105 of file qgslayoutitemcombobox.cpp.

◆ setItem

void QgsLayoutItemComboBox::setItem ( const QgsLayoutItem item)
slot

Sets the currently selected item in the combo box.

Definition at line 53 of file qgslayoutitemcombobox.cpp.

◆ setItemFlags()

void QgsLayoutItemComboBox::setItemFlags ( QgsLayoutItem::Flags  flags)

Sets layout item flags to use for filtering the available items.

Set flags to nullptr to clear the flag based filtering.

See also
itemFlags()
Since
QGIS 3.16

Definition at line 125 of file qgslayoutitemcombobox.cpp.

◆ setItemType()

void QgsLayoutItemComboBox::setItemType ( QgsLayoutItemRegistry::ItemType  itemType)

Sets a filter for the item type to show in the combo box.

Parameters
itemTypetype of items to show. Set to QgsLayoutItemRegistry::LayoutItem to show all items.
See also
itemType()

Definition at line 95 of file qgslayoutitemcombobox.cpp.


The documentation for this class was generated from the following files: