A custom QGIS dialog for selecting a color.
More...
#include <qgscolordialog.h>
|
| QgsColorDialog (QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags, const QColor &color=QColor()) |
| Create a new color picker dialog. More...
|
|
QColor | color () const |
| Returns the current color for the dialog. More...
|
|
void | setAllowOpacity (bool allowOpacity) |
| Sets whether opacity modification (transparency) is permitted for the color dialog. More...
|
|
void | setTitle (const QString &title) |
| Sets the title for the color dialog. More...
|
|
|
static QColor | getColor (const QColor &initialColor, QWidget *parent, const QString &title=QString(), bool allowOpacity=false) |
| Returns a color selection from a color dialog. More...
|
|
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.
- Since
- QGIS 2.5
Definition at line 36 of file qgscolordialog.h.
◆ QgsColorDialog()
QgsColorDialog::QgsColorDialog |
( |
QWidget * |
parent = nullptr , |
|
|
Qt::WindowFlags |
fl = QgsGuiUtils::ModalDialogFlags , |
|
|
const QColor & |
color = QColor() |
|
) |
| |
Create a new color picker dialog.
- Parameters
-
parent | parent widget |
fl | window flags |
color | initial color for dialog |
Definition at line 30 of file qgscolordialog.cpp.
◆ closeEvent()
void QgsColorDialog::closeEvent |
( |
QCloseEvent * |
e | ) |
|
|
overrideprotected |
◆ color()
QColor QgsColorDialog::color |
( |
| ) |
const |
Returns the current color for the dialog.
- Returns
- dialog color
Definition at line 62 of file qgscolordialog.cpp.
◆ currentColorChanged
void QgsColorDialog::currentColorChanged |
( |
const QColor & |
color | ) |
|
|
signal |
Emitted when the dialog's color changes.
- Parameters
-
◆ getColor()
QColor QgsColorDialog::getColor |
( |
const QColor & |
initialColor, |
|
|
QWidget * |
parent, |
|
|
const QString & |
title = QString() , |
|
|
bool |
allowOpacity = false |
|
) |
| |
|
static |
Returns 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. |
allowOpacity | set to true to allow modification of color opacity value (transparency) |
- Returns
- Selected color on accepted() or initialColor on rejected().
Definition at line 78 of file qgscolordialog.cpp.
◆ setAllowOpacity()
void QgsColorDialog::setAllowOpacity |
( |
bool |
allowOpacity | ) |
|
Sets whether opacity modification (transparency) is permitted for the color dialog.
Defaults to true
.
- Parameters
-
allowOpacity | set to false to disable opacity modification |
- Since
- QGIS 3.0
Definition at line 72 of file qgscolordialog.cpp.
◆ setColor
void QgsColorDialog::setColor |
( |
const QColor & |
color | ) |
|
|
slot |
◆ setTitle()
void QgsColorDialog::setTitle |
( |
const QString & |
title | ) |
|
Sets the title for the color dialog.
- Parameters
-
title | title for dialog box |
Definition at line 67 of file qgscolordialog.cpp.
The documentation for this class was generated from the following files: