Utils: Allow named colors for theme's palette section

This change allows color definitions like

[Palette]
a=ffff0000
b=a

with some restrictions:
 - the name "style" results in QColor() (behavior change)
 - the named color must be alphabetical less than the key (due to
QSettings::allKeys())

Change-Id: Idaa8569ce1e5b8502d287fd42b0ee7b75dc8b5d6
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Lorenz Haas
2016-06-23 19:26:44 +02:00
committed by Alessandro Portale
parent 96d04570c8
commit 6015ed133a

View File

@@ -182,10 +182,8 @@ void Theme::readSettings(QSettings &settings)
} }
{ {
settings.beginGroup(QLatin1String("Palette")); settings.beginGroup(QLatin1String("Palette"));
foreach (const QString &key, settings.allKeys()) { foreach (const QString &key, settings.allKeys())
QColor c = readColor(settings.value(key).toString()); d->palette[key] = readNamedColor(settings.value(key).toString()).first;
d->palette[key] = c;
}
settings.endGroup(); settings.endGroup();
} }
{ {