开发者

How do I print a variable value in QMessageBox?

Do I need to use a 开发者_开发技巧QString first then put it in the msgbox? Are there any examples?


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.


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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜