diff options
Diffstat (limited to 'tests/auto/inputpanel/tst_inputpanel.cpp')
-rw-r--r-- | tests/auto/inputpanel/tst_inputpanel.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/inputpanel/tst_inputpanel.cpp b/tests/auto/inputpanel/tst_inputpanel.cpp index 8b84f67b..409383c7 100644 --- a/tests/auto/inputpanel/tst_inputpanel.cpp +++ b/tests/auto/inputpanel/tst_inputpanel.cpp @@ -29,7 +29,22 @@ #include <QtQuickTest/quicktest.h> #include <QByteArray> +#include <QStandardPaths> +#include <QFileInfo> +#include <QDir> static bool s_configEnv = qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard")); +static bool initStandardPaths() { + QStandardPaths::setTestModeEnabled(true); + auto configLocations = QStringList() + << QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + "/qtvirtualkeyboard" + << QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/qtvirtualkeyboard"; + for (const QString &configLocation : configLocations) { + if (configLocation != "/qtvirtualkeyboard") + QDir(configLocation).removeRecursively(); + } + return true; +} +static bool s_initStandardPaths = initStandardPaths(); QUICK_TEST_MAIN(inputpanel) |