QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
A reusable widget for showing a filtered list of entities from a QgsStyle database. More...
#include <qgsstyleitemslistwidget.h>
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. | |
void | selectionChanged (const QString &name, QgsStyle::StyleEntity type) |
Emitted when the selected item is changed in the widget. | |
void | selectionChangedWithStylePath (const QString &name, QgsStyle::StyleEntity type, const QString &stylePath) |
Emitted when the selected item is changed in the widget. | |
Public Member Functions | |
QgsStyleItemsListWidget (QWidget *parent SIP_TRANSFERTHIS) | |
Constructor for QgsStyleItemsListWidget, with the specified parent widget. | |
QMenu * | advancedMenu () |
Returns a pointer to the widget's current advanced menu. | |
QgsStyle::StyleEntity | currentEntityType () const |
Returns the type of the item currently selected in the widget. | |
QString | currentItemName () const |
Returns the name of the item currently selected in the widget. | |
QString | currentTagFilter () const |
Returns the current tag filter set for the widget, if any is set. | |
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. | |
void | setEntityType (QgsStyle::StyleEntity type) |
Sets the type of style entity to show in the widget. | |
void | setEntityTypes (const QList< QgsStyle::StyleEntity > &filters) SIP_SKIP |
Sets the types of style entity to show in the widget. | |
void | setLayerType (Qgis::GeometryType type) |
Sets the layer type to show in the widget. | |
void | setStyle (QgsStyle *style) |
Sets the style database associated with the widget. | |
void | setSymbolType (Qgis::SymbolType type) |
Sets the type of symbols to show in the widget. | |
void | showAdvancedButton (bool enabled) |
Sets whether the advanced button should be shown in the widget. | |
Protected Member Functions | |
void | showEvent (QShowEvent *event) override |
A reusable widget for showing a filtered list of entities from a QgsStyle database.
Definition at line 79 of file qgsstyleitemslistwidget.h.
QgsStyleItemsListWidget::QgsStyleItemsListWidget | ( | QWidget *parent | SIP_TRANSFERTHIS | ) |
Constructor for QgsStyleItemsListWidget, with the specified parent widget.
Definition at line 176 of file qgsstyleitemslistwidget.cpp.
QMenu * QgsStyleItemsListWidget::advancedMenu | ( | ) |
Returns a pointer to the widget's current advanced menu.
Definition at line 362 of file qgsstyleitemslistwidget.cpp.
QgsStyle::StyleEntity QgsStyleItemsListWidget::currentEntityType | ( | ) | const |
Returns the type of the item currently selected in the widget.
Definition at line 392 of file qgsstyleitemslistwidget.cpp.
QString QgsStyleItemsListWidget::currentItemName | ( | ) | const |
Returns the name of the item currently selected in the widget.
Definition at line 381 of file qgsstyleitemslistwidget.cpp.
QString QgsStyleItemsListWidget::currentTagFilter | ( | ) | const |
Returns the current tag filter set for the widget, if any is set.
Definition at line 357 of file qgsstyleitemslistwidget.cpp.
|
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.
|
signal |
Emitted when the selected item is changed in the widget.
name | Newly selected item name |
type | Newly selected item type |
|
signal |
Emitted when the selected item is changed in the widget.
name | Newly selected item name |
type | Newly selected item type |
stylePath | file path to associated style database |
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.
Definition at line 367 of file qgsstyleitemslistwidget.cpp.
void QgsStyleItemsListWidget::setEntityType | ( | QgsStyle::StyleEntity | type | ) |
Sets the type of style entity to show in the widget.
Definition at line 275 of file qgsstyleitemslistwidget.cpp.
void QgsStyleItemsListWidget::setEntityTypes | ( | const QList< QgsStyle::StyleEntity > & | filters | ) |
Sets the types of style entity to show in the widget.
Definition at line 330 of file qgsstyleitemslistwidget.cpp.
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 352 of file qgsstyleitemslistwidget.cpp.
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 245 of file qgsstyleitemslistwidget.cpp.
void QgsStyleItemsListWidget::setSymbolType | ( | Qgis::SymbolType | type | ) |
Sets the type of symbols to show in the widget.
Definition at line 346 of file qgsstyleitemslistwidget.cpp.
void QgsStyleItemsListWidget::showAdvancedButton | ( | bool | enabled | ) |
Sets whether the advanced button should be shown in the widget.
By default the button is hidden.
Definition at line 376 of file qgsstyleitemslistwidget.cpp.
|
overrideprotected |
Definition at line 403 of file qgsstyleitemslistwidget.cpp.