Refactoring too complicated native code between QML and new HMI framework

Description

Current implementation of native part (usually it is main.cpp) of AGL QML Application is too complicated and the design is neither a structured nor an object oriented program. And the design of API is too low level which depends tightly on libhomescreen/libwindowmanager implementation.

Therefore, it is extremely undesirable that this is officially released as a reference implementation.

So, I propose introduction of the following Qt (named QtAGLExtras) module.

  • Providing very simple interface

    • QtAGLExtras is able to absorb low level interface of libhomescreen/libwindowmanager.

    • The low level API of new HMI framework would be refactor at an early date after EE, but QtAGLExtras enable AGL QML Applications to migrate without any modification.

  • Removing dependencies of low level library (libhomescree/libwindowmanager etc)

    • It simplifies integration of AGL QML aaplication.

  • Providing high compatibility and scalability to Qt

    • QtAGLExtrans make native part of AGL QML application much simple. It also can support i18n inside it, so any modification is not necessary at main.cpp to enable it.

After QtAGLExtras come, main.cpp changes as follows.

Before

#include <QtGui/QGuiApplication> .... and 9 or more inclues #include <libhomescreen.hpp> #include <qlibwindowmanager.h> int main(int argc, char *argv[]) { QString myname = QString("MediaPlayer"); QGuiApplication app(argc, argv); QQuickStyle::setStyle("AGL"); QQmlApplicationEngine engine; ..... and 60 or more lines of code engine.load(QUrl(QStringLiteral("qrc:/MediaPlayer.qml"))); QObject *root = engine.rootObjects().first(); QQuickWindow *window = qobject_cast<QQuickWindow *>(root); QObject::connect(window, SIGNAL(frameSwapped()), qwm, SLOT(slotActivateSurface() )); } return app.exec(); }

After

#include <QtAGLExtras/AGLApplication> int main(int argc, char *argv[]) { AGLApplication app(argc, argv); app.setApplicationName("MediaPlayer"); app.setupApplicationRole("Music"); app.load(QUrl(QStringLiteral("qrc:/MediaPlayer.qml"))); return app.exec(); }

Environment

None
100% Done

Activity

knimitz 
January 16, 2018 at 2:53 PM

+1, thanks so much Tanikawa-san.

Stephane Desneux 
January 3, 2018 at 11:06 PM

+1

Jan-Simon Moeller 
January 3, 2018 at 9:45 PM

Please get it submitted then ASAP.

Jan-Simon Moeller 
January 3, 2018 at 9:45 PM

Ok, as additional/optional component this is ok.

Tadao Tanikawa 
January 3, 2018 at 4:13 PM

This doesn't affect anything to all existing QML applications in EE. This doesn't introduce any additonal features into EE. 

This is an additional reference / example implementation for AGL QML application in EE or newer. So I want to include this into EE.

IMHO, it is nightmare that current poor main.cpp would be release as the only reference implementation.

Fixed

Details

Assignee

Reporter

Fix versions

Labels

Components

Affects versions

Priority

Created January 2, 2018 at 7:18 AM
Updated January 17, 2018 at 3:24 PM
Resolved January 16, 2018 at 7:28 PM

Flag notifications