Palette
#include <Palette.h>

Public Slots | |
void | addEntry (Swatch entry, QString groupName=QString()) |
void | addGroup (QString name) |
Q_DECL_DEPRECATED void | changeGroupName (QString oldGroupName, QString newGroupName) |
int | colorsCountGroup (QString name) |
int | colorsCountTotal () |
Q_DECL_DEPRECATED Swatch * | colorSetEntryByIndex (int index) |
Q_DECL_DEPRECATED Swatch * | colorSetEntryFromGroup (int index, const QString &groupName) |
int | columnCount () |
QString | comment () |
Swatch * | entryByIndex (int index) |
Swatch * | entryByIndexFromGroup (int index, const QString &groupName) |
QStringList | groupNames () const |
void | moveGroup (const QString &groupName, const QString &groupNameInsertBefore=QString()) |
int | numberOfEntries () const |
void | removeEntry (int index) |
void | removeEntryFromGroup (int index, const QString &groupName) |
void | removeGroup (QString name, bool keepColors=true) |
void | renameGroup (QString oldGroupName, QString newGroupName) |
int | rowCount () |
int | rowCountGroup (QString name) |
bool | save () |
void | setColumnCount (int columns) |
void | setComment (QString comment) |
void | setRowCountGroup (int rows, QString name) |
int | slotCount () |
int | slotCountGroup (QString name) |
Public Member Functions | |
Palette (Resource *resource, QObject *parent=0) | |
bool | operator!= (const Palette &other) const |
bool | operator== (const Palette &other) const |
![]() | |
QObject (QObject *parent) | |
QBindable< QString > | bindableObjectName () |
bool | blockSignals (bool block) |
const QObjectList & | children () const const |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectInfo () const const |
void | dumpObjectTree () const const |
QList< QByteArray > | dynamicPropertyNames () const const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (Qt::FindChildOptions options) const const |
bool | inherits (const char *className) const const |
void | installEventFilter (QObject *filterObj) |
bool | isQuickItemType () const const |
bool | isWidgetType () const const |
bool | isWindowType () const const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
QVariant | property (const char *name) const const |
Q_CLASSINFO (Name, Value) | |
Q_EMIT Q_EMIT | |
Q_ENUM (...) | |
Q_ENUM_NS (...) | |
Q_ENUMS (...) | |
Q_FLAG (...) | |
Q_FLAG_NS (...) | |
Q_FLAGS (...) | |
Q_GADGET Q_GADGET | |
Q_GADGET_EXPORT (EXPORT_MACRO) | |
Q_INTERFACES (...) | |
Q_INVOKABLE Q_INVOKABLE | |
Q_MOC_INCLUDE Q_MOC_INCLUDE | |
Q_NAMESPACE Q_NAMESPACE | |
Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
Q_OBJECT Q_OBJECT | |
Q_PROPERTY (...) | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
Q_SIGNAL Q_SIGNAL | |
Q_SIGNALS Q_SIGNALS | |
Q_SLOT Q_SLOT | |
Q_SLOTS Q_SLOTS | |
T | qobject_cast (const QObject *object) |
T | qobject_cast (QObject *object) |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setObjectName (QAnyStringView name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | setProperty (const char *name, QVariant &&value) |
bool | signalsBlocked () const const |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType) |
QThread * | thread () const const |
Additional Inherited Members | |
![]() | |
objectName | |
![]() | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
![]() | |
typedef | QObjectList |
![]() | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
Detailed Description
The Palette class Palette is a resource object that stores organised color data.
It's purpose is to allow artists to save colors and store them.
An example for printing all the palettes and the entries:
Constructor & Destructor Documentation
◆ Palette()
Definition at line 18 of file Palette.cpp.
◆ ~Palette()
|
override |
Definition at line 24 of file Palette.cpp.
Member Function Documentation
◆ addEntry
add a color entry to a group.
Color is appended to the end.
- Parameters
-
entry the entry groupName the name of the group to add to.
Definition at line 170 of file Palette.cpp.
◆ addGroup
|
slot |
Palette content can be organized in groups.
This method allows to add a new group in palette.
- Parameters
-
name The name of the new group to add.
Definition at line 99 of file Palette.cpp.
◆ changeGroupName
changeGroupName change the group name.
DEPRECATED: use renameGroup()
instead
- Parameters
-
oldGroupName the old groupname to change. newGroupName the new name to change it into.
- Returns
- whether successful. Reasons for failure include not knowing have oldGroupName
Definition at line 203 of file Palette.cpp.
◆ colorsCountGroup
|
slot |
colorsCountGroup
- Parameters
-
name of the group to check. Empty is the default group.
- Returns
- the amount of filled colors within that group.
Definition at line 117 of file Palette.cpp.
◆ colorsCountTotal
|
slot |
number of filled colors (swatches) in palette NOTE: same as numberOfEntries()
- Returns
- total number of colors
Definition at line 111 of file Palette.cpp.
◆ colorSetEntryByIndex
|
slot |
colorSetEntryByIndex get the colorsetEntry from the global index.
DEPRECATED: use entryByIndex()
instead
- Parameters
-
index the global index
- Returns
- the colorset entry
Definition at line 139 of file Palette.cpp.
◆ colorSetEntryFromGroup
colorSetEntryFromGroup
DEPRECATED: use entryByIndexFromGroup()
instead
- Parameters
-
index index in the group. groupName the name of the group to get the color from.
- Returns
- the colorsetentry.
Definition at line 155 of file Palette.cpp.
◆ columnCount
|
slot |
Palettes are defined in grids.
The number of column define grid width. The number of rows will depend of columns and total number of entries.
- Returns
- the number of columns this palette is set to use.
Definition at line 46 of file Palette.cpp.
◆ comment
|
slot |
the comment or description associated with the palette.
- Returns
- A string for which value contains the comment/description of palette.
Definition at line 81 of file Palette.cpp.
◆ entryByIndex
|
slot |
get color (swatch) from the global index.
- Parameters
-
index the global index
- Returns
- The Swatch color for given index.
Definition at line 145 of file Palette.cpp.
◆ entryByIndexFromGroup
get color (swatch) from the given group index.
- Parameters
-
index index in the group. groupName the name of the group to get the color from.
- Returns
- The Swatch color for given index within given group name.
Definition at line 161 of file Palette.cpp.
◆ groupNames
|
slot |
Palette content can be organized in groups.
- Returns
- The list of group names (list of string). This list follow the order the groups are defined in palette.
Definition at line 93 of file Palette.cpp.
◆ moveGroup
|
slot |
Move the group groupName
to position before group groupNameInsertBefore
.
- Parameters
-
groupName group to move. groupNameInsertBefore reference group for which groupName
have to be moved before.
Definition at line 214 of file Palette.cpp.
◆ numberOfEntries
|
slot |
number of filled colors (swatches) in palette NOTE: same as colorsCountTotal()
- Returns
- total number of colors
Definition at line 40 of file Palette.cpp.
◆ operator!=()
bool Palette::operator!= | ( | const Palette & | other | ) | const |
Definition at line 34 of file Palette.cpp.
◆ operator==()
bool Palette::operator== | ( | const Palette & | other | ) | const |
Definition at line 29 of file Palette.cpp.
◆ removeEntry
|
slot |
Remove the color entry at the given index in this palette.
- Parameters
-
index index in this palette.
Definition at line 175 of file Palette.cpp.
◆ removeEntryFromGroup
|
slot |
Remove the color entry at the given index in the given group.
- Parameters
-
index index in the group. groupName the name of the group to remove the entry from.
Definition at line 193 of file Palette.cpp.
◆ removeGroup
|
slot |
Palette content can be organized in groups.
This method allows to remove an existing group from palette.
- Parameters
-
name The name of the group to remove. keepColors whether or not to delete all the colors inside, or to move them to the default group.
Definition at line 105 of file Palette.cpp.
◆ renameGroup
rename a group
- Parameters
-
oldGroupName the old groupname to change. newGroupName the new name to change it into.
Definition at line 209 of file Palette.cpp.
◆ rowCount
|
slot |
The number of rows in the palette grid.
If the palette has groups, the row count is defined by the groups' row count. Otherwise, it's determined by the number of columns and entries.
- Returns
- the number of rows this palette has.
Definition at line 58 of file Palette.cpp.
◆ rowCountGroup
|
slot |
The number of rows defined in the given group.
- Parameters
-
name of the group to check.
- Returns
- the number of rows this group is set to use.
Definition at line 64 of file Palette.cpp.
◆ save
|
slot |
save the palette
WARNING: this method does nothing and need to be implemented!
- Returns
- always False
Definition at line 219 of file Palette.cpp.
◆ setColumnCount
|
slot |
Palettes are defined in grids.
The number of column define grid width, this value can be defined. The number of rows will depend of columns and total number of entries.
- Parameters
-
columns Set the amount of columns this palette should use.
Definition at line 52 of file Palette.cpp.
◆ setComment
|
slot |
the comment or description associated with the palette.
- Parameters
-
comment set the comment or description associated with the palette.
Definition at line 87 of file Palette.cpp.
◆ setRowCountGroup
|
slot |
Set the number of rows defined in the given group.
- Parameters
-
rows the amount of rows this group should use. name of the group to modify.
Definition at line 72 of file Palette.cpp.
◆ slotCount
|
slot |
number of slots for swatches in palette This includes any empty slots not filled by a color.
- Returns
- total number of slots
Definition at line 125 of file Palette.cpp.
◆ slotCountGroup
|
slot |
number of slots for swatches in group This includes any empty slots not filled by a color.
- Parameters
-
name of the group to check. Empty is the default group.
- Returns
- number of slots in group
Definition at line 131 of file Palette.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Apr 25 2025 12:04:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.