From 719467a4fb813756cc6da60de2d5859ec68e1327 Mon Sep 17 00:00:00 2001 From: wang_zhiqiang Date: Thu, 30 May 2019 13:48:44 +0800 Subject: change for als2019 --- app/main.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'app/main.cpp') diff --git a/app/main.cpp b/app/main.cpp index 0330858..2a57d08 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 TOYOTA MOTOR CORPORATION + * Copyright (c) 2017 TOYOTA MOTOR CORPORATION * Copyright (C) 2016 The Qt Company Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -29,7 +29,7 @@ #include #ifdef HAVE_LIBHOMESCREEN -#include +#include #endif #ifdef HAVE_QLIBWINDOWMANAGER #include @@ -96,18 +96,21 @@ int main(int argc, char *argv[]) #ifdef HAVE_LIBHOMESCREEN // HomeScreen - LibHomeScreen* hs = new LibHomeScreen(); + QLibHomeScreen* qhs = new QLibHomeScreen(); std::string token = secret.toStdString(); - hs->init(port, token.c_str()); + qhs->init(port, token.c_str()); // Set the event handler for Event_TapShortcut which will activate the surface for windowmanager - hs->set_event_handler(LibHomeScreen::Event_TapShortcut, [qwm, myname](json_object *object){ - qwm->activateSurface(myname, "split.main"); + qhs->set_event_handler(QLibHomeScreen::Event_ShowWindow, [qwm, myname](json_object *object){ + qwm->activateWindow(myname); }); #endif engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); QObject *root = engine.rootObjects().first(); QQuickWindow *window = qobject_cast(root); +#ifdef HAVE_LIBHOMESCREEN + qhs->setQuickWindow(window); +#endif #ifdef HAVE_QLIBWINDOWMANAGER // QObject::connect(window, SIGNAL(frameSwapped()), qwm, SLOT(slotActivateSurface())); -- cgit 1.2.3-korg