File: qgscolorswatchgrid.sip.in

package info (click to toggle)
qgis 3.40.10%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,183,672 kB
  • sloc: cpp: 1,595,771; python: 372,544; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 161
file content (225 lines) | stat: -rw-r--r-- 5,874 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/gui/qgscolorswatchgrid.h                                         *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/


class QgsColorSwatchGrid : QWidget
{
%Docstring(signature="appended")
A grid of color swatches, which allows for user selection. Colors are
taken from an associated :py:class:`QgsColorScheme`.

.. seealso:: :py:class:`QgsColorGridAction`
%End

%TypeHeaderCode
#include "qgscolorswatchgrid.h"
%End
  public:
    QgsColorSwatchGrid( QgsColorScheme *scheme, const QString &context = QString(), QWidget *parent /TransferThis/ = 0 );
%Docstring
Construct a new color swatch grid.

:param scheme: :py:class:`QgsColorScheme` for colors to show in grid
:param context: context string provided to color scheme
:param parent: parent widget
%End

    virtual QSize minimumSizeHint() const;


    virtual QSize sizeHint() const;


    QString context() const;
%Docstring
Gets the current context for the grid

:return: context string which is passed to scheme for color generation

.. seealso:: :py:func:`setContext`
%End

    void setContext( const QString &context );
%Docstring
Sets the current context for the grid

:param context: string which is passed to scheme for color generation

.. seealso:: :py:func:`context`
%End

    QColor baseColor() const;
%Docstring
Gets the base color for the widget

:return: base color which is passed to scheme for color generation

.. seealso:: :py:func:`setBaseColor`
%End

    void setBaseColor( const QColor &baseColor );
%Docstring
Sets the base color for the widget

:param baseColor: base color to pass to scheme for color generation

.. seealso:: :py:func:`baseColor`
%End

    QgsNamedColorList *colors();
%Docstring
Gets the list of colors shown in the grid

:return: list of colors currently shown in the grid
%End

  public slots:

    void refreshColors();
%Docstring
Reload colors from scheme and redraws the widget
%End

  signals:

    void colorChanged( const QColor &color );
%Docstring
Emitted when a color has been selected from the widget

:param color: selected color
%End

    void hovered();
%Docstring
Emitted when mouse hovers over widget
%End

  protected:
    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
{
%Docstring(signature="appended")
A color swatch grid which can be embedded into a menu.

.. seealso:: :py:class:`QgsColorSwatchGrid`
%End

%TypeHeaderCode
#include "qgscolorswatchgrid.h"
%End
  public:
    QgsColorSwatchGridAction( QgsColorScheme *scheme, QMenu *menu = 0, const QString &context = QString(), QWidget *parent /TransferThis/ = 0 );
%Docstring
Construct a new color swatch grid action.

:param scheme: :py:class:`QgsColorScheme` for colors to show in grid
:param menu: parent menu
:param context: context string provided to color scheme
:param parent: parent widget
%End

    void setBaseColor( const QColor &baseColor );
%Docstring
Sets the base color for the color grid

:param baseColor: base color to pass to scheme for color generation

.. seealso:: :py:func:`baseColor`
%End

    QColor baseColor() const;
%Docstring
Gets the base color for the color grid

:return: base color which is passed to scheme for color generation

.. seealso:: :py:func:`setBaseColor`
%End

    QString context() const;
%Docstring
Gets the current context for the color grid

:return: context string which is passed to scheme for color generation

.. seealso:: :py:func:`setContext`
%End

    void setContext( const QString &context );
%Docstring
Sets the current context for the color grid

:param context: string which is passed to scheme for color generation

.. seealso:: :py:func:`context`
%End

    void setDismissOnColorSelection( bool dismiss );
%Docstring
Sets whether the parent menu should be dismissed and closed when a color
is selected from the action's color widget.

: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`
%End

    bool dismissOnColorSelection() const;
%Docstring
Returns whether the parent menu will be dismissed after a color is
selected from the action's color widget.

.. seealso:: :py:func:`setDismissOnColorSelection`
%End

  public slots:

    void refreshColors();
%Docstring
Reload colors from scheme and redraws the widget
%End

  signals:

    void colorChanged( const QColor &color );
%Docstring
Emitted when a color has been selected from the widget

:param color: selected color
%End

};

/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/gui/qgscolorswatchgrid.h                                         *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/