More clean up.

This commit is contained in:
Black Hat 2018-10-01 16:34:25 +08:00
parent 385135a658
commit 551e370410
5 changed files with 8 additions and 14 deletions

View File

@ -0,0 +1,3 @@
module Spectral.Font
singleton MaterialFont 0.1 MaterialFont.qml

View File

@ -0,0 +1,3 @@
module Spectral.Setting
singleton MSettings 0.1 Setting.qml

View File

@ -39,5 +39,7 @@
<file>assets/img/icon.png</file> <file>assets/img/icon.png</file>
<file>imports/Spectral/Setting/Setting.qml</file> <file>imports/Spectral/Setting/Setting.qml</file>
<file>imports/Spectral/Font/MaterialFont.qml</file> <file>imports/Spectral/Font/MaterialFont.qml</file>
<file>imports/Spectral/Font/qmldir</file>
<file>imports/Spectral/Setting/qmldir</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -3,9 +3,6 @@ CONFIG += c++14
CONFIG += object_parallel_to_source CONFIG += object_parallel_to_source
CONFIG += link_pkgconfig CONFIG += link_pkgconfig
# Enable this to use QtQuick Compiler.
#CONFIG += qtquickcompiler
TARGET = spectral TARGET = spectral
isEmpty(USE_SYSTEM_SORTFILTERPROXYMODEL) { isEmpty(USE_SYSTEM_SORTFILTERPROXYMODEL) {

View File

@ -48,25 +48,14 @@ int main(int argc, char *argv[]) {
"RoomMessageEvent", "ENUM"); "RoomMessageEvent", "ENUM");
qmlRegisterUncreatableType<RoomType>("Spectral", 0, 1, "RoomType", "ENUM"); qmlRegisterUncreatableType<RoomType>("Spectral", 0, 1, "RoomType", "ENUM");
qmlRegisterSingletonType(QUrl("qrc:/imports/Spectral/Setting/Setting.qml"),
"Spectral.Setting", 0, 1, "MSettings");
qmlRegisterSingletonType(
QUrl("qrc:/imports/Spectral/Font/MaterialFont.qml"), "Spectral.Font",
0, 1, "MaterialFont");
qmlRegisterModule("qrc:/qml/component", 2, 0);
QQmlApplicationEngine engine; QQmlApplicationEngine engine;
engine.addImportPath("qrc:/imports"); engine.addImportPath("qrc:/imports");
ImageProvider *m_provider = new ImageProvider(); ImageProvider *m_provider = new ImageProvider();
engine.rootContext()->setContextProperty("imageProvider", m_provider); engine.rootContext()->setContextProperty("imageProvider", m_provider);
engine.addImageProvider(QLatin1String("mxc"), m_provider); engine.addImageProvider(QLatin1String("mxc"), m_provider);
engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml"))); engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml")));
if (engine.rootObjects().isEmpty()) return -1; if (engine.rootObjects().isEmpty()) return -1;
return app.exec(); return app.exec();