QT-在Qt Widgets Application中怎么显示printf的输出内容?
2023-09-14 08:57:11 时间
相关资料:
https://blog.csdn.net/bladeandmaster88/article/details/54748192
问题:
我们在新建一个“Qt Console Application”时使用printf输出字符是可以显在出来的,但是我们在新建一个"Qt Widgets Appliation"时因为没有了命令输出框,所以看不到输出,怎么才能显示出来命令输出框?
问题处理:
在pro文件中增加“CONFIG += console”,代码如下:
.pro
QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++11 CONFIG += console # The following define makes your compiler emit warnings if you use # any Qt feature that has been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ main.cpp \ mainwindow.cpp HEADERS += \ mainwindow.h FORMS += \ mainwindow.ui # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target
然后打开“Rin in terminal”,操作如图:
相关文章
- python qt是什么_初识Python与Qt「建议收藏」
- QT断点调试[通俗易懂]
- qt tabwidget切换_qtabwidget tab样式
- 猿如意中的【Qt Creator】工具详情介绍
- C/C++ Qt 数据库SqlRelationalTable关联表
- Windows设备信息获取:(摄像头,声卡为例)Qt,WindowsAPI对比说明(1)
- Qt官方示例-信号量
- 使用Qt提供的系统文件图标
- Qt官方示例-样式插件
- Qt Qml 开发超高清 4K、8K 视频直播视频客户端
- Qt程序的字符编码方式
- Linux安装Qt:实现轻松易用之旅(linux中安装qt)
- Linux下Qt实现串口编程探究(qtlinux串口编程)
- 开源世界:Linux、Qt、OSG 联合构建未来(linuxqtosg)
- 安装Linux系统,学习QT开发技术(linux安装qt教程)
- Qt 静态编译在 Linux 的实践(qt静态编译linux)
- Linux下构建Qt程序步骤(linux打开qt)
- Linux下的Qt开发编程实践(linux版qt)
- Qt公司正式成立
- Qt与Oracle数据库的高效结合(qt数据库oracle)
- 使用QT操作MySQL数据库(qt的mysql数据库)
- 在Linux上开发应用程序:Qt系列版本深入解析(linux版本qt)
- Adept Qt to Access Linux Commands(qt调用linux命令)
- QT快速加载MySQL驱动的简单操作(qt加载mysql驱动)
- 快速上手!QT在Linux下的发布指南(qtlinux下发布)
- Linux QT支持中文交互体验(linux qt 中文)
- 轻松实现QT直连Microsoft SQL Server(qt直连mssql)
- Qt如何编译Oracle数据库驱动(qt编译oracle驱动)