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!
↧