QGIS/python/gui/qgssymbolbutton.sip

205 lines
5.2 KiB
Plaintext
Raw Normal View History

/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgssymbolbutton.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsSymbolButton : QToolButton
{
%Docstring
2017-12-15 10:36:55 -04:00
A button for creating and modifying QgsSymbol settings.
2017-12-15 10:36:55 -04:00
The button shows a preview icon for the current symbol, and will open a detailed symbol editor dialog (or
panel widget) when clicked.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgssymbolbutton.h"
%End
public:
QgsSymbolButton( QWidget *parent /TransferThis/ = 0, const QString &dialogTitle = QString() );
%Docstring
2017-12-15 10:36:55 -04:00
Construct a new symbol button.
Use ``dialogTitle`` string to define the title to show in the symbol settings dialog.
%End
virtual QSize minimumSizeHint() const;
virtual QSize sizeHint() const;
void setSymbolType( QgsSymbol::SymbolType type );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the symbol ``type`` which the button requires.
If the type differs from the current symbol type, the symbol will be reset
to a default symbol style of the new type.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`symbolType()`
%End
QgsSymbol::SymbolType symbolType() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the symbol type which the button requires.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setSymbolType()`
%End
void setDialogTitle( const QString &title );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``title`` for the symbol settings dialog window.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`dialogTitle()`
%End
QString dialogTitle() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the title for the symbol settings dialog window.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setDialogTitle()`
%End
QgsSymbol *symbol();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the current symbol defined by the button.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setSymbol()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`changed()`
%End
QgsMapCanvas *mapCanvas() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the map canvas associated with the widget.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setMapCanvas()`
%End
void setMapCanvas( QgsMapCanvas *canvas );
%Docstring
2017-12-15 10:36:55 -04:00
Sets a map ``canvas`` to associate with the widget. This allows the
widget to fetch current settings from the map canvas, such as current scale.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`mapCanvas()`
%End
QgsVectorLayer *layer() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the layer associated with the widget.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setLayer()`
%End
void setLayer( QgsVectorLayer *layer );
%Docstring
2017-12-15 10:36:55 -04:00
Sets a ``layer`` to associate with the widget. This allows the
widget to setup layer related settings within the symbol settings dialog,
such as correctly populating data defined override buttons.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`layer()`
%End
void registerExpressionContextGenerator( QgsExpressionContextGenerator *generator );
%Docstring
2017-12-15 10:36:55 -04:00
Register an expression context generator class that will be used to retrieve
an expression context for the button when required.
%End
public slots:
void setSymbol( QgsSymbol *symbol /Transfer/ );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``symbol`` for the button. Ownership of ``symbol`` is transferred to the
button.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`symbol()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`changed()`
%End
void setColor( const QColor &color );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the current ``color`` for the symbol. Will emit a changed() signal if the color is different
to the previous symbol color.
%End
void copySymbol();
%Docstring
2017-12-15 10:36:55 -04:00
Copies the current symbol to the clipboard.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`pasteSymbol()`
%End
void pasteSymbol();
%Docstring
2017-12-15 10:36:55 -04:00
Pastes a symbol from the clipboard. If clipboard does not contain a valid
symbol then no change is applied.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`copySymbol()`
%End
void copyColor();
%Docstring
2017-12-15 10:36:55 -04:00
Copies the current symbol color to the clipboard.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`pasteColor()`
%End
void pasteColor();
%Docstring
2017-12-15 10:36:55 -04:00
Pastes a color from the clipboard to the symbol. If clipboard does not contain a valid
color or string representation of a color, then no change is applied.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`copyColor()`
%End
signals:
void changed();
%Docstring
2017-12-15 10:36:55 -04:00
Emitted when the symbol's settings are changed.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`symbol()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setSymbol()`
%End
protected:
virtual void changeEvent( QEvent *e );
virtual void showEvent( QShowEvent *e );
virtual void resizeEvent( QResizeEvent *event );
virtual void mousePressEvent( QMouseEvent *e );
virtual void mouseMoveEvent( QMouseEvent *e );
virtual void dragEnterEvent( QDragEnterEvent *e );
virtual void dragLeaveEvent( QDragLeaveEvent *e );
virtual void dropEvent( QDropEvent *e );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgssymbolbutton.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/