开发者

How do I print a variable value in QMessageBox?

开发者 https://www.devze.com 2023-04-02 20:48 出处:网络
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:

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

精彩评论

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

关注公众号