aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/inputpanelcontrols/tst_inputpanelcontrols.cpp
blob: 9211b1f299e5ff203adb51b9d18d10002ad0af75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#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(inputpanelcontrols)