c++ - 如何使用 Qt 库为 GUI 集成文本显示?
问题描述
这是我的 Qt GUI 应用程序的主文件。我想添加文字让用户猜测显示的单词,用户必须输入正确的单词。
这是我在控制台中测试的神秘词游戏的链接。
#include <QApplication>
#include <QtWidgets>
#include "mainWindow.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow Window;
Window.show();
return app.exec();
}
解决方案
我建议先阅读 Qt Creator 文档:https ://doc.qt.io/qtcreator/creator-getting-started.html
Qt Creator 拥有大量可供使用的小部件,可让您按照您的要求进行操作。您可以使用“设计”选项卡以可视方式添加组件,也可以使用 QML 手动指定这些组件,例如https://doc.qt.io/qt-5/qml-qtquick-textinput.html。
推荐阅读
- java - 数组中的最后一个对象替换所有其他对象
- java - 从命令行检查 Java 3rd 方库版本
- dask - 是否可以从本地计算机远程启动 hpc (slurm) 上的 dask 集群?
- ios - 如果应用被 iOS 13 杀死,VoIP 推送将停止传送到应用
- json - 如何减慢我的 json 调用之间的毫秒数?
- blazor - 如何在 Blazor 应用程序的 HTML 标记中引用 C# 变量?
- javascript - 如果满足条件,有什么方法可以为特定列表项添加边框?
- ios - Xamarin 表单视频缩略图:尝试在 IOS 13.1.3 设备上创建视频缩略图表单本地存储时出错
- unit-testing - 我能写什么,这样我就可以测试从我的账户中取钱
- javascript - 如何减少一小段代码的重复性?