fix(Storybook): Register StatusQ types for Storybook/qmlTests

Closes: #9690
This commit is contained in:
Michał Cieślak 2023-03-01 13:46:56 +01:00 committed by Michał
parent a0170a3fda
commit 95d29c76f9
2 changed files with 5 additions and 1 deletions

View File

@ -87,7 +87,7 @@ add_executable(QmlTests
target_compile_definitions(QmlTests
PRIVATE QML_IMPORT_ROOT="${CMAKE_CURRENT_LIST_DIR}"
PRIVATE -DQUICK_TEST_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}/qmlTests")
target_link_libraries(QmlTests PRIVATE Qt5::QuickTest Qt5::Qml)
target_link_libraries(QmlTests PRIVATE Qt5::QuickTest Qt5::Qml ${PROJECT_LIB})
add_test(NAME QmlTests COMMAND QmlTests)
list(APPEND QML_DIRS "${CMAKE_SOURCE_DIR}/../ui/StatusQ/src")

View File

@ -2,6 +2,8 @@
#include <QQmlEngine>
#include "src/TextUtils.h"
#include "StatusQ/typesregistration.h"
class Setup : public QObject
{
Q_OBJECT
@ -21,6 +23,8 @@ public slots:
engine->addImportPath(path);
qmlRegisterSingletonType<TextUtils>("TextUtils", 1, 0, "TextUtils", &TextUtils::qmlInstance);
registerStatusQTypes();
}
};