ColorListEditor Class
The ColorListEditor is a dialog for managing and editing a list of colors. More...
| Header: | #include <ColorListEditor> |
Public Functions
| ColorListEditor(QWidget *parent = nullptr) | |
| QList<QColor> | colorList() const |
| QString | colorListAsString() |
| void | setColorList(const QList<QColor> &colors) |
| void | setColorListFromString(const QString &colorString) |
Static Public Members
| QString | convertColorListToString(const QList<QColor> &colors) |
| QList<QColor> | convertStringToColorList(const QString &colorString) |
Detailed Description
The ColorListEditor is a dialog for managing and editing a list of colors.
The ColorListEditor class provides a user interface for managing color lists. Users can add, remove, edit, and reorder colors through a graphical color picker. The selected colors are displayed as text with the color value as the text color.
Key features:
- Add new colors using a color picker dialog.
- Edit existing colors via double-click or using an "Edit" button.
- Reorder colors with "Up" and "Down" buttons.
- Remove selected colors from the list.
- Supports setting and getting the color list using QList<QColor> or a QString of semicolon-separated color names.
Member Function Documentation
ColorListEditor::ColorListEditor(QWidget *parent = nullptr)
Default constructs an instance of ColorListEditor.
QList<QColor> ColorListEditor::colorList() const
Returns the current color list as a QList<QColor>.
This function provides access to the current list of colors managed by the editor.
See also setColorList().
QString ColorListEditor::colorListAsString()
Returns the current color list as a QString of semicolon-separated color names.
This function converts the current list of colors into a semicolon-separated string of color names.
[static] QString ColorListEditor::convertColorListToString(const QList<QColor> &colors)
Converts a colors list into a semicolon-separated QString of color names.
This static function takes a list of colors and returns a QString of color names, separated by semicolons.
[static] QList<QColor> ColorListEditor::convertStringToColorList(const QString &colorString)
Converts a colorString of semicolon-separated color names into a QList<QColor>.
This static function parses a colorString of color names, separated by semicolons, and returns a QList<QColor>.
void ColorListEditor::setColorList(const QList<QColor> &colors)
Sets the internal color list from the provided QList<QColor>.
This function replaces the current color list with the given list of colors.
See also colorList().
void ColorListEditor::setColorListFromString(const QString &colorString)
Sets the color list from a colorString of semicolon-separated color names.
This function parses a colorString of semicolon-separated color names and updates the color list accordingly.
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.