Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

How to set text to TextInput from C++

$
0
0
I have multiple QML files (for navigating through the application) I have created one TextInput Qml as a quantity.qml For the quantity field i want to sent the data from the weighing scale. When i send a signal from RS232, i am able to catch the signal in the CPP, but i am not able to set the data to my QML TextInput. Could anyone help me to set the value for field from the CPP I have tried below code, but its not working. QtQuick2ApplicationViewer viewer; viewer.setMainQmlFile(QStringLiteral("qml/quantity.qml"));   QObject *item = viewer.rootObject()->findChild<QObject*>("txtQty");  item->setProperty("text", serialPort->readData()); Thanks in advance

Viewing all articles
Browse latest Browse all 4972

Trending Articles