From 356eaf1d3f365c71c8631e023fb72d534fdc9e26 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 19 May 2021 17:51:45 +0200 Subject: [PATCH] Manual widget tests: Expose setTheme function ...so that it can directly be called if showing the combobox is not wanted. Change-Id: Id80658336421788749f1a1ec68680fef53ae1695 Reviewed-by: Christian Stenger --- tests/manual/widgets/common/themeselector.cpp | 8 ++++++-- tests/manual/widgets/common/themeselector.h | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/manual/widgets/common/themeselector.cpp b/tests/manual/widgets/common/themeselector.cpp index bf1a5b3a026..809f64acc54 100644 --- a/tests/manual/widgets/common/themeselector.cpp +++ b/tests/manual/widgets/common/themeselector.cpp @@ -35,9 +35,11 @@ #include #include +namespace ManualTest { + static const char themeNameKey[] = "ThemeName"; -static void setTheme(const QString &themeFile) +void ThemeSelector::setTheme(const QString &themeFile) { using namespace Utils; @@ -50,7 +52,7 @@ static void setTheme(const QString &themeFile) QApplication::setPalette(theme.palette()); } -ManualTest::ThemeSelector::ThemeSelector(QWidget *parent) +ThemeSelector::ThemeSelector(QWidget *parent) : QComboBox(parent) { QCoreApplication::setOrganizationName("QtProject"); @@ -71,3 +73,5 @@ ManualTest::ThemeSelector::ThemeSelector(QWidget *parent) appSettings.setValue(themeNameKey, currentText()); }); } + +} // namespace ManualTest diff --git a/tests/manual/widgets/common/themeselector.h b/tests/manual/widgets/common/themeselector.h index 0989390373d..2a8375fa83f 100644 --- a/tests/manual/widgets/common/themeselector.h +++ b/tests/manual/widgets/common/themeselector.h @@ -32,6 +32,8 @@ namespace ManualTest { class ThemeSelector : public QComboBox { public: ThemeSelector(QWidget *parent = nullptr); + + static void setTheme(const QString &themeFile); }; -} +} // namespace ManualTest