summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2020-11-02 13:38:46 +0200
committerKatja Marttila <katja.marttila@qt.io>2020-11-03 12:26:52 +0200
commit640d18ce32f749b9aaab39c4877ac2543c1dcfe5 (patch)
tree8c78218b10608bc52244ff7721efb15ae764d9ed
parent9a7691eb7840395ed576b590eb6378023f030284 (diff)
Obey stylesheet in SettingsDialog
Change-Id: I3fa464acece6276a3c147d9b8585c7da100a3574 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
-rw-r--r--src/sdk/tabcontroller.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/sdk/tabcontroller.cpp b/src/sdk/tabcontroller.cpp
index b69c69b33..5e2f1ed13 100644
--- a/src/sdk/tabcontroller.cpp
+++ b/src/sdk/tabcontroller.cpp
@@ -166,6 +166,23 @@ void TabController::restartWizard()
void TabController::onSettingsButtonClicked()
{
SettingsDialog dialog(d->m_core);
+ // set custom stylesheet
+ const QString styleSheetFile = d->m_core->settings().styleSheet();
+ if (!styleSheetFile.isEmpty()) {
+ QFile sheet(styleSheetFile);
+ if (sheet.exists()) {
+ if (sheet.open(QIODevice::ReadOnly)) {
+ dialog.setStyleSheet(QString::fromLatin1(sheet.readAll()));
+ } else {
+ qCWarning(QInstaller::lcDeveloperBuild) << "The specified style sheet file "
+ "can not be opened.";
+ }
+ } else {
+ qCWarning(QInstaller::lcDeveloperBuild) << "A style sheet file is specified, "
+ "but it does not exist.";
+ }
+ }
+
connect(&dialog, &SettingsDialog::networkSettingsChanged,
this, &TabController::onNetworkSettingsChanged);
dialog.exec();