首页 > 解决方案 > 如何使用 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();
}

标签: c++qtuser-interface

解决方案


我建议先阅读 Qt Creator 文档:https ://doc.qt.io/qtcreator/creator-getting-started.html

Qt Creator 拥有大量可供使用的小部件,可让您按照您的要求进行操作。您可以使用“设计”选项卡以可视方式添加组件,也可以使用 QML 手动指定这些组件,例如https://doc.qt.io/qt-5/qml-qtquick-textinput.html


推荐阅读