Hello,

I'm developing a Qt windows application with a QMainWindow instance as the main window.

My question is: If I launch the application from the command prompt or PowerShell, is there a way to print information to that command prompt?

I'm adding support to execute Lua scripts, and I added a command line argument that if present, executes a script without displaying the QMainWindow. Something like:

> MyApp.exe

Opens MyApp with QMainWindow ui.

> MyApp.exe -s test.lua

Executes the Lua script.

This works, but if there are errors or print calls in the script, I'd like to be able to print them in the command prompt.

I have a parallel application that loads the same libraries as MyApp, and it works. Something like this:

> MyAppScript.exe test.lua

But for simplicity, I'd like to be able to execute and display these messages in MyApp.

I've read that with Qt it's possible to open the QMainApplication and a console window, but I'd rather keep the output in the command shell where the exe was called from.

Thank you!