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
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsgradientstopeditor.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsGradientStopEditor : QWidget
{
%Docstring(signature="appended")
An interactive editor for previewing a gradient color ramp and modifying the position of color
stops along the gradient.
.. versionadded:: 2.16
%End
%TypeHeaderCode
#include "qgsgradientstopeditor.h"
%End
public:
QgsGradientStopEditor( QWidget *parent /TransferThis/ = 0, QgsGradientColorRamp *ramp = 0 );
%Docstring
Constructor for QgsGradientStopEditor.
:param parent: parent widget
:param ramp: optional initial gradient ramp
%End
void setGradientRamp( const QgsGradientColorRamp &ramp );
%Docstring
Sets the current ramp shown in the editor.
:param ramp: color ramp
.. seealso:: :py:func:`gradientRamp`
%End
QgsGradientColorRamp gradientRamp() const;
%Docstring
Returns the current ramp created by the editor.
.. seealso:: :py:func:`setGradientRamp`
%End
void selectStop( int index );
%Docstring
Sets the currently selected stop.
:param index: index of stop, where 0 corresponds to the first stop
.. seealso:: :py:func:`selectedStop`
%End
QgsGradientStop selectedStop() const;
%Docstring
Returns details about the currently selected stop.
.. seealso:: :py:func:`selectStop`
%End
virtual QSize sizeHint() const;
virtual void paintEvent( QPaintEvent *event );
public slots:
void setSelectedStopColor( const QColor &color );
%Docstring
Sets the color for the current selected stop.
:param color: new stop color
.. seealso:: :py:func:`setSelectedStopOffset`
.. seealso:: :py:func:`setSelectedStopDetails`
.. seealso:: :py:func:`setColor1`
.. seealso:: :py:func:`setColor2`
%End
void setSelectedStopOffset( double offset );
%Docstring
Sets the offset for the current selected stop. This slot has no effect if either the
first or last stop is selected, as they cannot be repositioned.
:param offset: new stop offset
.. seealso:: :py:func:`setSelectedStopColor`
.. seealso:: :py:func:`setSelectedStopDetails`
%End
void setSelectedStopDetails( const QColor &color, double offset );
%Docstring
Sets the color and offset for the current selected stop.
:param color: new stop color
:param offset: new stop offset
.. seealso:: :py:func:`setSelectedStopColor`
.. seealso:: :py:func:`setSelectedStopOffset`
%End
void deleteSelectedStop();
%Docstring
Deletes the current selected stop. This slot has no effect if either the
first or last stop is selected, as they cannot be deleted.
%End
void setColor1( const QColor &color );
%Docstring
Sets the color for the first stop.
:param color: new stop color
.. seealso:: :py:func:`setColor2`
.. seealso:: :py:func:`setSelectedStopColor`
%End
void setColor2( const QColor &color );
%Docstring
Sets the color for the last stop.
:param color: new stop color
.. seealso:: :py:func:`setColor1`
.. seealso:: :py:func:`setSelectedStopColor`
%End
signals:
void changed();
%Docstring
Emitted when the gradient ramp is changed by a user
%End
void selectedStopChanged( const QgsGradientStop &stop );
%Docstring
Emitted when the current selected stop changes.
:param stop: details about newly selected stop
%End
protected:
virtual void mouseMoveEvent( QMouseEvent *event );
virtual void mousePressEvent( QMouseEvent *event );
virtual void mouseDoubleClickEvent( QMouseEvent *event );
virtual void keyPressEvent( QKeyEvent *event );
virtual void dragEnterEvent( QDragEnterEvent *e );
virtual void dropEvent( QDropEvent *e );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsgradientstopeditor.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
|