Ejemplo n.º 1
0
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    QtQuick2ApplicationViewer viewer;

    viewer.addImportPath(QStringLiteral("plugins"));

    viewer.setMainQmlFile(QStringLiteral("qml/Bananas/main.qml"));
    viewer.showExpanded();

    return app.exec();
}
Ejemplo n.º 2
0
int main(int argc, char *argv[]) {
	QGuiApplication app(argc, argv);

	Utility::registerTypes();
	qmlRegisterType<BarcodeObject>("KoboMan", 1, 0, "Barcode");
	qmlRegisterType<BarcodeScanner>("KoboMan", 1, 0, "BarcodeScanner");

	QtQuick2ApplicationViewer viewer;
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
	viewer.addImportPath(QStringLiteral("assets:/imports"));
#else
	viewer.addImportPath(QStringLiteral("imports"));
#endif
	qDebug() << viewer.engine()->importPathList();
	Utility::initialize(&viewer);
	Theme::initialize(Theme::androidHoloLight());
	BookListModel bookList;
	viewer.rootContext()->setContextProperty("BookList", &bookList);
	viewer.rootContext()->setContextProperty("Library", &Library::get());
	viewer.setMainQmlFile(QStringLiteral("qml/koboman/main.qml"));
	viewer.showExpanded();
	return app.exec();
}