QGIS/python/gui/qgscolorswatchgrid.sip.in

236 lines
5.7 KiB
Plaintext
Raw Normal View History

2017-05-01 13:35:13 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgscolorswatchgrid.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsColorSwatchGrid : QWidget
{
2017-05-01 13:35:13 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
A grid of color swatches, which allows for user selection. Colors are taken from an
associated QgsColorScheme.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:class:`QgsColorGridAction`
2017-12-15 10:36:55 -04:00
2017-05-01 13:35:13 +02:00
.. versionadded:: 2.5
%End
2017-05-01 13:35:13 +02:00
%TypeHeaderCode
#include "qgscolorswatchgrid.h"
%End
public:
2014-11-13 23:13:13 +01:00
2017-05-01 13:35:13 +02:00
QgsColorSwatchGrid( QgsColorScheme *scheme, const QString &context = QString(), QWidget *parent /TransferThis/ = 0 );
%Docstring
2017-12-15 10:36:55 -04:00
Construct a new color swatch grid.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param scheme: QgsColorScheme for colors to show in grid
:param context: context string provided to color scheme
:param parent: parent widget
2017-05-01 13:35:13 +02:00
%End
virtual QSize minimumSizeHint() const;
virtual QSize sizeHint() const;
QString context() const;
2017-05-01 13:35:13 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Get the current context for the grid
:return: context string which is passed to scheme for color generation
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setContext`
2017-05-01 13:35:13 +02:00
%End
2017-05-01 13:35:13 +02:00
void setContext( const QString &context );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the current context for the grid
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param context: string which is passed to scheme for color generation
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`context`
2017-05-01 13:35:13 +02:00
%End
QColor baseColor() const;
2017-05-01 13:35:13 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Get the base color for the widget
:return: base color which is passed to scheme for color generation
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setBaseColor`
2017-05-01 13:35:13 +02:00
%End
void setBaseColor( const QColor &baseColor );
2017-05-01 13:35:13 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the base color for the widget
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param baseColor: base color to pass to scheme for color generation
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`baseColor`
2017-05-01 13:35:13 +02:00
%End
2014-08-17 13:37:26 +02:00
QgsNamedColorList *colors();
2017-05-01 13:35:13 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Gets the list of colors shown in the grid
:return: list of colors currently shown in the grid
2017-05-01 13:35:13 +02:00
%End
public slots:
void refreshColors();
2017-05-01 13:35:13 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Reload colors from scheme and redraws the widget
2017-05-01 13:35:13 +02:00
%End
signals:
void colorChanged( const QColor &color );
2017-05-01 13:35:13 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Emitted when a color has been selected from the widget
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param color: selected color
2017-05-01 13:35:13 +02:00
%End
2014-11-13 23:13:13 +01:00
void hovered();
2017-05-01 13:35:13 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Emitted when mouse hovers over widget
2017-05-01 13:35:13 +02:00
%End
protected:
2017-05-01 13:35:13 +02:00
virtual void paintEvent( QPaintEvent *event );
virtual void mouseMoveEvent( QMouseEvent *event );
virtual void mousePressEvent( QMouseEvent *event );
virtual void mouseReleaseEvent( QMouseEvent *event );
virtual void keyPressEvent( QKeyEvent *event );
virtual void focusInEvent( QFocusEvent *event );
virtual void focusOutEvent( QFocusEvent *event );
};
class QgsColorSwatchGridAction: QWidgetAction
{
2017-05-01 13:35:13 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
A color swatch grid which can be embedded into a menu.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:class:`QgsColorSwatchGrid`
2017-12-15 10:36:55 -04:00
2017-05-01 13:35:13 +02:00
.. versionadded:: 2.5
%End
%TypeHeaderCode
2017-05-01 13:35:13 +02:00
#include "qgscolorswatchgrid.h"
%End
public:
2017-05-01 13:35:13 +02:00
QgsColorSwatchGridAction( QgsColorScheme *scheme, QMenu *menu = 0, const QString &context = QString(), QWidget *parent /TransferThis/ = 0 );
%Docstring
2017-12-15 10:36:55 -04:00
Construct a new color swatch grid action.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param scheme: QgsColorScheme for colors to show in grid
:param menu: parent menu
:param context: context string provided to color scheme
:param parent: parent widget
2017-05-01 13:35:13 +02:00
%End
void setBaseColor( const QColor &baseColor );
2017-05-01 13:35:13 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the base color for the color grid
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param baseColor: base color to pass to scheme for color generation
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`baseColor`
2017-05-01 13:35:13 +02:00
%End
QColor baseColor() const;
2017-05-01 13:35:13 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Get the base color for the color grid
:return: base color which is passed to scheme for color generation
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setBaseColor`
2017-05-01 13:35:13 +02:00
%End
QString context() const;
2017-05-01 13:35:13 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Get the current context for the color grid
:return: context string which is passed to scheme for color generation
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setContext`
2017-05-01 13:35:13 +02:00
%End
2015-02-03 02:21:52 +01:00
void setContext( const QString &context );
2017-05-01 13:35:13 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the current context for the color grid
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param context: string which is passed to scheme for color generation
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`context`
2017-05-01 13:35:13 +02:00
%End
void setDismissOnColorSelection( bool dismiss );
2017-05-01 13:35:13 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether the parent menu should be dismissed and closed when a color is selected
from the action's color widget.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param dismiss: set to true (default) to immediately close the menu when a color is selected
from the widget. If set to false, the colorChanged signal will be emitted but the menu will
stay open.
.. seealso:: :py:func:`dismissOnColorSelection`
2017-12-15 10:36:55 -04:00
2017-05-01 13:35:13 +02:00
.. versionadded:: 2.14
%End
bool dismissOnColorSelection() const;
2017-05-01 13:35:13 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns whether the parent menu will be dismissed after a color is selected from the
action's color widget.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setDismissOnColorSelection`
2017-12-15 10:36:55 -04:00
2017-05-01 13:35:13 +02:00
.. versionadded:: 2.14
%End
public slots:
void refreshColors();
2017-05-01 13:35:13 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Reload colors from scheme and redraws the widget
2017-05-01 13:35:13 +02:00
%End
signals:
void colorChanged( const QColor &color );
2017-05-01 13:35:13 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Emitted when a color has been selected from the widget
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param color: selected color
2017-05-01 13:35:13 +02:00
%End
2014-08-17 13:37:26 +02:00
};
2017-05-01 13:35:13 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgscolorswatchgrid.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/