如何在QMessageBox中打印变量值
How do I print a variable value in QMessageBox?
我是否需要先使用QString
然后将其放在msgbox中?有什么例子吗?
QMessageBox文档中有示例:
QMessageBox msgBox;
msgBox.setText("Put your text here");
msgBox.exec();
还有一些人在那里。
您可以使用下面的示例,您可以添加任意数量的参数。
int device_count=0;
QString status = QString("Found %1 device(s):").arg(device_count);
QMessageBox::information(this, tr("Info"), status);
相关文章:
- 使用变量值作为 PlaySound 中的路径
- 通过指针偏移量访问结构变量值
- 变量值在 C++ 中的 glutIdleFunc() 中未递增
- 更新 #ifdef 中的现有变量值?
- 尝试更改 main 函数内的全局变量值时出现编译错误 C++.
- 通过 Rcpp 和 bit64 R 包将最大的int64_t变量值从 C++ 传递到 R
- 如何使用 IRBuilder 更新 LLVM IR 中的全局变量值?
- 更改已在运行的程序的变量值
- 在 Xcode 中使用后对外部变量值进行初始化
- C++整数变量值
- 变量值,在三元运算符之后
- 如何获得对不同类的引用,以便从所述类内部获得变量值
- Java应用程序的JNI-c++变量值
- 如何固定从传感器获得的变量值
- 打印具有通用特定变量值的类对象
- 我使用箭头运算符打印出对象的变量值,并得到一些随机值作为输出
- cout 不能一致地打印字符串和变量值,导致输出未对齐
- 如何通过wprintf函数打印uint32_t变量值
- C++ 成员变量值根据是否打印出来而变化
- 如何在QMessageBox中打印变量值