Do I need to use a QString
first then put it in the msgbox? Are there any examples?
Asked
Active
Viewed 5,249 times
-3

Samuel Harmer
- 4,264
- 5
- 33
- 67

craftace
- 217
- 1
- 6
- 10
-
Does QString have formatting methods? You could use `sprintf` or `std::stringstream` and then pass that to `QString`. – Thomas Matthews Jan 18 '12 at 17:17
-
Reminder: Have you clicked the green check mark on all the answers you have accepted for the questions you asked? – Thomas Matthews Jan 18 '12 at 17:18
2 Answers
2
The QMessageBox documentation has examples in it:
QMessageBox msgBox;
msgBox.setText("Put your text here");
msgBox.exec();
There are a few others in there. Please read the docs.

Mat
- 202,337
- 40
- 393
- 406
0
you can use the folowing example and you can add as many as arguments you want.
int device_count=0;
QString status = QString("Found %1 device(s):").arg(device_count);
QMessageBox::information(this, tr("Info"), status);

xmaze
- 41
- 1
- 9