-3

Do I need to use a QString first then put it in the msgbox? Are there any examples?

Samuel Harmer
  • 4,264
  • 5
  • 33
  • 67
craftace
  • 217
  • 1
  • 6
  • 10

2 Answers2

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