QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Signals | Public Member Functions | Protected Member Functions | List of all members
QgsStyleItemsListWidget Class Reference

A reusable widget for showing a filtered list of entities from a QgsStyle database. More...

#include <qgsstyleitemslistwidget.h>

Inheritance diagram for QgsStyleItemsListWidget:
Inheritance graph
[legend]

Signals

void saveEntity ()
 Emitted when the user has opted to save a new entity to the style database, by clicking the "Save" button in the widget. More...
 
void selectionChanged (const QString &name, QgsStyle::StyleEntity type)
 Emitted when the selected item is changed in the widget. More...
 
void selectionChangedWithStylePath (const QString &name, QgsStyle::StyleEntity type, const QString &stylePath)
 Emitted when the selected item is changed in the widget. More...
 

Public Member Functions

 QgsStyleItemsListWidget (QWidget *parent SIP_TRANSFERTHIS)
 Constructor for QgsStyleItemsListWidget, with the specified parent widget. More...
 
QMenu * advancedMenu ()
 Returns a pointer to the widget's current advanced menu. More...
 
QgsStyle::StyleEntity currentEntityType () const
 Returns the type of the item currently selected in the widget. More...
 
QString currentItemName () const
 Returns the name of the item currently selected in the widget. More...
 
QString currentTagFilter () const
 Returns the current tag filter set for the widget, if any is set. More...
 
void setAdvancedMenu (QMenu *menu)
 Sets the widget's advanced menu, which is shown when the user clicks the "Advanced" button in the widget's GUI. More...
 
void setEntityType (QgsStyle::StyleEntity type)
 Sets the type of style entity to show in the widget. More...
 
void setEntityTypes (const QList< QgsStyle::StyleEntity > &filters) SIP_SKIP
 Sets the types of style entity to show in the widget. More...
 
void setLayerType (Qgis::GeometryType type)
 Sets the layer type to show in the widget. More...
 
void setStyle (QgsStyle *style)
 Sets the style database associated with the widget. More...
 
void setSymbolType (Qgis::SymbolType type)
 Sets the type of symbols to show in the widget. More...
 
void showAdvancedButton (bool enabled)
 Sets whether the advanced button should be shown in the widget. More...
 

Protected Member Functions

void showEvent (QShowEvent *event) override
 

Detailed Description

A reusable widget for showing a filtered list of entities from a QgsStyle database.

Since
QGIS 3.10

Definition at line 79 of file qgsstyleitemslistwidget.h.

Constructor & Destructor Documentation

◆ QgsStyleItemsListWidget()

QgsStyleItemsListWidget::QgsStyleItemsListWidget ( QWidget *parent  SIP_TRANSFERTHIS)

Constructor for QgsStyleItemsListWidget, with the specified parent widget.

Definition at line 175 of file qgsstyleitemslistwidget.cpp.

Member Function Documentation

◆ advancedMenu()

QMenu * QgsStyleItemsListWidget::advancedMenu ( )

Returns a pointer to the widget's current advanced menu.

See also
setAdvancedMenu()
Note
Not available in Python bindings.

Definition at line 361 of file qgsstyleitemslistwidget.cpp.

◆ currentEntityType()

QgsStyle::StyleEntity QgsStyleItemsListWidget::currentEntityType ( ) const

Returns the type of the item currently selected in the widget.

See also
currentItemName()

Definition at line 391 of file qgsstyleitemslistwidget.cpp.

◆ currentItemName()

QString QgsStyleItemsListWidget::currentItemName ( ) const

Returns the name of the item currently selected in the widget.

See also
currentEntityType()

Definition at line 380 of file qgsstyleitemslistwidget.cpp.

◆ currentTagFilter()

QString QgsStyleItemsListWidget::currentTagFilter ( ) const

Returns the current tag filter set for the widget, if any is set.

Definition at line 356 of file qgsstyleitemslistwidget.cpp.

◆ saveEntity

void QgsStyleItemsListWidget::saveEntity ( )
signal

Emitted when the user has opted to save a new entity to the style database, by clicking the "Save" button in the widget.

It is the caller's responsibility to handle this in an appropriate manner given the context of the widget.

◆ selectionChanged

void QgsStyleItemsListWidget::selectionChanged ( const QString &  name,
QgsStyle::StyleEntity  type 
)
signal

Emitted when the selected item is changed in the widget.

Parameters
nameNewly selected item name
typeNewly selected item type

◆ selectionChangedWithStylePath

void QgsStyleItemsListWidget::selectionChangedWithStylePath ( const QString &  name,
QgsStyle::StyleEntity  type,
const QString &  stylePath 
)
signal

Emitted when the selected item is changed in the widget.

Parameters
nameNewly selected item name
typeNewly selected item type
stylePathfile path to associated style database
Since
QGIS 3.26

◆ setAdvancedMenu()

void QgsStyleItemsListWidget::setAdvancedMenu ( QMenu *  menu)

Sets the widget's advanced menu, which is shown when the user clicks the "Advanced" button in the widget's GUI.

Ownership of menu is NOT transferred to the widget.

See also
advancedMenu()
Note
Not available in Python bindings.

Definition at line 366 of file qgsstyleitemslistwidget.cpp.

◆ setEntityType()

void QgsStyleItemsListWidget::setEntityType ( QgsStyle::StyleEntity  type)

Sets the type of style entity to show in the widget.

See also
setSymbolType()

Definition at line 274 of file qgsstyleitemslistwidget.cpp.

◆ setEntityTypes()

void QgsStyleItemsListWidget::setEntityTypes ( const QList< QgsStyle::StyleEntity > &  filters)

Sets the types of style entity to show in the widget.

Note
Not available in Python bindings.

Definition at line 329 of file qgsstyleitemslistwidget.cpp.

◆ setLayerType()

void QgsStyleItemsListWidget::setLayerType ( Qgis::GeometryType  type)

Sets the layer type to show in the widget.

Set type to Qgis::GeometryType::Unknown if no layer type filter is desired.

This setting only applies to label settings and 3d style entities.

Definition at line 351 of file qgsstyleitemslistwidget.cpp.

◆ setStyle()

void QgsStyleItemsListWidget::setStyle ( QgsStyle style)

Sets the style database associated with the widget.

Ownership of style is not transferred, and the caller is responsible for ensuring that it exists for the lifetime of the widget.

Definition at line 244 of file qgsstyleitemslistwidget.cpp.

◆ setSymbolType()

void QgsStyleItemsListWidget::setSymbolType ( Qgis::SymbolType  type)

Sets the type of symbols to show in the widget.

See also
setEntityType()

Definition at line 345 of file qgsstyleitemslistwidget.cpp.

◆ showAdvancedButton()

void QgsStyleItemsListWidget::showAdvancedButton ( bool  enabled)

Sets whether the advanced button should be shown in the widget.

By default the button is hidden.

See also
setAdvancedMenu()
Note
Not available in Python bindings.

Definition at line 375 of file qgsstyleitemslistwidget.cpp.

◆ showEvent()

void QgsStyleItemsListWidget::showEvent ( QShowEvent *  event)
overrideprotected

Definition at line 402 of file qgsstyleitemslistwidget.cpp.


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