当前位置:网站首页>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边栏推荐
- Interview skills of software testing
- SQL Server 2008 各种DateTime的取值范围
- Chain storage of stack
- Talking about reading excel with POI
- POI excel export, one of my template methods
- [cloud native] what is the microservice architecture?
- JVM monitoring and diagnostic tools - command line
- 测试开发基础,教你做一个完整功能的Web平台之环境准备
- [FPGA tutorial case 13] design and implementation of CIC filter based on vivado core
- 980. Different path III DFS
猜你喜欢
@pathvariable 和 @Requestparam的详细区别
Cf:c. column swapping [sort + simulate]
Go language learning notes - Gorm use - Gorm processing errors | web framework gin (10)
@Detailed differences between pathvariable and @requestparam
Interview skills of software testing
OpenSergo 即将发布 v1alpha1,丰富全链路异构架构的服务治理能力
Interview questions and salary and welfare of Shanghai byte
Red hat install kernel header file
JVM命令之 jstack:打印JVM中线程快照
404 not found service cannot be reached in SAP WebService test
随机推荐
牙齿干细胞的存储问题(未完待续)
Jinfo of JVM command: view and modify JVM configuration parameters in real time
A freshman's summary of an ordinary student [I don't know whether we are stupid or crazy, but I know to run forward all the way]
Interview skills of software testing
What EDA companies are there in China?
Nvisual network visualization
Jcmd of JVM command: multifunctional command line
深度聚类:将深度表示学习和聚类联合优化
SubGHz, LoRaWAN, NB-IoT, 物联网
关于STC单片机“假死”状态的判别
Randomly generate session_ id
搞懂fastjson 对泛型的反序列化原理
Dc-7 target
POI excel export, one of my template methods
为不同类型设备构建应用的三大更新 | 2022 I/O 重点回顾
Mac version PHP installed Xdebug environment (M1 version)
SQL Server 2008 各种DateTime的取值范围
3428. 放苹果
cf:C. Column Swapping【排序 + 模擬】
[FPGA tutorial case 14] design and implementation of FIR filter based on vivado core