最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

qt - QApplication in Visual Studio 2022 console not showing - Stack Overflow

programmeradmin1浏览0评论

I have a "console" application that depends on a lib which uses QPixmap. Therefore the application crashes if I initialize it with QCoreApplication. So instead I have to use QApplication to initialize the application. I don't even know if this causes my problem. In the Visual Studio 2022 Linker Settings I set the target system to "console" (/subsystem:console) The application starts and everything, but I wanted the console window to show up, so that I can display qInfo() information for the admin in the console. But for any unkown reason the console is'nt showing up. I only get the "Debugger-Console" inside Visual Studio but not the "execution" console.

Does anyone of you know what settings to change to get the console visible?

Using: VS2022 with Qt 6.4.2 x64

The lib (smh) uses QPixmap, for some reason the SmartServ-app will cause a runtime crash when initialized with QCoreApplication, but works fine when initializing with QApplication, just in case this might be reason for the strange behaviour.

I have a "console" application that depends on a lib which uses QPixmap. Therefore the application crashes if I initialize it with QCoreApplication. So instead I have to use QApplication to initialize the application. I don't even know if this causes my problem. In the Visual Studio 2022 Linker Settings I set the target system to "console" (/subsystem:console) The application starts and everything, but I wanted the console window to show up, so that I can display qInfo() information for the admin in the console. But for any unkown reason the console is'nt showing up. I only get the "Debugger-Console" inside Visual Studio but not the "execution" console.

Does anyone of you know what settings to change to get the console visible?

Using: VS2022 with Qt 6.4.2 x64

The lib (smh) uses QPixmap, for some reason the SmartServ-app will cause a runtime crash when initialized with QCoreApplication, but works fine when initializing with QApplication, just in case this might be reason for the strange behaviour.

Share Improve this question asked Nov 18, 2024 at 12:11 Der AchimDer Achim 907 bronze badges 1
  • If it's for QPixmap only, you can also use QGuiApplication, as you don't probably need the whole desktop related aspects of QApplication. – musicamante Commented Nov 18, 2024 at 17:28
Add a comment  | 

1 Answer 1

Reset to default 1

I found the solution. I was looking up the wrong project configuration. Setting to subsystem:console works just fine.

发布评论

评论列表(0)

  1. 暂无评论