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.
|
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 | setTitle (const QString title) |
| Sets the title for the color dialog.
|
void | setAllowAlpha (const bool allowAlpha) |
| Sets whether alpha modification (transparency) is permitted for the color dialog.
|
Static Public Member Functions |
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.
|
static QColor | getColor (const QColor &initialColor, QWidget *parent, const QString &title=QString(), const bool allowAlpha=false) |
| Return a color selection from a color dialog.
|
Detailed Description
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.
- Note
- Added in version 2.5
Constructor & Destructor Documentation
QgsColorDialogV2::QgsColorDialogV2 |
( |
QWidget * |
parent = 0 , |
|
|
Qt::WindowFlags |
fl = QgisGui::ModalDialogFlags , |
|
|
const QColor & |
color = QColor() |
|
) |
| |
Create a new color picker dialog.
- Parameters
-
parent | parent widget |
fl | window flags |
color | initial color for dialog |
QgsColorDialogV2::~QgsColorDialogV2 |
( |
| ) |
|
Member Function Documentation
void QgsColorDialogV2::closeEvent |
( |
QCloseEvent * |
e | ) |
|
|
protected |
QColor QgsColorDialogV2::color |
( |
void |
| ) |
const |
Returns the current color for the dialog.
- Returns
- dialog color
void QgsColorDialogV2::currentColorChanged |
( |
const QColor & |
color | ) |
|
|
signal |
Emitted when the dialog's color changes.
- Parameters
-
QColor QgsColorDialogV2::getColor |
( |
const QColor & |
initialColor, |
|
|
QWidget * |
parent, |
|
|
const QString & |
title = QString() , |
|
|
const bool |
allowAlpha = false |
|
) |
| |
|
static |
Return a color selection from a color dialog.
- Parameters
-
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) |
- Returns
- Selected color on accepted() or initialColor on rejected().
- See Also
- getLiveColor
QColor QgsColorDialogV2::getLiveColor |
( |
const QColor & |
initialColor, |
|
|
QObject * |
updateObject, |
|
|
const char * |
updateSlot, |
|
|
QWidget * |
parent = 0 , |
|
|
const QString & |
title = QString() , |
|
|
const bool |
allowAlpha = true |
|
) |
| |
|
static |
Return a color selection from a color dialog, with live updating of interim selections.
- Parameters
-
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) |
- Returns
- Selected color on accepted() or initialColor on rejected().
- See Also
- getColor
void QgsColorDialogV2::keyPressEvent |
( |
QKeyEvent * |
e | ) |
|
|
protected |
void QgsColorDialogV2::mouseMoveEvent |
( |
QMouseEvent * |
e | ) |
|
|
protected |
void QgsColorDialogV2::mousePressEvent |
( |
QMouseEvent * |
e | ) |
|
|
protected |
void QgsColorDialogV2::mouseReleaseEvent |
( |
QMouseEvent * |
e | ) |
|
|
protected |
void QgsColorDialogV2::setAllowAlpha |
( |
const bool |
allowAlpha | ) |
|
Sets whether alpha modification (transparency) is permitted for the color dialog.
Defaults to true.
- Parameters
-
allowAlpha | set to false to disable alpha modification |
void QgsColorDialogV2::setColor |
( |
const QColor |
color | ) |
|
|
slot |
Sets the current color for the dialog.
- Parameters
-
void QgsColorDialogV2::setTitle |
( |
const QString |
title | ) |
|
Sets the title for the color dialog.
- Parameters
-
title | title for dialog box |
The documentation for this class was generated from the following files: