C
SafeMessage QML Type
Provides a message interface for sending messages from QML runtime to QSR process. More...
Import Statement: | import Qt.SafeRenderer |
Methods
- void changeItemVisiblity(const QString&id, bool enable)
- void changeLayout(const QString&layoutId)
- void sendHeartBeat(const int timeout)
- void setText(const QString&itemId, const QString&text)
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 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.
void setText(const QString&itemId, const QString&text) |
Sets the text of the SateText item specified by itemId to text in the Qt Safe Renderer runtime.
Available under certain Qt licenses.
Find out more.