16#ifndef QGSCOLORWIDGETS_H
17#define QGSCOLORWIDGETS_H
19#include <QWidgetAction>
88 int componentValue()
const;
94 static QPixmap createDragIcon(
const QColor &color );
104 virtual void setColor(
const QColor &color,
bool emitSignals =
false );
122 virtual void setComponentValue(
int value );
148 int mExplicitHue = 0;
154 int componentRange()
const;
191 static const QPixmap &transparentBackground();
194 void dragEnterEvent( QDragEnterEvent *e )
override;
197 void dropEvent( QDropEvent *e )
override;
199 void mouseMoveEvent( QMouseEvent *e )
override;
200 void mousePressEvent( QMouseEvent *e )
override;
201 void mouseReleaseEvent( QMouseEvent *e )
override;
258 QMenu *mMenu =
nullptr;
262 bool mSuppressRecurse;
264 bool mDismissOnColorSelection;
276 void setColor(
const QColor &color );
303 QSize sizeHint()
const override;
304 void paintEvent( QPaintEvent *event )
override;
308 void setColor(
const QColor &color,
bool emitSignals =
false )
override;
312 void resizeEvent( QResizeEvent *event )
override;
313 void mouseMoveEvent( QMouseEvent *event )
override;
314 void mousePressEvent( QMouseEvent *event )
override;
315 void mouseReleaseEvent( QMouseEvent *event )
override;
326 bool mIsDragging =
false;
332 int mWheelThickness = 18;
335 ControlPart mClickedPart = QgsColorWheel::None;
338 QImage *mWheelImage =
nullptr;
341 QImage *mTriangleImage =
nullptr;
344 QImage *mWidgetImage =
nullptr;
347 bool mWheelDirty =
true;
350 bool mTriangleDirty =
true;
359 void createImages( QSizeF size );
365 void createTriangle();
371 void setColorFromPos( QPointF pos );
402 QSize sizeHint()
const override;
403 void paintEvent( QPaintEvent *event )
override;
408 void setColor(
const QColor &color,
bool emitSignals =
false )
override;
412 void resizeEvent( QResizeEvent *event )
override;
413 void mouseMoveEvent( QMouseEvent *event )
override;
414 void mousePressEvent( QMouseEvent *event )
override;
415 void mouseReleaseEvent( QMouseEvent *event )
override;
419 bool mIsDragging =
false;
425 QImage *mBoxImage =
nullptr;
439 int valueRangeX()
const;
445 int valueRangeY()
const;
455 int yComponentValue()
const;
465 int xComponentValue()
const;
471 void setColorFromPoint( QPoint point );
509 QSize sizeHint()
const override;
510 void paintEvent( QPaintEvent *event )
override;
517 void setOrientation( Orientation orientation );
531 void setInteriorMargin(
int margin );
545 void setShowFrame(
bool showFrame );
558 void setMarkerSize(
int markerSize );
570 void mouseMoveEvent( QMouseEvent *event )
override;
571 void wheelEvent( QWheelEvent *event )
override;
572 void mousePressEvent( QMouseEvent *event )
override;
573 void mouseReleaseEvent( QMouseEvent *event )
override;
574 void keyPressEvent( QKeyEvent *event )
override;
578 bool mIsDragging =
false;
587 bool mShowFrame =
false;
590 QPolygonF mTopTriangle;
593 QPolygonF mBottomTriangle;
599 void setColorFromPoint( QPointF point );
625 void setComponentValue(
int value )
override;
626 void setColor(
const QColor &color,
bool emitSignals =
false )
override;
634 QSpinBox *mSpinBox =
nullptr;
643 int convertRealToDisplay(
int realValue )
const;
651 int convertDisplayToReal(
int displayValue )
const;
658 void rampColorChanged(
const QColor &color );
663 void spinChanged(
int value );
668 void rampChanged(
int value );
697 Q_ENUM( ColorTextFormat )
705 void setColor(
const QColor &color,
bool emitSignals =
false )
override;
712 void setAllowOpacity(
bool allowOpacity );
715 void resizeEvent( QResizeEvent *event )
override;
719 QLineEdit *mLineEdit =
nullptr;
722 QToolButton *mMenuButton =
nullptr;
727 bool mAllowAlpha =
true;
767 void paintEvent( QPaintEvent *event )
override;
768 QSize sizeHint()
const override;
777 QColor
color2()
const {
return mColor2; }
788 virtual void setColor2(
const QColor &color );
793 void mousePressEvent( QMouseEvent *e )
override;
796 void mouseReleaseEvent( QMouseEvent *e )
override;
799 void mouseMoveEvent( QMouseEvent *e )
override;
806 QPoint mDragStartPosition;
813 void drawColor(
const QColor &color, QRect rect, QPainter &painter );
A line edit widget which displays colors as text and accepts string representations of colors.
ColorTextFormat
Specifies the display format for a color.
@ Rgb
Rgb( r, g, b ) format.
@ HexRgbA
#RRGGBBAA in hexadecimal, with alpha
@ HexRgb
#RRGGBB in hexadecimal
QList< QPair< QRgb, int > > QgsColorBox