16 #ifndef QGSGRADIENTSTOPEDITOR_H
17 #define QGSGRADIENTSTOPEDITOR_H
64 void selectStop(
int index );
72 QSize sizeHint()
const override;
73 void paintEvent( QPaintEvent *event )
override;
85 void setSelectedStopColor(
const QColor &color );
94 void setSelectedStopOffset(
double offset );
101 void setSelectedStopColorSpec( QColor::Spec spec );
117 void setSelectedStopDetails(
const QColor &color,
double offset );
123 void deleteSelectedStop();
131 void setColor1(
const QColor &color );
139 void setColor2(
const QColor &color );
154 void mouseMoveEvent( QMouseEvent *event )
override;
155 void mousePressEvent( QMouseEvent *event )
override;
156 void mouseDoubleClickEvent( QMouseEvent *event )
override;
157 void keyPressEvent( QKeyEvent *event )
override;
160 void dragEnterEvent( QDragEnterEvent *e )
override;
163 void dropEvent( QDropEvent *e )
override;
171 QPixmap transparentBackground();
180 void drawStopMarker( QPainter &painter, QPoint topMiddle,
const QColor &color,
bool selected =
false );
183 double pointToRelativePosition(
int x )
const;
186 int relativePositionToPoint(
double position )
const;
189 bool selectedStopIsMovable()
const;
192 int findClosestStop(
int x,
int threshold = -1 )
const;
200 int mSelectedStop = 0;
203 QPolygonF sOuterTriangle;
206 QPolygonF sInnerTriangle;
210 #endif // QGSGRADIENTSTOPEDITOR_H