An editable list of color swatches, taken from an associated QgsColorScheme.
More...
#include <qgscolorschemelist.h>
|
| void | addColor (const QColor &color, const QString &label=QString(), bool allowDuplicate=false) |
| | Adds a color to the list.
|
| |
| void | copyColors () |
| | Copies colors from the list to the clipboard.
|
| |
| void | pasteColors () |
| | Pastes colors from clipboard to the list.
|
| |
| void | removeSelection () |
| | Removes any selected colors from the list.
|
| |
| void | setScheme (QgsColorScheme *scheme, const QString &context=QString(), const QColor &baseColor=QColor()) |
| | Sets the color scheme to show in the list.
|
| |
| void | showExportColorsDialog () |
| | Displays a file picker dialog allowing users to export colors from the list into a file.
|
| |
| void | showImportColorsDialog () |
| | Displays a file picker dialog allowing users to import colors into the list from a file.
|
| |
|
| void | colorSelected (const QColor &color) |
| | Emitted when a color is selected from the list.
|
| |
|
| | QgsColorSchemeList (QWidget *parent=nullptr, QgsColorScheme *scheme=nullptr, const QString &context=QString(), const QColor &baseColor=QColor()) |
| | Construct a new color swatch grid.
|
| |
| bool | exportColorsToGpl (QFile &file) |
| | Export colors to a GPL palette file from the list.
|
| |
| bool | importColorsFromGpl (QFile &file) |
| | Import colors from a GPL palette file to the list.
|
| |
| bool | isDirty () const |
| | Returns whether the color scheme list has been modified.
|
| |
| bool | saveColorsToScheme () |
| | Saves the current colors shown in the list back to a color scheme, if supported by the color scheme.
|
| |
| QgsColorScheme * | scheme () |
| | Returns the scheme currently selected in the list.
|
| |
An editable list of color swatches, taken from an associated QgsColorScheme.
- See also
- QgsColorSchemeList
Definition at line 160 of file qgscolorschemelist.h.
◆ QgsColorSchemeList()
| QgsColorSchemeList::QgsColorSchemeList |
( |
QWidget * |
parent = nullptr, |
|
|
QgsColorScheme * |
scheme = nullptr, |
|
|
const QString & |
context = QString(), |
|
|
const QColor & |
baseColor = QColor() |
|
) |
| |
Construct a new color swatch grid.
- Parameters
-
| parent | parent widget |
| scheme | QgsColorScheme for colors to show in the list |
| context | context string provided to color scheme |
| baseColor | base color for color scheme |
Definition at line 35 of file qgscolorschemelist.cpp.
◆ addColor
| void QgsColorSchemeList::addColor |
( |
const QColor & |
color, |
|
|
const QString & |
label = QString(), |
|
|
bool |
allowDuplicate = false |
|
) |
| |
|
slot |
Adds a color to the list.
- Parameters
-
| color | color to add |
| label | optional label for color |
| allowDuplicate | set to true to allow duplicate colors to be added, ie colors which already exist in the list |
Definition at line 95 of file qgscolorschemelist.cpp.
◆ colorSelected
| void QgsColorSchemeList::colorSelected |
( |
const QColor & |
color | ) |
|
|
signal |
Emitted when a color is selected from the list.
- Parameters
-
◆ copyColors
| void QgsColorSchemeList::copyColors |
( |
| ) |
|
|
slot |
◆ exportColorsToGpl()
| bool QgsColorSchemeList::exportColorsToGpl |
( |
QFile & |
file | ) |
|
◆ importColorsFromGpl()
| bool QgsColorSchemeList::importColorsFromGpl |
( |
QFile & |
file | ) |
|
◆ isDirty()
| bool QgsColorSchemeList::isDirty |
( |
| ) |
const |
Returns whether the color scheme list has been modified.
- Returns
true if colors have been modified
Definition at line 287 of file qgscolorschemelist.cpp.
◆ keyPressEvent()
| void QgsColorSchemeList::keyPressEvent |
( |
QKeyEvent * |
event | ) |
|
|
overrideprotected |
◆ mousePressEvent()
| void QgsColorSchemeList::mousePressEvent |
( |
QMouseEvent * |
event | ) |
|
|
overrideprotected |
◆ mouseReleaseEvent()
| void QgsColorSchemeList::mouseReleaseEvent |
( |
QMouseEvent * |
event | ) |
|
|
overrideprotected |
◆ pasteColors
| void QgsColorSchemeList::pasteColors |
( |
| ) |
|
|
slot |
◆ removeSelection
| void QgsColorSchemeList::removeSelection |
( |
| ) |
|
|
slot |
◆ saveColorsToScheme()
| bool QgsColorSchemeList::saveColorsToScheme |
( |
| ) |
|
Saves the current colors shown in the list back to a color scheme, if supported by the color scheme.
- Note
- this method is only effective if the color scheme is editable
Definition at line 64 of file qgscolorschemelist.cpp.
◆ scheme()
◆ setScheme
| void QgsColorSchemeList::setScheme |
( |
QgsColorScheme * |
scheme, |
|
|
const QString & |
context = QString(), |
|
|
const QColor & |
baseColor = QColor() |
|
) |
| |
|
slot |
Sets the color scheme to show in the list.
- Parameters
-
| scheme | QgsColorScheme for colors to show in the list |
| context | context string provided to color scheme |
| baseColor | base color for color scheme |
- See also
- scheme()
Definition at line 58 of file qgscolorschemelist.cpp.
◆ showExportColorsDialog
| void QgsColorSchemeList::showExportColorsDialog |
( |
| ) |
|
|
slot |
◆ showImportColorsDialog
| void QgsColorSchemeList::showImportColorsDialog |
( |
| ) |
|
|
slot |
The documentation for this class was generated from the following files: