QGIS API Documentation
2.8.2-Wien
|
A custom QGIS dialog for selecting a color. More...
#include <qgscolordialog.h>
Public Slots | |
void | setColor (const QColor &color) |
Sets the current color for the dialog. |
Signals | |
void | currentColorChanged (const QColor &color) |
Emitted when the dialog's color changes. |
Public Member Functions | |
QgsColorDialogV2 (QWidget *parent=0, Qt::WindowFlags fl=QgisGui::ModalDialogFlags, const QColor &color=QColor()) | |
Create a new color picker dialog. | |
~QgsColorDialogV2 () | |
QColor | color () const |
Returns the current color for the dialog. | |
void | setAllowAlpha (const bool allowAlpha) |
Sets whether alpha modification (transparency) is permitted for the color dialog. | |
void | setTitle (const QString title) |
Sets the title for the color dialog. |
Static Public Member Functions | |
static QColor | getColor (const QColor &initialColor, QWidget *parent, const QString &title=QString(), const bool allowAlpha=false) |
Return a color selection from a color dialog. | |
static QColor | getLiveColor (const QColor &initialColor, QObject *updateObject, const char *updateSlot, QWidget *parent=0, const QString &title=QString(), const bool allowAlpha=true) |
Return a color selection from a color dialog, with live updating of interim selections. |
Protected Member Functions | |
void | closeEvent (QCloseEvent *e) override |
void | keyPressEvent (QKeyEvent *e) override |
void | mouseMoveEvent (QMouseEvent *e) override |
void | mousePressEvent (QMouseEvent *e) override |
void | mouseReleaseEvent (QMouseEvent *e) override |
A custom QGIS dialog for selecting a color.
Has many improvements over the standard Qt color picker dialog, including hue wheel supports, color swatches, and a color sampler.
Definition at line 62 of file qgscolordialog.h.
QgsColorDialogV2::QgsColorDialogV2 | ( | QWidget * | parent = 0 , |
Qt::WindowFlags | fl = QgisGui::ModalDialogFlags , |
||
const QColor & | color = QColor() |
||
) |
Create a new color picker dialog.
parent | parent widget |
fl | window flags |
color | initial color for dialog |
Definition at line 69 of file qgscolordialog.cpp.
QgsColorDialogV2::~QgsColorDialogV2 | ( | ) |
Definition at line 276 of file qgscolordialog.cpp.
|
overrideprotected |
Definition at line 812 of file qgscolordialog.cpp.
QColor QgsColorDialogV2::color | ( | void | ) | const |
Returns the current color for the dialog.
Definition at line 281 of file qgscolordialog.cpp.
|
signal |
Emitted when the dialog's color changes.
color | current color |
|
static |
Return a color selection from a color dialog.
initialColor | the initial color of the selection dialog. |
parent | parent widget |
title | the title of the dialog. |
allowAlpha | set to true to allow modification of color alpha value (transparency) |
Definition at line 328 of file qgscolordialog.cpp.
|
static |
Return a color selection from a color dialog, with live updating of interim selections.
initialColor | the initial color of the selection dialog. |
updateObject | the receiver object of the live updating. |
updateSlot | the receiver object's slot for live updating (e.g. SLOT( setValidColor( const QColor& ) ) ). |
parent | parent widget |
title | the title of the dialog. |
allowAlpha | set to true to allow modification of color alpha value (transparency) |
Definition at line 305 of file qgscolordialog.cpp.
|
overrideprotected |
Definition at line 898 of file qgscolordialog.cpp.
|
overrideprotected |
Definition at line 869 of file qgscolordialog.cpp.
|
overrideprotected |
Definition at line 818 of file qgscolordialog.cpp.
|
overrideprotected |
Definition at line 885 of file qgscolordialog.cpp.
void QgsColorDialogV2::setAllowAlpha | ( | const bool | allowAlpha | ) |
Sets whether alpha modification (transparency) is permitted for the color dialog.
Defaults to true.
allowAlpha | set to false to disable alpha modification |
Definition at line 293 of file qgscolordialog.cpp.
|
slot |
Sets the current color for the dialog.
color | desired color |
Definition at line 785 of file qgscolordialog.cpp.
void QgsColorDialogV2::setTitle | ( | const QString | title | ) |
Sets the title for the color dialog.
title | title for dialog box |
Definition at line 288 of file qgscolordialog.cpp.