15 #ifndef QGSCOLORSWATCHGRID_H
16 #define QGSCOLORSWATCHGRID_H
20 #include <QWidgetAction>
45 virtual QSize minimumSizeHint()
const;
48 virtual QSize sizeHint()
const;
54 QString
context()
const {
return mContext; }
60 void setContext(
const QString context );
72 void setBaseColor(
const QColor baseColor );
90 void colorChanged(
const QColor color );
99 void paintEvent( QPaintEvent * event );
100 void mouseMoveEvent( QMouseEvent * event );
101 void mousePressEvent( QMouseEvent * event );
102 void mouseReleaseEvent( QMouseEvent * event );
103 void keyPressEvent( QKeyEvent* event );
104 void focusInEvent( QFocusEvent* event );
105 void focusOutEvent( QFocusEvent* event );
113 bool mDrawBoxDepressed;
114 int mCurrentHoverBox;
117 int mCurrentFocusBox;
121 bool mPressedOnWidget;
126 int calculateHeight()
const;
131 void draw( QPainter &painter );
137 int swatchForPosition(
const QPoint &position )
const;
142 void updateTooltip(
const int colorIdx );
147 const QPixmap &transparentBackground();
178 void setBaseColor(
const QColor baseColor );
184 QColor baseColor()
const;
190 QString context()
const;
196 void setContext(
const QString context );
202 void refreshColors();
209 void colorChanged(
const QColor color );
216 bool mSuppressRecurse;
222 void setColor(
const QColor &color );