refactor(console): attach console early

also use RAII guard to free it instead of tracking it with a member variable

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
Rachel Powers 2025-12-12 20:11:04 -07:00
parent 35121f26fd
commit ffd50e318a
No known key found for this signature in database
GPG key ID: B4CB507E51F8B89C
10 changed files with 79 additions and 80 deletions

View file

@ -33,13 +33,23 @@
* limitations under the License.
*/
#include <iostream>
#include "Application.h"
#if defined Q_OS_WIN32
#include "console/WindowsConsole.h"
#endif
int main(int argc, char* argv[])
{
#if defined Q_OS_WIN32
// used on Windows to attach the standard IO streams
console::WindowsConsoleGuard _consoleGuard;
#endif
// initialize Qt
Application app(argc, argv);
switch (app.status()) {
case Application::StartingUp:
case Application::Initialized: {