Skip to content

How to create QML Widgets

Vova Shevchyk edited this page Jul 29, 2019 · 2 revisions

To create QML widgets that can be used by QSimpleScada just create property with name metaData and function update with value parameter.

property var metaData : ["from", "to", "value", "reverse", "fromAngle", "toAngle", "lineWidth", "fontSize", "knobBackgroundColor", "knobColor", "title", "titleFont", "titleFontSize", "titleFontColor"] metaData should hold all the properties you need to be used by QSimpleScada and saved in project files.

function update(value) { }

In update function parameter has QVariant type so you can send any kind of data. Update function is called every time you call update method in QScadaBoardController

Keep all qml files in one folder. Title of the folder will be used as QML components group name. To have automatic icons for tour components, load 200*200 pixels .png icons of your component to the same folder, with the same name + .png. All the qml and png files should be added to resources (.qrc file)

Clone this wiki locally