Allows the user to select a color via a dialog window.
More...
#include <ColorPicker.h>
Inherits AzQtComponents::LogicalTabOrderingWidget< StyledDialog >.
|
void | setSelectedColor (const AZ::Color &color) |
|
void | setCurrentColor (const AZ::Color &color) |
|
|
| ColorPicker (Configuration configuration, const QString &context=QString(), QWidget *parent=nullptr) |
|
AZ::Color | selectedColor () const |
| Returns the previously selected color in the dialog. It is updated to the current color when the OK button is pressed.
|
|
AZ::Color | currentColor () const |
| Returns the current color in the dialog. Updates in real time when the user changes settings in the dialog.
|
|
void | setComment (QString comment) |
| Sets a comment string that will be included in the UI as a custom message that may provide some context for the user.
|
|
void | setAlternateColorspaceEnabled (bool enabled) |
| Sets up some read-only output for displaying color values in an alternate color space.
|
|
void | setAlternateColorspaceName (const QString &name) |
|
void | setAlternateColorspaceValue (const AZ::Color &color) |
|
void | importPalettesFromFolder (const QString &path) |
| Populates the palette list with the palettes stored at the folder path provided.
|
|
| LogicalTabOrderingWidget (QWidget *parent=nullptr) |
|
bool | focusNextPrevChild (bool next) override |
|
void | markToRecalculateTabKeyOrdering () |
|
| StyledDialog (QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags()) |
|
void | enableSaveRestoreGeometry (const QString &key) |
|
bool | restoreGeometryFromSettings () |
|
|
static Config | loadConfig (QSettings &settings) |
|
static Config | defaultConfig () |
| Gets the default ColorPicker style configuration.
|
|
static AZ::Color | getColor (Configuration configuration, const AZ::Color &initial, const QString &title, const QString &context=QString(), const QStringList &palettePaths=QStringList(), QWidget *parent=nullptr) |
|
|
bool | eventFilter (QObject *o, QEvent *e) override |
|
void | hideEvent (QHideEvent *event) override |
|
void | done (int result) override |
|
void | contextMenuEvent (QContextMenuEvent *e) override |
|
|
AZ::Color | selectedColor |
| The previously selected color in the dialog. It is updated to the current color when the OK button is pressed.
|
|
AZ::Color | currentColor |
| The current color in the dialog. Updates in real time when the user changes settings in the dialog.
|
|
|
class | Style |
|
class | CurrentColorChangedCommand |
|
class | PaletteAddedCommand |
|
class | PaletteRemovedCommand |
|
Allows the user to select a color via a dialog window.
◆ Configuration
Available color configurations.
Enumerator |
---|
HueSaturation | Simplified mode for picking lighting related values.
|
◆ ColorPicker()
AzQtComponents::ColorPicker::ColorPicker |
( |
Configuration |
configuration, |
|
|
const QString & |
context = QString() , |
|
|
QWidget * |
parent = nullptr |
|
) |
| |
|
explicit |
Constructor for the ColorPicker class.
- Parameters
-
configuration | The color Configuration for the ColorPicker. |
context | Context name, used to store settings and window sizing. Leave empty to use the default context. |
parent | Pointer to the parent widget. |
◆ currentColorChanged
void AzQtComponents::ColorPicker::currentColorChanged |
( |
const AZ::Color & |
color | ) |
|
|
signal |
Triggered when the current color is changed.
- Parameters
-
color | The new current color. |
◆ getColor()
static AZ::Color AzQtComponents::ColorPicker::getColor |
( |
Configuration |
configuration, |
|
|
const AZ::Color & |
initial, |
|
|
const QString & |
title, |
|
|
const QString & |
context = QString() , |
|
|
const QStringList & |
palettePaths = QStringList() , |
|
|
QWidget * |
parent = nullptr |
|
) |
| |
|
static |
Utility function to quickly generate a ColorPicker dialog.
- Parameters
-
configuration | The color Configuration for the ColorPicker. |
initial | The color selected by default when the dialog is opened. |
title | The title of the dialog window. |
context | Context name, used to store settings and window sizing. Leave empty to use the default context. |
palettePaths | Paths to folders containing palette files. If not empty, all files in every folder will be loaded in the dialog alongside the default palette. |
parent | Pointer to the parent widget. |
- Returns
- The color selected by the user.
◆ loadConfig()
static Config AzQtComponents::ColorPicker::loadConfig |
( |
QSettings & |
settings | ) |
|
|
static |
Sets the ColorPicker style configuration.
- Parameters
-
settings | The settings object to load the configuration from. |
- Returns
- The new configuration of the ColorPicker.
◆ selectedColorChanged
void AzQtComponents::ColorPicker::selectedColorChanged |
( |
const AZ::Color & |
color | ) |
|
|
signal |
Triggered when the selected color is changed.
- Parameters
-
color | The new selected color. |
The documentation for this class was generated from the following file:
- Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/ColorPicker.h