Can we use the qml-webos-bridge plugin in the Built-in Native Apps


I'm following the guideline Developing Built-in Native Apps. But now, I want to render things using QML code rather than OpenGL.

The problem occurs when I try to get the system time using the following QML code:

Service {
    id: systemService
    appId: ""

    function getTime() {

    onResponse:"GETTIME", {"utc": JSON.parse(payload).utc})
    onError: pmLog.error("GETTIME", {"error": JSON.parse(payload)})

Here is the errors:

May 20 20:56:20 qemux86-64 nativeqt[1408]: [pmlog] NATIVE_QML_APP {} (null), Deprecated: the property Window.appId will become read-only. Use QGuiApplication.applicationName instead.

May 20 20:56:20 qemux86-64 nativeqt[1408]: [pmlog] NATIVE_QML_APP {} (null), Failed at LSRegister/LSRegisterApplicationService for, ERROR -1027: Invalid permissions for (_LSTransportRequestName @ transport.c:2038)

May 20 20:56:20 qemux86-64 nativeqt[1408]: [pmlog] NATIVE_QML_APP {} (null), Failed to initialize LunaServiceManager instance for appId: ""

Thank you,

Hi @cphong, welcome to the forum.

Could you check the validation of your codes using QML app?



Yes, I may utilize the qml-webos-bridge plugin if I make my project a built-in QML application. However, I'd like to develop certain elements in C++ rather than QML. Do you have any suggestions?

Thank you,


I think your main.cpp is not properly set.

You can use both C++ and QML in one project, but if you use them in one file it can occur errors. Choose Window and QGuiApplication depending on your main file (using the main.qml, you should use QGuiApplication).



I'm not sure what I did wrong in my code. I can load the main.qml file and display it properly.
However, the issues arise when I utilize the component Service provided by the qml-webos-bridge plugin.

If you don't mind, could you please review my source code?


#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <PmLog.h>

static PmLogContext getPmLogContext()
    static PmLogContext s_context = 0;
    if (s_context)
        PmLogGetContext("NativeQT", &s_context);
    return s_context;

static void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& message)
    switch (type)
        case QtDebugMsg:
            PmLogDebug(getPmLogContext(), "%s, %s", context.function, message.toUtf8().data());
        case QtWarningMsg:
            PmLogWarning(getPmLogContext(), "", 0, "%s, %s", context.function, message.toUtf8().data());
        case QtCriticalMsg:
            PmLogError(getPmLogContext(), "",  0, "%s, %s", context.function, message.toUtf8().data());
        case QtFatalMsg:
            PmLogCritical(getPmLogContext(), "",  0, "%s, %s", context.function, message.toUtf8().data());
            PmLogDebug(getPmLogContext(), "%s, %s", context.function, message.toUtf8().data());

int main(int argc, char** argv)

    QGuiApplication app(argc, argv);

    QQmlApplicationEngine engine;
    if (engine.rootObjects().isEmpty())
        return -1;

    return app.exec();


import QtQuick 2.4
import WebOSServices 1.0
import Eos.Window 0.1
import PmLog 1.0

WebOSWindow {
    id: root
    width: 1920
    height: 1080
    visible: true
    appId: ""
    title: "Native QT"
    color: "lightblue"

    Text {
        id: mainText
        anchors.centerIn: parent "Helvetica"
        font.pointSize: 50
        text: "Hello, Native QT Application!!"

    Service {
        id: systemService
        appId: ""

        function getTime() {
            call("luna://com.webos.service.systemservice", "/clock/getTime", "{}")

        onResponse: {
            var jsonObject = JSON.parse(payload);
  "GETTIME", {"utc": jsonObject.utc});
            mainText.text = "UTC : " + jsonObject.utc

        onError: {
            var jsonObject = JSON.parse(payload);
            pmLog.error("GETTIME", {"error": jsonObject});

    MouseArea {
        anchors.fill: parent
        onClicked: systemService.getTime()

    PmLog {
        id: pmLog
        context: "NativeQT"

TARGET = nativeqt

CONFIG += qt
QT += qml

CONFIG += link_pkgconfig

SOURCES += main.cpp

RESOURCES += qml.qrc


target.path = $${INSTALL_APPDIR}

icon.path = $${INSTALL_APPDIR}
icon.files = icon.png

appinfo.path = $${INSTALL_APPDIR}
appinfo.files = appinfo.json

INSTALLS += target icon appinfo


    "id": "",
    "version": "0.0.1",
    "vendor": "My Company",
    "type": "native",
    "main": "nativeqt",
    "title": "Native qt App",
    "icon": "icon.png",
    "requiredPermissions" : ["application.operation"],
    "nativeLifeCycleInterfaceVersion": 2

SUMMARY = "Native QT App"
SECTION = "webos/apps"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"

DEPENDS = "qtbase qt-features-webos qtdeclarative pmloglib"
RDEPENDS:${PN} += "qml-webos-framework qml-webos-bridge"

PR = "r0"

inherit webos_qmake6
inherit webos_submissions
inherit webos_app

FILES:${PN} += "${webos_applicationsdir}"

Sorry, this page does not allow me to attach the zip file.