Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Loading Qt Call Stack in Visual Studio?



  • I'm not sure what exactly to search for, so apologies if this has been covered. But I couldn't find any post covering this.

    If I run my Gui in QtCreator and it crashes, I can choose a debugger (Visual Studio being my only option). Visual Studio loads and the Call Stack is populated but the Language column all says "Unknown". Now I can choose the relevant .pdf by clicking on a line with a Qt Dll, let's say "Qt5Core.dll" and browse to my Qt folder to locate it. On my PC that's C:\Qt\5.9.2\msvc2017_64\bin. Doing this, some of the lines change and I can start to see references to classes, functions and line numbers.

    However, I'm then asked for the location of qobject.cpp, which is nowhere to be found on within my Qt installation.

    0_1528729636956_204b9c92-df75-4018-8b19-f7877357b578-image.png

    Interesting enough, there's a path in the screenshot at the top: c:\users\qt\work\qt\qtbase\src\corelib\kernel\qobject.cpp But this is doesn't exist on my PC. Is one/some of the file(s) containing hardcoded paths to the machine where the source code was built before the installation binary was created?

    I've got Qt 5.9.2 MSVC2017 64bit, on a Win 7 PC.


  • Moderators

    @chadw
    you also need to download the sources via the QtMaintainance tool
    The proposed path comes from the path while Qt was built


  • Moderators

    @chadw
    you also need to download the sources via the QtMaintainance tool
    The proposed path comes from the path while Qt was built



  • Ahh, that makes things a lot easier.

    Downloading the source for my version of QT, I could locate the above cpp file: C:\Qt\5.9.2\Src\qtbase\src\corelib\kernel

    Thank you!



  • PS. Couldn't mark your post as the correct answer, only my own. Could someone rectify that and mark @raven-worx's post as the correct solution?


  • Lifetime Qt Champion

    @chadw I think this is a bug in the forum software - you can only mark your own posts.

    Should hopefully work after the next update ;)


Log in to reply