当前位置:网站首页>QT console output in GUI applications- Console output in a Qt GUI app?
QT console output in GUI applications- Console output in a Qt GUI app?
2022-07-07 06:09:00 【Superior virtue and weak water】
problem :
I have a Qt GUI application running on Windows that allows command-line options to be passed and under some circumstances I want to output a message to the console and then quit, for example: I have one in Windows Running on Qt GUI Applications , It allows you to pass command line options , In some cases , I want to output a message to the console and exit , for example :
int main(int argc, char *argv[]){ QApplication a(argc, argv); if (someCommandLineParam) { std::cout << "Hello, world!"; return 0; } MainWindow w; w.show(); return a.exec();}
However, the console messages do not appear when I run the app from a command-prompt. however , When I run the application from the command prompt , Console messages will not appear .Does anyone know how I can get this to work? Who knows how I can make it work ?
Solution :
Reference resources : https://stackoom.com/en/question/E6EO边栏推荐
- 那些自损八百的甲方要求
- Swagger3 configuration
- Go language learning notes - Gorm use - native SQL, named parameters, rows, tosql | web framework gin (IX)
- Go语学习笔记 - gorm使用 - 原生sql、命名参数、Rows、ToSQL | Web框架Gin(九)
- 生活中的开销,怎么记账合适
- 3428. 放苹果
- Randomly generate session_ id
- 软件测试知识储备:关于「登录安全」的基础知识,你了解多少?
- PTA TIANTI game exercise set l2-003 moon cake test point 2, test point 3 Analysis
- [InstallShield] Introduction
猜你喜欢
Bbox regression loss function in target detection -l2, smooth L1, IOU, giou, Diou, ciou, focal eiou, alpha IOU, Siou
驱动开发中platform设备驱动架构详解
Financial risk control practice - decision tree rule mining template
ML之shap:基于adult人口普查收入二分类预测数据集(预测年收入是否超过50k)利用shap决策图结合LightGBM模型实现异常值检测案例之详细攻略
mac版php装xdebug环境(m1版)
Nvisual network visualization
Jmeter自带函数不够用?不如自己动手开发一个
数字IC面试总结(大厂面试经验分享)
Career experience feedback to novice programmers
JVM命令之 jstat:查看JVM統計信息
随机推荐
Say sqlyog deceived me!
SQL Server 2008 各种DateTime的取值范围
改变ui组件原有样式
Mac version PHP installed Xdebug environment (M1 version)
Dc-7 target
Check Point:企业部署零信任网络(ZTNA)的核心要素
MFC BMP sets the resolution of bitmap, DPI is 600 points, and gdiplus generates labels
从“跑分神器”到数据平台,鲁大师开启演进之路
JVM命令之 jstat:查看JVM统计信息
【日常训练--腾讯精选50】235. 二叉搜索树的最近公共祖先
搞懂fastjson 对泛型的反序列化原理
Web authentication API compatible version information
那些自损八百的甲方要求
Cf:c. column swapping [sort + simulate]
What is make makefile cmake qmake and what is the difference?
The boss always asks me about my progress. Don't you trust me? (what do you think)
The solution of a simple algebraic problem
数字IC面试总结(大厂面试经验分享)
解决pod install报错:ffi is an incompatible architecture
苹果cms V10模板/MXone Pro自适应影视电影网站模板