@Mamatha Hi @Mamatha, you have to give more information about the way you are updating the value on C++ side and how you access the value on QML side.
The standart/normal way to do is to define a property on C++ side, like this:
class MyObject: public QObject
{
Q_OBJECT
PROPERTY(QString myMessage GET getMyMessage NOTIFY myMessageChanged)
public
MyObject(QObject *parent = 0): QObject(parent), m_myMessage(QString()) {}
QString getMyMessage() const { return m_myMessage }
void updateMessage(const QString &message)
{
if(message != m_myMessage)
{
m_myMessage = message;
emit myMessageChanged(message);
}
}
public slots:
signals:
void myMessageChanged(const QString &message);
private:
QString m_myMessage;
};
Then on QML side, supposing you have exposed a variable called cppObject:
Label {
...
text: cppObject.myMessage
}
That's it!