QGIS/python/gui/auto_generated/symbology/qgscategorizedsymbolrendererwidget.sip.in
Nyall Dawson f3f4c17c5f Use a safer approach to update renderers after symbol levels are changed
Instead of directly changing the renderer in place in the symbol levels
widget, we delegate responsibility for handling the changes to symbol
levels to the parent QgsRendererWidget subclass. This allows us to
implement different logic in the various subclasses which correctly
handle how that particular widget subclass should update any internal
symbol references and ultimately update the renderer.

Fixes instability and crashes after editing symbol levels.

Fixes #42671
2021-05-26 11:50:44 +10:00

148 lines
3.8 KiB
Plaintext

/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/symbology/qgscategorizedsymbolrendererwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsCategorizedSymbolRendererWidget : QgsRendererWidget
{
%TypeHeaderCode
#include "qgscategorizedsymbolrendererwidget.h"
%End
public:
static QgsRendererWidget *create( QgsVectorLayer *layer, QgsStyle *style, QgsFeatureRenderer *renderer ) /Factory/;
QgsCategorizedSymbolRendererWidget( QgsVectorLayer *layer, QgsStyle *style, QgsFeatureRenderer *renderer );
~QgsCategorizedSymbolRendererWidget();
virtual QgsFeatureRenderer *renderer();
virtual void setContext( const QgsSymbolWidgetContext &context );
int matchToSymbols( QgsStyle *style );
%Docstring
Replaces category symbols with the symbols from a style that have a matching
name.
:param style: style containing symbols to match with
:return: number of symbols matched
.. seealso:: :py:func:`matchToSymbolsFromLibrary`
.. seealso:: :py:func:`matchToSymbolsFromXml`
.. versionadded:: 2.9
%End
public slots:
void changeCategorizedSymbol();
void categoryColumnChanged( const QString &field );
void categoriesDoubleClicked( const QModelIndex &idx );
void addCategory();
void addCategories();
void applyColorRamp();
%Docstring
Applies the color ramp passed on by the color ramp button
%End
void deleteCategories();
void deleteAllCategories();
void showSymbolLevels();
void rowsMoved();
void matchToSymbolsFromLibrary();
%Docstring
Replaces category symbols with the symbols from the users' symbol library that have a
matching name.
.. seealso:: :py:func:`matchToSymbolsFromXml`
.. seealso:: :py:func:`matchToSymbols`
.. versionadded:: 2.9
%End
void matchToSymbolsFromXml();
%Docstring
Prompts for selection of an xml file, then replaces category symbols with the symbols
from the XML file with a matching name.
.. seealso:: :py:func:`matchToSymbolsFromLibrary`
.. seealso:: :py:func:`matchToSymbols`
.. versionadded:: 2.9
%End
protected:
virtual void setSymbolLevels( const QgsLegendSymbolList &levels, bool enabled );
protected slots:
virtual void pasteSymbolToSelection();
protected:
void updateUiFromRenderer();
void populateCategories();
int currentCategoryRow();
%Docstring
Returns row index for the currently selected category (-1 if on no selection)
%End
QList<int> selectedCategories();
%Docstring
Returns a list of indexes for the categories under selection
%End
void changeSelectedSymbols();
%Docstring
Changes the selected symbols alone for the change button, if there is a selection
%End
void changeCategorySymbol();
void applyChangeToSymbol();
%Docstring
Applies current symbol to selected categories, or to all categories if none is selected
%End
virtual QList<QgsSymbol *> selectedSymbols();
QgsCategoryList selectedCategoryList();
virtual void refreshSymbolView();
virtual void keyPressEvent( QKeyEvent *event );
protected:
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/symbology/qgscategorizedsymbolrendererwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/