Uploaded image for project: ' AGL Development'
  1. AGL Development
  2. SPEC-1229

Refactoring too complicated native code between QML and new HMI framework

XMLWordPrintable

      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();
      }
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            ruke47 Tadao Tanikawa
            ruke47 Tadao Tanikawa
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: