QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
#include <qgscolordialog.h>
Public Slots | |
void | setColor (const QColor &color) |
Sets the current color for the dialog. More... | |
Signals | |
void | currentColorChanged (const QColor &color) |
Emitted when the dialog's color changes. More... | |
Public Member Functions | |
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 Public Member Functions | |
static QColor | getColor (const QColor &initialColor, QWidget *parent, const QString &title=QString(), bool allowOpacity=false) |
Returns a color selection from a color dialog. More... | |
Protected Member Functions | |
void | closeEvent (QCloseEvent *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 36 of file qgscolordialog.h.
QgsColorDialog::QgsColorDialog | ( | QWidget * | parent = nullptr , |
Qt::WindowFlags | fl = QgsGuiUtils::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 34 of file qgscolordialog.cpp.
|
overrideprotected |
Definition at line 154 of file qgscolordialog.cpp.
QColor QgsColorDialog::color | ( | ) | const |
Returns the current color for the dialog.
Definition at line 66 of file qgscolordialog.cpp.
|
signal |
Emitted when the dialog's color changes.
color | current color |
|
static |
Returns a color selection from a color dialog.
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) |
Definition at line 82 of file qgscolordialog.cpp.
void QgsColorDialog::setAllowOpacity | ( | bool | allowOpacity | ) |
Sets whether opacity modification (transparency) is permitted for the color dialog.
Defaults to true
.
allowOpacity | set to false to disable opacity modification |
Definition at line 76 of file qgscolordialog.cpp.
|
slot |
Sets the current color for the dialog.
color | desired color |
Definition at line 136 of file qgscolordialog.cpp.
void QgsColorDialog::setTitle | ( | const QString & | title | ) |
Sets the title for the color dialog.
title | title for dialog box |
Definition at line 71 of file qgscolordialog.cpp.