Make custom colors in QColorDialog permanent

[ChangeLog][QtWidgets][QColorDialog] Fixed long standing bug that prevented
custom colors in QColorDialog to be stored in the settings.

Task-number: QTBUG-58424
Change-Id: If3ee5eef75358d811f08e7ce52fb60622972ddd4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Kai Koehne 2017-01-26 14:26:39 +01:00
parent 1327526d8e
commit 52d9fd74b1

View File

@ -278,7 +278,7 @@ void QColorDialogStaticData::readSettings()
void QColorDialogStaticData::writeSettings() const
{
#ifndef QT_NO_SETTINGS
if (!customSet) {
if (customSet) {
QSettings settings(QSettings::UserScope, QStringLiteral("QtProject"));
for (int i = 0; i < int(CustomColorCount); ++i)
settings.setValue(QLatin1String("Qt/customColors/") + QString::number(i), customRgb[i]);