16#ifndef QGSCOLORWIDGETS_H
17#define QGSCOLORWIDGETS_H
19#include <QWidgetAction>
91 int componentValue()
const;
97 static QPixmap createDragIcon(
const QColor &color );
107 virtual void setColor(
const QColor &color,
bool emitSignals =
false );
125 virtual void setComponentValue(
int value );
150 int mExplicitHue = 0;
156 int componentRange()
const;
192 QColor::Spec colorSpec()
const;
203 static const QPixmap &transparentBackground();
206 void dragEnterEvent( QDragEnterEvent *e )
override;
209 void dropEvent( QDropEvent *e )
override;
211 void mouseMoveEvent( QMouseEvent *e )
override;
212 void mousePressEvent( QMouseEvent *e )
override;
213 void mouseReleaseEvent( QMouseEvent *e )
override;
215 friend class TestQgsCompoundColorWidget;
271 QMenu *mMenu =
nullptr;
275 bool mSuppressRecurse;
277 bool mDismissOnColorSelection;
289 void setColor(
const QColor &color );
315 QSize sizeHint()
const override;
316 void paintEvent( QPaintEvent *event )
override;
320 void setColor(
const QColor &color,
bool emitSignals =
false )
override;
324 void resizeEvent( QResizeEvent *event )
override;
325 void mouseMoveEvent( QMouseEvent *event )
override;
326 void mousePressEvent( QMouseEvent *event )
override;
327 void mouseReleaseEvent( QMouseEvent *event )
override;
338 bool mIsDragging =
false;
344 int mWheelThickness = 18;
347 ControlPart mClickedPart = QgsColorWheel::None;
353 QImage mTriangleImage;
359 bool mWheelDirty =
true;
362 bool mTriangleDirty =
true;
371 void createImages( QSizeF size );
377 void createTriangle();
383 void setColorFromPos( QPointF pos );
413 QSize sizeHint()
const override;
414 void paintEvent( QPaintEvent *event )
override;
419 void setColor(
const QColor &color,
bool emitSignals =
false )
override;
423 void resizeEvent( QResizeEvent *event )
override;
424 void mouseMoveEvent( QMouseEvent *event )
override;
425 void mousePressEvent( QMouseEvent *event )
override;
426 void mouseReleaseEvent( QMouseEvent *event )
override;
430 bool mIsDragging =
false;
436 QImage *mBoxImage =
nullptr;
450 int valueRangeX()
const;
456 int valueRangeY()
const;
466 int yComponentValue()
const;
476 int xComponentValue()
const;
482 void setColorFromPoint( QPoint point );
519 QSize sizeHint()
const override;
520 void paintEvent( QPaintEvent *event )
override;
527 void setOrientation( Orientation orientation );
541 void setInteriorMargin(
int margin );
555 void setShowFrame(
bool showFrame );
568 void setMarkerSize(
int markerSize );
580 void mouseMoveEvent( QMouseEvent *event )
override;
581 void wheelEvent( QWheelEvent *event )
override;
582 void mousePressEvent( QMouseEvent *event )
override;
583 void mouseReleaseEvent( QMouseEvent *event )
override;
584 void keyPressEvent( QKeyEvent *event )
override;
588 bool mIsDragging =
false;
597 bool mShowFrame =
false;
600 QPolygonF mTopTriangle;
603 QPolygonF mBottomTriangle;
609 void setColorFromPoint( QPointF point );
634 void setComponentValue(
int value )
override;
635 void setColor(
const QColor &color,
bool emitSignals =
false )
override;
643 QSpinBox *mSpinBox =
nullptr;
652 int convertRealToDisplay(
int realValue )
const;
660 int convertDisplayToReal(
int displayValue )
const;
667 void rampColorChanged(
const QColor &color );
672 void spinChanged(
int value );
677 void rampChanged(
int value );
705 Q_ENUM( ColorTextFormat )
713 void setColor(
const QColor &color,
bool emitSignals =
false )
override;
720 void setAllowOpacity(
bool allowOpacity );
723 void resizeEvent( QResizeEvent *event )
override;
727 QLineEdit *mLineEdit =
nullptr;
730 QToolButton *mMenuButton =
nullptr;
735 bool mAllowAlpha =
true;
774 void paintEvent( QPaintEvent *event )
override;
775 QSize sizeHint()
const override;
784 QColor
color2()
const {
return mColor2; }
795 virtual void setColor2(
const QColor &color );
800 void mousePressEvent( QMouseEvent *e )
override;
803 void mouseReleaseEvent( QMouseEvent *e )
override;
806 void mouseMoveEvent( QMouseEvent *e )
override;
813 QPoint mDragStartPosition;
820 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
~QgsColorWheel() override