SetText() doesn't work on a QString Variable but works on text in quotes. QT
hoomz last edited by
I'm trying to change the text of a QLabel like this:
Title is a QString. But that doesn't work. So I tested it by putting a word in quotes like:
And that works! I can't even fathom what this issue is. Any ideas? Thanks a million!
aliks-os last edited by
QLabel *m_label = new QLabel("New Label", this);
m_label->setText("very new label");
text = "super new label";
If you have not any error messages. please trace in the debug mode the value of your variable Title
clochydd last edited by
what's the symptom for not working? Any error message?
QLabel->setText() will work with a QString variable - try setting a new variable and test:
QString c = "Batman";
mohmo last edited by
Initialize Title just before setText like this:
is it working now?
review your code and check if "Title" has a Qstring value?