1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #include <QGuiApplication>
- #include <QGuiApplication>
- #include <QQmlApplicationEngine>
- #include <QQmlContext>
- #include "addressbookengine.h"
- #include <contacts.h>
- #include <contact.h>
- #include <QMetaProperty>
- #include <QQmlPropertyMap>
- using namespace qtprotobuf::examples;
- int main(int argc, char *argv[])
- {
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- qmlRegisterType<ContactsListModel>("examples.addressbook", 1, 0, "ContactsListModel");
- QGuiApplication app(argc, argv);
- AddressBookEngine abEngine;
- QQmlApplicationEngine engine;
- engine.rootContext()->setContextProperty("abEngine", &abEngine);
- engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml")));
- if (engine.rootObjects().isEmpty())
- return -1;
- return app.exec();
- }
|