2022-06-08 11:30:04 +00:00
|
|
|
// Copyright (C) 2017 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2017-02-28 14:30:46 +00:00
|
|
|
|
|
|
|
#include <QGuiApplication>
|
2018-08-30 08:20:01 +00:00
|
|
|
#include <QLoggingCategory>
|
2017-02-28 14:30:46 +00:00
|
|
|
#include <QQmlApplicationEngine>
|
|
|
|
#include <QQmlContext>
|
|
|
|
|
|
|
|
#include "connectionhandler.h"
|
|
|
|
#include "devicefinder.h"
|
|
|
|
#include "devicehandler.h"
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2021-02-22 14:05:28 +00:00
|
|
|
// QLoggingCategory::setFilterRules(QStringLiteral("qt.bluetooth* = true"));
|
2017-02-28 14:30:46 +00:00
|
|
|
QGuiApplication app(argc, argv);
|
|
|
|
|
|
|
|
ConnectionHandler connectionHandler;
|
|
|
|
DeviceHandler deviceHandler;
|
|
|
|
DeviceFinder deviceFinder(&deviceHandler);
|
|
|
|
|
2017-03-15 12:19:46 +00:00
|
|
|
qmlRegisterUncreatableType<DeviceHandler>("Shared", 1, 0, "AddressType", "Enum is not a type");
|
|
|
|
|
2017-02-28 14:30:46 +00:00
|
|
|
QQmlApplicationEngine engine;
|
|
|
|
engine.rootContext()->setContextProperty("connectionHandler", &connectionHandler);
|
|
|
|
engine.rootContext()->setContextProperty("deviceFinder", &deviceFinder);
|
|
|
|
engine.rootContext()->setContextProperty("deviceHandler", &deviceHandler);
|
|
|
|
|
|
|
|
engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml")));
|
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
}
|