Debugging in Qt sources

Is it possible to go into Qt sources, for example. qmainwindow.cpp in Qt Creator? At the moment I see a showdown, but it would be nice to see the sources.

+4
source share
3 answers

Of course! But you may 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 until everything is built.
+2
source

Download Source Code .

Build an application with , including all the necessary files (e.g. qmainwindow.h, qmainwindow.cpp, ...). Launch the app. Step into the necessary files during debugging .. I have not tried this path, but this should work.

You must also include all the files you need. For example, a QMainWindow is inferred from a QWidget . QWidget is derived from QObject . So you need to enable qwidget.cpp, qwidget.h for QWidget and qobject.cpp, qobject.h for QObject. Similarly, you should include all the necessary files that may be required .

What you actually do, instead of linking the Qt libraries (* .dll and * .lib) includes the necessary files directly. All this.

Remember the Qt-related libraries, you will not be able to enter files that are all embedded in libraries . Thus, including the necessary files will help you.

Hope this helps.

0
source

You do not say what paltform is, but in windows you also need to tell Visual Studio where the sources are. See Options-> vs projects and directoriers-> source code

0
source

All Articles