harbour-seaprint/src/harbour-seaprint.cpp

37 lines
1 KiB
C++
Raw Normal View History

2019-12-01 17:40:10 +03:00
#include <QtQuick>
#include <sailfishapp.h>
#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
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[])
{
QGuiApplication* app = SailfishApp::application(argc, argv);
app->setApplicationVersion(QStringLiteral(SEAPRINT_VERSION));
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");
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
}