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

Calling QML functions from C++ [HELP!]

$
0
0
I need to send/insert string value to the qml TextArea conmponent, from c++. I decided to use qml function, which would recieve the string value and then insert it to the TextArea.insert(). But when i do it, my application suddenly closes… qml function code: function insertText(QString, msg) {       textArea.insert(msg); } C++ code: QString msg = "Hello from C++"; QMetaObject::invokeMethod(object, "insertText",         Q_ARG(QString, msg)); Final goal is to read file by c++ fstream library into QString and show it content on the application screen. Help me with solution!

Viewing all articles
Browse latest Browse all 4972

Trending Articles