16#ifndef QGSCOLORWIDGETS_H
17#define QGSCOLORWIDGETS_H
19#include <QWidgetAction>
87 int componentValue()
const;
93 static QPixmap createDragIcon(
const QColor &color );
103 virtual void setColor(
const QColor &color,
bool emitSignals =
false );
121 virtual void setComponentValue(
int value );
146 int mExplicitHue = 0;
152 int componentRange()
const;
189 static const QPixmap &transparentBackground();
192 void dragEnterEvent( QDragEnterEvent *e )
override;
195 void dropEvent( QDropEvent *e )
override;
197 void mouseMoveEvent( QMouseEvent *e )
override;
198 void mousePressEvent( QMouseEvent *e )
override;
199 void mouseReleaseEvent( QMouseEvent *e )
override;
255 QMenu *mMenu =
nullptr;
259 bool mSuppressRecurse;
261 bool mDismissOnColorSelection;
273 void setColor(
const QColor &color );
299 QSize sizeHint()
const override;
300 void paintEvent( QPaintEvent *event )
override;
304 void setColor(
const QColor &color,
bool emitSignals =
false )
override;
308 void resizeEvent( QResizeEvent *event )
override;
309 void mouseMoveEvent( QMouseEvent *event )
override;
310 void mousePressEvent( QMouseEvent *event )
override;
311 void mouseReleaseEvent( QMouseEvent *event )
override;
322 bool mIsDragging =
false;
328 int mWheelThickness = 18;
331 ControlPart mClickedPart = QgsColorWheel::None;
337 QImage mTriangleImage;
343 bool mWheelDirty =
true;
346 bool mTriangleDirty =
true;
355 void createImages( QSizeF size );
361 void createTriangle();
367 void setColorFromPos( QPointF pos );
397 QSize sizeHint()
const override;
398 void paintEvent( QPaintEvent *event )
override;
403 void setColor(
const QColor &color,
bool emitSignals =
false )
override;
407 void resizeEvent( QResizeEvent *event )
override;
408 void mouseMoveEvent( QMouseEvent *event )
override;
409 void mousePressEvent( QMouseEvent *event )
override;
410 void mouseReleaseEvent( QMouseEvent *event )
override;
414 bool mIsDragging =
false;
420 QImage *mBoxImage =
nullptr;
434 int valueRangeX()
const;
440 int valueRangeY()
const;
450 int yComponentValue()
const;
460 int xComponentValue()
const;
466 void setColorFromPoint( QPoint point );
503 QSize sizeHint()
const override;
504 void paintEvent( QPaintEvent *event )
override;
511 void setOrientation( Orientation orientation );
525 void setInteriorMargin(
int margin );
539 void setShowFrame(
bool showFrame );
552 void setMarkerSize(
int markerSize );
564 void mouseMoveEvent( QMouseEvent *event )
override;
565 void wheelEvent( QWheelEvent *event )
override;
566 void mousePressEvent( QMouseEvent *event )
override;
567 void mouseReleaseEvent( QMouseEvent *event )
override;
568 void keyPressEvent( QKeyEvent *event )
override;
572 bool mIsDragging =
false;
581 bool mShowFrame =
false;
584 QPolygonF mTopTriangle;
587 QPolygonF mBottomTriangle;
593 void setColorFromPoint( QPointF point );
618 void setComponentValue(
int value )
override;
619 void setColor(
const QColor &color,
bool emitSignals =
false )
override;
627 QSpinBox *mSpinBox =
nullptr;
636 int convertRealToDisplay(
int realValue )
const;
644 int convertDisplayToReal(
int displayValue )
const;
651 void rampColorChanged(
const QColor &color );
656 void spinChanged(
int value );
661 void rampChanged(
int value );
689 Q_ENUM( ColorTextFormat )
697 void setColor(
const QColor &color,
bool emitSignals =
false )
override;
704 void setAllowOpacity(
bool allowOpacity );
707 void resizeEvent( QResizeEvent *event )
override;
711 QLineEdit *mLineEdit =
nullptr;
714 QToolButton *mMenuButton =
nullptr;
719 bool mAllowAlpha =
true;
758 void paintEvent( QPaintEvent *event )
override;
759 QSize sizeHint()
const override;
768 QColor
color2()
const {
return mColor2; }
779 virtual void setColor2(
const QColor &color );
784 void mousePressEvent( QMouseEvent *e )
override;
787 void mouseReleaseEvent( QMouseEvent *e )
override;
790 void mouseMoveEvent( QMouseEvent *e )
override;
797 QPoint mDragStartPosition;
804 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