16 #ifndef QGSCOLORWIDGETS_H
17 #define QGSCOLORWIDGETS_H
59 QgsColorWidget( QWidget* parent = 0,
const ColorComponent component = Multiple );
81 int componentValue()
const;
86 static QPixmap createDragIcon(
const QColor &color );
95 virtual void setColor(
const QColor &color,
const bool emitSignals =
false );
101 virtual void setComponent(
const ColorComponent component );
111 virtual void setComponentValue(
const int value );
118 void colorChanged(
const QColor &color );
134 int componentRange()
const;
166 static const QPixmap& transparentBackground();
169 void dragEnterEvent( QDragEnterEvent * e )
override;
172 void dropEvent( QDropEvent *e )
override;
196 void paintEvent( QPaintEvent* event )
override;
200 virtual void setColor(
const QColor &color,
const bool emitSignals =
false )
override;
204 virtual void resizeEvent( QResizeEvent *event )
override;
205 virtual void mouseMoveEvent( QMouseEvent *event )
override;
206 virtual void mousePressEvent( QMouseEvent *event )
override;
207 virtual void mouseReleaseEvent( QMouseEvent *event )
override;
225 ControlPart mClickedPart;
231 QImage* mTriangleImage;
234 QImage* mWidgetImage;
248 void createImages(
const QSizeF
size );
254 void createTriangle();
259 void setColorFromPos(
const QPointF pos );
288 virtual QSize sizeHint()
const override;
289 void paintEvent( QPaintEvent* event )
override;
294 virtual void setColor(
const QColor &color,
const bool emitSignals =
false )
override;
298 virtual void resizeEvent( QResizeEvent *event )
override;
299 virtual void mouseMoveEvent( QMouseEvent *event )
override;
300 virtual void mousePressEvent( QMouseEvent *event )
override;
320 int valueRangeX()
const;
325 int valueRangeY()
const;
333 int yComponentValue()
const;
341 int xComponentValue()
const;
346 void setColorFromPoint(
const QPoint& point );
383 virtual QSize sizeHint()
const override;
384 void paintEvent( QPaintEvent* event )
override;
390 void setOrientation(
const Orientation orientation );
402 void setInteriorMargin(
const int margin );
414 void setShowFrame(
const bool showFrame );
425 void setMarkerSize(
const int markerSize );
432 void valueChanged(
const int value );
436 virtual void mouseMoveEvent( QMouseEvent *event )
override;
437 virtual void mousePressEvent( QMouseEvent *event )
override;
438 virtual void keyPressEvent( QKeyEvent * event )
override;
443 Orientation mOrientation;
452 QPolygonF mTopTriangle;
455 QPolygonF mBottomTriangle;
460 void setColorFromPoint(
const QPointF &point );
487 virtual void setColor(
const QColor &color,
const bool emitSignals =
false )
override;
503 int convertRealToDisplay(
const int realValue )
const;
510 int convertDisplayToReal(
const int displayValue )
const;
516 void rampColorChanged(
const QColor &color );
520 void spinChanged(
int value );
524 void rampChanged(
int value );
549 virtual void setColor(
const QColor &color,
const bool emitSignals =
false )
override;
552 void resizeEvent( QResizeEvent * event )
override;
566 QLineEdit* mLineEdit;
569 QToolButton* mMenuButton;
572 ColorTextFormat mFormat;
609 void paintEvent( QPaintEvent* event )
override;
617 QColor
color2()
const {
return mColor2; }
627 virtual void setColor2(
const QColor& color );
632 void mousePressEvent( QMouseEvent* e )
override;
635 void mouseReleaseEvent( QMouseEvent* e )
override;
638 void mouseMoveEvent( QMouseEvent *e )
override;
645 QPoint mDragStartPosition;
652 void drawColor(
const QColor& color,
const QRect& rect, QPainter &painter );
655 #endif // #ifndef QGSCOLORWIDGETS_H