fejd
fejd

Reputation: 2565

Debug into Qt sources

Is it possible to step into Qt sources, e.g. qmainwindow.cpp, in Qt Creator? At the moment I'm seeing the disassembly, but it would be nice to see the sources instead.

Upvotes: 4

Views: 2214

Answers (3)

Martin Beckett
Martin Beckett

Reputation: 96109

You don't say what paltform, but on windows you also have to tell Visual Studio where the sources are. See options->vs projects and directoriers->source code

Upvotes: 0

liaK
liaK

Reputation: 11648

Download the Source code itself.

Create your application with including all the required files (for e.g qmainwindow.h,qmainwindow.cpp,...) directly. Run your application. Step into the desired files while debugging.. I haven't tried this way but this should work.

Also you have to include all the desired files. For e.g QMainWindow is derived from QWidget. QWidget is derived from QObject. So you need to include the qwidget.cpp, qwidget.h for QWidget and qobject.cpp, qobject.h for QObject. Similarly you have to include all the necessary files that might be required.

What you are actually doing is, instead of linking the Qt libraries (*.dll and *.lib), you are including the required files directly. That's all.

Remember with the Qt libraries linked, you will not able to step into the files that are all built into the libraries.. So, inclusion of the desired files will help you.

Hope it helps.

Upvotes: 0

ctd
ctd

Reputation: 1793

Of course! But you might have to first:

  • go to $QT_HOME/qt

  • run ./configure with the -debug or -debug-and-release flag (many other flags here)

  • run "make"

  • wait a couple of hours while things build

Upvotes: 2

Related Questions