17 #ifndef QGSCOLORDIALOG_H
18 #define QGSCOLORDIALOG_H
20 #include <QColorDialog>
22 #include "ui_qgscolordialog.h"
48 static QColor getLiveColor(
const QColor& initialColor, QObject* updateObject,
const char* updateSlot,
50 const QString& title =
"",
51 QColorDialog::ColorDialogOptions options = 0 );
75 const QColor& color = QColor() );
87 void setTitle(
const QString title );
93 void setAllowAlpha(
const bool allowAlpha );
105 static QColor getLiveColor(
const QColor& initialColor, QObject* updateObject,
const char* updateSlot,
107 const QString& title = QString(),
108 const bool allowAlpha =
true );
118 static QColor getColor(
const QColor &initialColor, QWidget *parent,
const QString &title = QString(),
119 const bool allowAlpha =
false );
126 void currentColorChanged(
const QColor &color );
133 void setColor(
const QColor &color );
137 void closeEvent( QCloseEvent* e )
override;
139 void mousePressEvent( QMouseEvent* e )
override;
141 void mouseMoveEvent( QMouseEvent *e )
override;
143 void mouseReleaseEvent( QMouseEvent *e )
override;
145 void keyPressEvent( QKeyEvent *e )
override;
149 void on_mHueRadio_toggled(
bool checked );
150 void on_mSaturationRadio_toggled(
bool checked );
151 void on_mValueRadio_toggled(
bool checked );
152 void on_mRedRadio_toggled(
bool checked );
153 void on_mGreenRadio_toggled(
bool checked );
154 void on_mBlueRadio_toggled(
bool checked );
156 void on_mButtonBox_accepted();
157 void on_mButtonBox_rejected();
158 void on_mButtonBox_clicked( QAbstractButton * button );
159 void on_mAddColorToSchemeButton_clicked();
163 void importPalette();
164 void removePalette();
167 void schemeIndexChanged(
int index );
168 void listSelectionChanged(
const QItemSelection &selected,
const QItemSelection &deselected );
170 void on_mAddCustomColorButton_clicked();
172 void on_mSampleButton_clicked();
173 void on_mTabWidget_currentChanged(
int index );
177 QColor mPreviousColor;
181 int mLastCustomColorIndex;
194 void stopPicking(
const QPoint& eventPos,
const bool takeSample =
true );
200 QColor averageColor(
const QImage &image )
const;
206 QColor sampleColor(
const QPoint &point )
const;
210 void refreshSchemeComboBox();
214 QString gplFilePath();
217 #endif // #ifndef QGSCOLORDIALOG_H