forked from qt-creator/qt-creator
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 <christian.stenger@qt.io>
This commit is contained in:
@@ -35,9 +35,11 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
||||||
|
namespace ManualTest {
|
||||||
|
|
||||||
static const char themeNameKey[] = "ThemeName";
|
static const char themeNameKey[] = "ThemeName";
|
||||||
|
|
||||||
static void setTheme(const QString &themeFile)
|
void ThemeSelector::setTheme(const QString &themeFile)
|
||||||
{
|
{
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
@@ -50,7 +52,7 @@ static void setTheme(const QString &themeFile)
|
|||||||
QApplication::setPalette(theme.palette());
|
QApplication::setPalette(theme.palette());
|
||||||
}
|
}
|
||||||
|
|
||||||
ManualTest::ThemeSelector::ThemeSelector(QWidget *parent)
|
ThemeSelector::ThemeSelector(QWidget *parent)
|
||||||
: QComboBox(parent)
|
: QComboBox(parent)
|
||||||
{
|
{
|
||||||
QCoreApplication::setOrganizationName("QtProject");
|
QCoreApplication::setOrganizationName("QtProject");
|
||||||
@@ -71,3 +73,5 @@ ManualTest::ThemeSelector::ThemeSelector(QWidget *parent)
|
|||||||
appSettings.setValue(themeNameKey, currentText());
|
appSettings.setValue(themeNameKey, currentText());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace ManualTest
|
||||||
|
@@ -32,6 +32,8 @@ namespace ManualTest {
|
|||||||
class ThemeSelector : public QComboBox {
|
class ThemeSelector : public QComboBox {
|
||||||
public:
|
public:
|
||||||
ThemeSelector(QWidget *parent = nullptr);
|
ThemeSelector(QWidget *parent = nullptr);
|
||||||
|
|
||||||
|
static void setTheme(const QString &themeFile);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace ManualTest
|
||||||
|
Reference in New Issue
Block a user