16#ifndef QGSCOLORWIDGETS_H 
   17#define QGSCOLORWIDGETS_H 
   19#include <QWidgetAction> 
   75    Q_ENUM( ComponentUnit )
 
  116    float componentValueF() const;
 
  122    static QPixmap createDragIcon( const QColor &color );
 
  127    static ComponentUnit componentUnit( ColorComponent component );
 
  138    virtual 
void setColor( const QColor &color, 
bool emitSignals = false );
 
  145    virtual 
void setComponent( 
QgsColorWidget::ColorComponent component );
 
  157    Q_DECL_DEPRECATED virtual 
void setComponentValue( 
int value ) 
SIP_DEPRECATED;
 
  169    virtual 
void setComponentValueF( 
float value );
 
  177    void colorChanged( const QColor &color );
 
  185    QColor mCurrentColor;
 
  193    float mExplicitHue = 0;
 
  199    int componentRange() const;
 
  267    QColor::Spec colorSpec() const;
 
  278    static const QPixmap &transparentBackground();
 
  281    void dragEnterEvent( QDragEnterEvent *e ) override;
 
  284    void dropEvent( QDropEvent *e ) override;
 
  286    void mouseMoveEvent( QMouseEvent *e ) override;
 
  287    void mousePressEvent( QMouseEvent *e ) override;
 
  288    void mouseReleaseEvent( QMouseEvent *e ) override;
 
  290    friend class TestQgsCompoundColorWidget;
 
 
  345    QMenu *mMenu = 
nullptr;
 
  349    bool mSuppressRecurse;
 
  351    bool mDismissOnColorSelection;
 
  363    void setColor( 
const QColor &color );
 
 
  389    QSize sizeHint() 
const override;
 
  390    void paintEvent( QPaintEvent *event ) 
override;
 
  394    void setColor( 
const QColor &color, 
bool emitSignals = 
false ) 
override;
 
  397    void resizeEvent( QResizeEvent *event ) 
override;
 
  398    void mouseMoveEvent( QMouseEvent *event ) 
override;
 
  399    void mousePressEvent( QMouseEvent *event ) 
override;
 
  400    void mouseReleaseEvent( QMouseEvent *event ) 
override;
 
  410    bool mIsDragging = 
false;
 
  416    int mWheelThickness = 18;
 
  419    ControlPart mClickedPart = QgsColorWheel::None;
 
  425    QImage mTriangleImage;
 
  431    bool mWheelDirty = 
true;
 
  434    bool mTriangleDirty = 
true;
 
  443    void createImages( QSizeF size );
 
  449    void createTriangle();
 
  455    void setColorFromPos( QPointF pos );
 
 
  485    QSize sizeHint() 
const override;
 
  486    void paintEvent( QPaintEvent *event ) 
override;
 
  491    void setColor( 
const QColor &color, 
bool emitSignals = 
false ) 
override;
 
  494    void resizeEvent( QResizeEvent *event ) 
override;
 
  495    void mouseMoveEvent( QMouseEvent *event ) 
override;
 
  496    void mousePressEvent( QMouseEvent *event ) 
override;
 
  497    void mouseReleaseEvent( QMouseEvent *event ) 
override;
 
  500    bool mIsDragging = 
false;
 
  503    static constexpr float mMargin = 2.;
 
  506    QImage *mBoxImage = 
nullptr;
 
  520    float valueRangeX() 
const;
 
  526    float valueRangeY() 
const;
 
  536    float yComponentValue() 
const;
 
  546    float xComponentValue() 
const;
 
  552    void setColorFromPoint( QPoint point );
 
 
  587    QSize sizeHint() 
const override;
 
  588    void paintEvent( QPaintEvent *event ) 
override;
 
  595    void setOrientation( Orientation orientation );
 
  609    void setInteriorMargin( 
int margin );
 
  623    void setShowFrame( 
bool showFrame );
 
  636    void setMarkerSize( 
int markerSize );
 
  655    void mouseMoveEvent( QMouseEvent *event ) 
override;
 
  656    void wheelEvent( QWheelEvent *event ) 
override;
 
  657    void mousePressEvent( QMouseEvent *event ) 
override;
 
  658    void mouseReleaseEvent( QMouseEvent *event ) 
override;
 
  659    void keyPressEvent( QKeyEvent *event ) 
override;
 
  662    bool mIsDragging = 
false;
 
  671    bool mShowFrame = 
false;
 
  674    QPolygonF mTopTriangle;
 
  677    QPolygonF mBottomTriangle;
 
  683    void setColorFromPoint( QPointF point );
 
  685    friend class TestQgsCompoundColorWidget;
 
 
  708    void setComponentValueF( 
float value ) 
override;
 
  709    void setColor( 
const QColor &color, 
bool emitSignals = 
false ) 
override;
 
  725    float convertRealToDisplay( 
float realValue ) 
const;
 
  733    float convertDisplayToReal( 
float displayValue ) 
const;
 
  740    void rampColorChanged( 
const QColor &color );
 
  745    void spinChanged( 
double value );
 
  750    void rampChanged( 
float value );
 
  752    friend class TestQgsCompoundColorWidget;
 
 
  778    Q_ENUM( ColorTextFormat )
 
  786    void setColor( 
const QColor &color, 
bool emitSignals = 
false ) 
override;
 
  793    void setAllowOpacity( 
bool allowOpacity );
 
  796    void resizeEvent( QResizeEvent *event ) 
override;
 
  799    QLineEdit *mLineEdit = 
nullptr;
 
  802    QToolButton *mMenuButton = 
nullptr;
 
  807    bool mAllowAlpha = 
true;
 
 
  845    void paintEvent( QPaintEvent *event ) 
override;
 
  846    QSize sizeHint() 
const override;
 
  855    QColor 
color2()
 const { 
return mColor2; }
 
  866    virtual void setColor2( 
const QColor &color );
 
  870    void mousePressEvent( QMouseEvent *e ) 
override;
 
  873    void mouseReleaseEvent( QMouseEvent *e ) 
override;
 
  876    void mouseMoveEvent( QMouseEvent *e ) 
override;
 
  882    QPoint mDragStartPosition;
 
  889    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
 
The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value.