summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-05-20 13:28:56 +0800
committerwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-05-20 13:28:56 +0800
commitc445fd068dff1baa1f0a520d6947df93308ed39c (patch)
tree8649a0d492a308c66b57c3d39fc4a920e79b9500
parentea7649ee08a382c7a2a72351cfe6857bd1394493 (diff)
-rw-r--r--app/app.pro2
-rw-r--r--app/main.cpp11
2 files changed, 6 insertions, 7 deletions
diff --git a/app/app.pro b/app/app.pro
index d1e8274..bfa819e 100644
--- a/app/app.pro
+++ b/app/app.pro
@@ -5,7 +5,7 @@ HEADERS = PresetDataObject.h
SOURCES = main.cpp PresetDataObject.cpp
CONFIG += link_pkgconfig
-PKGCONFIG += libhomescreen qlibwindowmanager
+PKGCONFIG += qlibhomescreen qlibwindowmanager
RESOURCES += \
radio.qrc \
diff --git a/app/main.cpp b/app/main.cpp
index f555475..427a08c 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -24,7 +24,7 @@
#include <QtQml/QQmlContext>
#include <QtQuickControls2/QQuickStyle>
#include <QQuickWindow>
-#include <libhomescreen.hpp>
+#include <qlibhomescreen.h>
#include <qlibwindowmanager.h>
#include <stdlib.h>
#include "PresetDataObject.h"
@@ -91,7 +91,7 @@ int main(int argc, char *argv[])
context->setContextProperty(QStringLiteral("bindingAddress"), bindingAddress);
std::string token = secret.toStdString();
- LibHomeScreen* hs = new LibHomeScreen();
+ QLibHomeScreen* qhs = new QLibHomeScreen();
QLibWindowmanager* qwm = new QLibWindowmanager();
// WindowManager
@@ -111,9 +111,9 @@ int main(int argc, char *argv[])
});
// HomeScreen
- hs->init(port, token.c_str());
+ qhs->init(port, token.c_str());
// Set the event handler for Event_ShowWindow which will activate the surface for windowmanager
- hs->set_event_handler(LibHomeScreen::Event_ShowWindow, [qwm, &graphic_role](json_object *object){
+ qhs->set_event_handler(QLibHomeScreen::Event_ShowWindow, [qwm, &graphic_role](json_object *object){
qDebug("Surface %s got showWindow\n", graphic_role.toStdString().c_str());
qwm->activateWindow(graphic_role);
});
@@ -121,8 +121,7 @@ int main(int argc, char *argv[])
engine.load(QUrl(QStringLiteral("qrc:/Radio.qml")));
QObject *root = engine.rootObjects().first();
QQuickWindow *window = qobject_cast<QQuickWindow *>(root);
- QObject::connect(window, SIGNAL(frameSwapped()), qwm, SLOT(slotActivateWindow()
- ));
+ qhs->setQuickWindow(window);
}
return app.exec();
}