Merge remote-tracking branch 'origin/4.13' into master

Change-Id: Icfff925574d735f371dde4f554736865fb4af27f
This commit is contained in:
Eike Ziller
2020-08-17 09:26:45 +02:00
3 changed files with 18 additions and 2 deletions

View File

@@ -242,9 +242,24 @@ void Theme::readSettings(QSettings &settings)
}
}
// If you copy QPalette, default values stay at default, even if that default is different
// within the context of different widgets. Create deep copy.
static QPalette copyPalette(const QPalette &p)
{
QPalette res;
for (int group = 0; group < QPalette::NColorGroups; ++group) {
for (int role = 0; role < QPalette::NColorRoles; ++role) {
res.setBrush(QPalette::ColorGroup(group),
QPalette::ColorRole(role),
p.brush(QPalette::ColorGroup(group), QPalette::ColorRole(role)));
}
}
return res;
}
QPalette Theme::initialPalette()
{
static QPalette palette = QApplication::palette();
static QPalette palette = copyPalette(QApplication::palette());
return palette;
}

View File

@@ -68,7 +68,7 @@ public:
appendInitialBuildStep(Constants::MAKE_STEP_ID); // make
// ### Build Steps Clean ###
appendInitialBuildStep(Constants::MAKE_STEP_ID);
appendInitialCleanStep(Constants::MAKE_STEP_ID); // make clean
}
};

View File

@@ -766,6 +766,7 @@ IEditor *FormEditorData::createEditor()
m_fwm->closeAllPreviews();
QDesignerFormWindowInterface *form = m_fwm->createFormWindow(nullptr);
QTC_ASSERT(form, return nullptr);
form->setPalette(Theme::initialPalette());
QObject::connect(form, &QDesignerFormWindowInterface::toolChanged, [this] (int i) { toolChanged(i); });
auto widgetHost = new SharedTools::WidgetHost( /* parent */ nullptr, form);