2022-12-06 12:15:15 +00:00
|
|
|
#include <QQmlEngine>
|
2023-11-09 11:21:56 +00:00
|
|
|
#include <QtQuickTest>
|
|
|
|
|
2024-10-11 15:14:21 +00:00
|
|
|
#include <StatusQ/typesregistration.h>
|
|
|
|
|
2022-12-06 12:15:15 +00:00
|
|
|
class Setup : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void qmlEngineAvailable(QQmlEngine *engine) {
|
|
|
|
// custom code that needs QQmlEngine, register QML types, add import paths,...
|
2024-05-28 17:39:41 +00:00
|
|
|
|
|
|
|
QGuiApplication::setOrganizationName(QStringLiteral("Status"));
|
|
|
|
QGuiApplication::setOrganizationDomain(QStringLiteral("status.im"));
|
|
|
|
|
2024-06-19 13:13:32 +00:00
|
|
|
qputenv("QT_QUICK_CONTROLS_HOVER_ENABLED", QByteArrayLiteral("1"));
|
|
|
|
|
2022-12-06 12:15:15 +00:00
|
|
|
const QStringList additionalImportPaths {
|
2023-04-14 08:18:56 +00:00
|
|
|
STATUSQ_MODULE_IMPORT_PATH,
|
2022-12-06 12:15:15 +00:00
|
|
|
QML_IMPORT_ROOT + QStringLiteral("/../ui/app"),
|
|
|
|
QML_IMPORT_ROOT + QStringLiteral("/../ui/imports"),
|
|
|
|
QML_IMPORT_ROOT + QStringLiteral("/stubs"),
|
2023-10-10 13:42:50 +00:00
|
|
|
QML_IMPORT_ROOT + QStringLiteral("/src")
|
2022-12-06 12:15:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
for (const auto& path : additionalImportPaths)
|
|
|
|
engine->addImportPath(path);
|
2022-12-13 16:18:02 +00:00
|
|
|
|
2024-10-11 15:14:21 +00:00
|
|
|
registerStatusQTypes();
|
|
|
|
|
2023-11-09 11:21:56 +00:00
|
|
|
QStandardPaths::setTestModeEnabled(true);
|
2024-01-04 12:05:54 +00:00
|
|
|
|
|
|
|
QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates));
|
2022-12-06 12:15:15 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
QUICK_TEST_MAIN_WITH_SETUP(QmlTests, Setup)
|
|
|
|
|
|
|
|
#include "main.moc"
|