Skip to content

Commit

Permalink
fix: separate function def and impl to solve build conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhongYic00 committed Jun 10, 2022
1 parent 8d5bc9f commit be336fa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
14 changes: 14 additions & 0 deletions src/include/qtquickdtk.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include "qtquickdtk.h"
void importProperties(QQmlEngine* engine){
engine->rootContext()->setContextProperty("smallRadius",8);
engine->rootContext()->setContextProperty("bigRadius",18);

qWarning()<<"importProperties::registerType"<<qmlRegisterType<QMLDPalette>("QMLDPalette",1,0,"QMLDPalette");
qWarning()<<"importProperties::registerSingleton"<<qmlRegisterSingletonType(QUrl("qrc:/dtk/DPalette.qml"),"singleton.dpalette",1,0,"DPalette");
}

void enableQtQuickDTKStyle(QQmlEngine* engine){
QQuickStyle::addStylePath("qrc:/dtk");
importProperties(engine);
qWarning()<<"enableQtQuickDTKStyle:: styles"<<QQuickStyle::stylePathList()<<QQuickStyle::name();
}
13 changes: 2 additions & 11 deletions src/include/qtquickdtk.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@
#include "qmldpalette.h"

DWIDGET_USE_NAMESPACE
void importProperties(QQmlEngine* engine){
engine->rootContext()->setContextProperty("smallRadius",8);
engine->rootContext()->setContextProperty("bigRadius",18);

qmlRegisterType<QMLDPalette>("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

0 comments on commit be336fa

Please sign in to comment.