相关资料:
https://www.cnblogs.com/zhoug2020/p/10094855.html qt5信息提示框QMessageBox用法
https://blog.csdn.net/weixin_40314351/article/details/106061672 将QT标准对话框由英文显示为中文
https://blog.csdn.net/libaineu2004/article/details/19030129 如何修改Qt标准对话框的文字(例如,英文改成中文)
https://blog.csdn.net/weixin_37633951/article/details/114699654 vs+qt 突然无法生成ts文件解决方式
https://www.cnblogs.com/ppffs/p/3171565.html QMessageBox按钮简单实现中文显示
https://jingyan.baidu.com/article/0eb457e53cb69f03f0a90572.html 用Qt QMessageBox类创建带汉字按钮的消息框
https://download.csdn.net/download/zhujianqiangqq/21516136 代码包下载
.pro
1 QT += core gui 2 3 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 5 CONFIG += c++11 6 TRANSLATIONS += qt_en_cn.ts 7 8 # The following define makes your compiler emit warnings if you use 9 # any Qt feature that has been marked deprecated (the exact warnings 10 # depend on your compiler). Please consult the documentation of the 11 # deprecated API in order to know how to port your code away from it. 12 DEFINES += QT_DEPRECATED_WARNINGS 13 14 # You can also make your code fail to compile if it uses deprecated APIs. 15 # In order to do so, uncomment the following line. 16 # You can also select to disable deprecated APIs only up to a certain version of Qt. 17 #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 18 19 SOURCES += \ 20 main.cpp \ 21 mainwindow.cpp 22 23 HEADERS += \ 24 mainwindow.h 25 26 FORMS += \ 27 mainwindow.ui 28 29 #TRANSLATION += translation_simpleChinese.qm 30 #RANSLATIONS += qzher_en.ts 31 32 # Default rules for deployment. 33 qnx: target.path = /tmp/$${TARGET}/bin 34 else: unix:!android: target.path = /opt/$${TARGET}/bin 35 !isEmpty(target.path): INSTALLS += target 36 37 RESOURCES += \ 38 resources.qrc