2019-12-01 17:40:10 +03:00
|
|
|
#include <QtQuick>
|
|
|
|
|
|
|
|
#include <sailfishapp.h>
|
2019-12-20 00:59:56 +03:00
|
|
|
#include <seaprint_version.h>
|
2019-12-01 17:55:55 +03:00
|
|
|
#include <src/ippdiscovery.h>
|
|
|
|
#include <src/ippprinter.h>
|
2019-12-01 17:40:10 +03:00
|
|
|
|
2020-01-05 20:41:24 +03:00
|
|
|
static QObject* ippdiscovery_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
|
|
|
|
{
|
|
|
|
Q_UNUSED(engine)
|
|
|
|
Q_UNUSED(scriptEngine)
|
|
|
|
|
|
|
|
IppDiscovery *ippdiscovery = IppDiscovery::instance();
|
|
|
|
return ippdiscovery;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-12-01 17:40:10 +03:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2019-12-20 00:59:56 +03:00
|
|
|
QGuiApplication* app = SailfishApp::application(argc, argv);
|
|
|
|
|
|
|
|
app->setApplicationVersion(QStringLiteral(SEAPRINT_VERSION));
|
|
|
|
|
2020-01-05 20:41:24 +03:00
|
|
|
qmlRegisterSingletonType<IppDiscovery>("seaprint.ippdiscovery", 1, 0, "IppDiscovery", ippdiscovery_singletontype_provider);
|
2019-12-01 17:55:55 +03:00
|
|
|
qmlRegisterType<IppPrinter>("seaprint.ippprinter", 1, 0, "IppPrinter");
|
|
|
|
|
2020-01-05 20:41:24 +03:00
|
|
|
QQuickView* view = SailfishApp::createView();
|
|
|
|
|
|
|
|
view->engine()->addImportPath(SailfishApp::pathTo("qml/pages").toString());
|
|
|
|
view->engine()->addImageProvider(QLatin1String("ippdiscovery"), IppDiscovery::instance());
|
|
|
|
|
|
|
|
view->setSource(SailfishApp::pathToMainQml());
|
|
|
|
view->show();
|
|
|
|
return app->exec();
|
|
|
|
|
2019-12-01 17:40:10 +03:00
|
|
|
}
|