Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
UI and other classes
cp133 last edited by
In my mainwindow class, I have:
displayed is the string I'm drawing. I have another class, and in that other class I check if the string is valid, and if not,
Where main is an instance of the MainWindow.
Using qDebug, it is called fine, and in invalidString() I do:
displayed = "Error: Invalid string";
I then do
qDebug() << displayed;
It prints Error: Invalid string, as expected.
However, it continues to draw the previous text, and if I do qDebug displayed in a private slot, it still says the previous text.
Can anyone help me?
Sam last edited by
It will be really helpful if you can provide some lines of your code, as it we are not able to figure out the main problem related to your code. Also, check in the paintEvent() function whether the QString displayed is still set to the previous text even after main.invalidString() is called. After changing the text value of displayed u can call repaint() function if required.