当前位置:网站首页>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边栏推荐
猜你喜欢

软件测试知识储备:关于「登录安全」的基础知识,你了解多少?

JVM监控及诊断工具-命令行篇

Apple CMS V10 template /mxone Pro adaptive film and television website template

Randomly generate session_ id

Jcmd of JVM command: multifunctional command line

3428. 放苹果

Web authentication API compatible version information

OpenSergo 即将发布 v1alpha1,丰富全链路异构架构的服务治理能力

PTA ladder game exercise set l2-004 search tree judgment

Red hat install kernel header file
随机推荐
linear regression
[FPGA tutorial case 14] design and implementation of FIR filter based on vivado core
Flask 1.1.4 werkzeug1.0.1 analyse du code source: processus de démarrage
[cloud native] what is the microservice architecture?
VScode进行代码补全
Cloud acceleration helps you effectively solve attack problems!
[shell] clean up nohup Out file
Flask1.1.4 werkzeug1.0.1 source code analysis: start the process
Bypass open_ basedir
Jstack of JVM command: print thread snapshots in JVM
Industrial Finance 3.0: financial technology of "dredging blood vessels"
laravel 使用腾讯云 COS5全教程
ML's shap: Based on the adult census income binary prediction data set (whether the predicted annual income exceeds 50K), use the shap decision diagram combined with the lightgbm model to realize the
成为资深IC设计工程师的十个阶段,现在的你在哪个阶段 ?
[InstallShield] Introduction
[daily training -- Tencent selected 50] 292 Nim games
Randomly generate session_ id
Storage of dental stem cells (to be continued)
JVM命令之 jinfo:实时查看和修改JVM配置参数
Interview skills of software testing