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

How do I actually execute C++ code in Qt Quick?

$
0
0
Sorry in advance for being such a noob, but… I ragequit on google after searching this for a while :( I’ve made a function in c++ that looks like so: string convert(const string& userstr) {     buff = userstr.front();     resultstr = userstr;     resultstr.front() = '\b';     resultstr = resultstr + buff + "ay";     return resultstr; } What it’s supposed to do is take in a string (from QT’s text input) and manipulate it by moving its front letter to the back and adding “ay” (pig latin [dreamincode.net]) And I think (haven’t been able to test it yet) that this code should work. In QT I have textinput with the id: “uinput” and plain text with the id: “output”. And I want on mouse click (onClicked) to run the text from “uinput” through this function and spit out “resultstr” into “output”. This is how I tried to do it (in mousearea):         onClicked: {             output.text = convert.(uinput);         } but it just tells me I’ve got unexpected tokens, please point me in the right direction :)

Viewing all articles
Browse latest Browse all 4972

Trending Articles