Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Display mixed information on label
dekeenfrance last edited by
I would like to display on a label something like in C++ classic:
@cout << "Result = " << s << " Total number = " << tn; @
I know to display on label with @ui.label->setText(); @ but I don't know how to display a long message like above.
By the way, is there an easy way to display message on GUI in a similar-to-console style, for ex:
Only two line displayed at the same time: line 1 and 2, then line 2 and 3 (line 1 replaced by line 2, line 2 replaced by line 3). Could anyone please help me? Thanks!
QLabel label(QString("Result = %1 Total number = %2")
out << "Result = " << s << " Total number = " << tn;
To display the messages, you can use the class "QMessageBox":http://qt-project.org/doc/qt-5.0/qtwidgets/qmessagebox.html:
QMessageBox::information(0, "Title", "Message");