1.概要
2.代码
#include <QApplication>
#include <QInputDialog>
#include <QDebug>
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
bool ok;
QString text = QInputDialog::getText(
nullptr,
"输入演示",
"请输入内容:",
QLineEdit::Normal,
"",
&ok
);
if (ok && !text.isEmpty()) {
qDebug() << "您输入的内容是:" << text;
}
return app.exec(); // 保持程序运行
}
3.运行结果

1185

被折叠的 条评论
为什么被折叠?



