C

SafeMessage QML Type

Provides a message interface for sending messages from QML runtime to QSR process. More...

Import Statement: import QtSafeRenderer 1.0

Methods

Detailed Description

Method Documentation

void changeItemVisiblity(const QString &id, bool enable)

Hide or show the items visibility in Qt Safe Renderer runtime. id is the QML Item's id. enable true shows the item, false hides the item.


void changeLayout(const QString &layoutId)

Change the layout in Qt Safe Renderer runtime. layoutId is the id of the layout. The layout id must be set accordingly in Qt Safe Renderer runtime.

You can send the changeLayout event from the Qt Quick runtime to the QSR as follows:

onStateChanged: {
    if (state == "sports")
        SafeMessage.changeLayout("sport")
    else
        SafeMessage.changeLayout("hybrid")
}

layoutId values must match with the layout ids in main.cpp in the Telltales example:

static QSafeLayoutResourceReader layoutHybrid("/qtcluster/layoutData/DashboardForm.ui.srl");
const quint32 layoutHybridID = qsafe_hash("hybrid", safe_strlen("hybrid"));
const quint32 layoutSportID = qsafe_hash("sport", safe_strlen("sport"));
layoutHybrid.setLayoutId(layoutHybridID);
static QSafeLayoutResourceReader layoutSport("/qtcluster/layoutData/DashboardSportForm.ui.srl");
layoutSport.setLayoutId(layoutSportID);

void moveItem(const QString &itemId, const QPointF &pos)

Change the item position in Qt Safe Renderer runtime. id is the QML Item's id. pos the new position.


void sendHeartBeat(const int timeout)

Sends a heartbeat message to the Qt Safe Renderer process. timeout is the value Qt Safe Renderer process shall wait for next heartbeat message.


Available under certain Qt licenses.
Find out more.