From be336fad41a0a72a38fdb57a0479730251b0ad59 Mon Sep 17 00:00:00 2001 From: zhongyic00 Date: Fri, 10 Jun 2022 23:11:26 +0800 Subject: [PATCH] fix: separate function def and impl to solve build conflicts --- src/include/qtquickdtk.cpp | 14 ++++++++++++++ src/include/qtquickdtk.h | 13 ++----------- 2 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 src/include/qtquickdtk.cpp diff --git a/src/include/qtquickdtk.cpp b/src/include/qtquickdtk.cpp new file mode 100644 index 0000000..7340d6f --- /dev/null +++ b/src/include/qtquickdtk.cpp @@ -0,0 +1,14 @@ +#include "qtquickdtk.h" +void importProperties(QQmlEngine* engine){ + engine->rootContext()->setContextProperty("smallRadius",8); + engine->rootContext()->setContextProperty("bigRadius",18); + + qWarning()<<"importProperties::registerType"<("QMLDPalette",1,0,"QMLDPalette"); + qWarning()<<"importProperties::registerSingleton"<rootContext()->setContextProperty("smallRadius",8); - engine->rootContext()->setContextProperty("bigRadius",18); - - qmlRegisterType("QMLDPalette",1,0,"QMLDPalette"); - qmlRegisterSingletonType(QUrl("qrc:/dtk/DPalette.qml"),"singleton.dpalette",1,0,"DPalette"); -} -void enableQtQuickDTKStyle(QQmlEngine* engine){ - QQuickStyle::addStylePath("qrc:/dtk"); - importProperties(engine); -} +void importProperties(QQmlEngine* engine); +void enableQtQuickDTKStyle(QQmlEngine* engine); #endif // QTQUICKDTK_H