QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
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 );
130 void colorChanged(
const QColor &color );
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;
255 void colorChanged(
const QColor &color );
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;
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;
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 );
566 void valueChanged(
int value );
571 void wheelEvent( QWheelEvent *event )
override;
574 void keyPressEvent( QKeyEvent *event )
override;
578 bool mIsDragging =
false;
581 Orientation mOrientation;
587 bool mShowFrame =
false;
590 QPolygonF mTopTriangle;
593 QPolygonF mBottomTriangle;
599 void setColorFromPoint( QPointF point );
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;
708 void resizeEvent( QResizeEvent *event )
override;
712 QLineEdit *mLineEdit =
nullptr;
715 QToolButton *mMenuButton =
nullptr;
758 void paintEvent( QPaintEvent *event )
override;
759 QSize sizeHint()
const override;
768 QColor
color2()
const {
return mColor2; }
779 virtual void setColor2(
const QColor &color );
797 QPoint mDragStartPosition;
804 void drawColor(
const QColor &color, QRect rect, QPainter &painter );
807 #endif // #ifndef QGSCOLORWIDGETS_H
@ Rgb
Rgb( r, g, b ) format.
A color box widget. This widget consists of a two dimensional rectangle filled with color variations,...
@ HexRgb
#RRGGBB in hexadecimal
A color wheel widget. This widget consists of an outer ring which allows for hue selection,...
@ HexRgbA
#RRGGBBAA in hexadecimal, with alpha
ColorTextFormat
Specifies the display format for a color.
A line edit widget which displays colors as text and accepts string representations of colors.
QList< QPair< QRgb, int > > QgsColorBox