More clean up.

square-messages
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>imports/Spectral/Setting/Setting.qml</file>
<file>imports/Spectral/Font/MaterialFont.qml</file>
<file>imports/Spectral/Font/qmldir</file>
<file>imports/Spectral/Setting/qmldir</file>
</qresource>
</RCC>

View File

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

View File

@ -48,25 +48,14 @@ int main(int argc, char *argv[]) {
"RoomMessageEvent", "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;
engine.addImportPath("qrc:/imports");
ImageProvider *m_provider = new ImageProvider();
engine.rootContext()->setContextProperty("imageProvider", m_provider);
engine.addImageProvider(QLatin1String("mxc"), m_provider);
engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml")));
if (engine.rootObjects().isEmpty()) return -1;
return app.exec();