May 10, 2011

nonot1 nonot1
Lab Rat
70 posts

Qt Creator: View (and debug into) Qt Sources?

 

Hello,

In the Qt SDK installer I’ve got the “Qt Sources” installed.

When using Qt Creator (With MinGW), how do I:

  1. Jump to the implementation of a given Qt supplied object or it’s methods? F2 only takes me to the header files. (Implementation details would be useful for virtual functions I’m supposed to re-implement)
  2. Step in to the Qt source files when debugging. Now, I only see the assembly code for any Qt library frames on the call stack.

Thank you

11 replies

May 12, 2011

sigrid sigrid
Lab Rat
144 posts

The problem is that the Qt sources are not provided with the Qt SDK. You can install the Qt 4.7.3 source package yourself though, build it and add it in Qt Creator. This way you should be able to debug the Qt sources.

May 12, 2011

Andre Andre
Area 51 Engineer
6031 posts

Huh? I installed the sources right from the SDK. You just have to select that you want them. In the tree of items to install, they can be found under Qt SDK -> Miscellaneous -> Qt Sources. I can choose to install versions 4.7.1 through 4.7.3. And yes, they are installed then.

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

May 12, 2011

sigrid sigrid
Lab Rat
144 posts

I see. nonot1: can you verify that you selected to install the sources?

May 13, 2011

Duck Duck
Lab Rat
107 posts

@Andre: Having the sources alone is not sufficient if the libraries are not directly build from it. At the very least you need to create an association from the location where the sources were at compile time to the place were the sources are installed. There’s an item in the debugger options, “General” settings.

May 16, 2011

nonot1 nonot1
Lab Rat
70 posts

I have not had a chance to play with this again yet. Was thinking of waiting until Qt Creator 2.2 final was released. (what is the schedule for that?)

May 18, 2011

sigrid sigrid
Lab Rat
144 posts

Qt Creator 2.2 final is already released, see:

http://labs.qt.nokia.com/2011/05/06/qt-creator-2-2-released/

May 18, 2011

Andre Andre
Area 51 Engineer
6031 posts

Any idea when we may expect an update for the SDK, so we can simply use the SDK updater feature to get the latest and greatest Qt Creator?

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

May 20, 2011

sigrid sigrid
Lab Rat
144 posts

There has not been set a date for this yet.

May 23, 2011

Eddy Eddy
Area 51 Engineer
1296 posts

Updating the sdk with Qt Creator 2.2 now.(just released this afternoon) i have Choosen custom instead of default and got the choises Andre was talking about. Thanks for the hint!

 Signature 

Qt Certified Specialist
Qt Ambassador

April 4, 2012

bmanc bmanc
Lab Rat
17 posts

I was having problems despite seeing the feature for the source. I am adding this in hopes that it will save others some time. I am using the QtSDK with QtCreator 2.4.1, and I have downloaded the source using the QtSDK package manger. The source is located in the default path (relative to the SDK root) C:\QtSDK\QtSources\4.8.0.

In the QtCreator options, under Debugger->General you need to click on “Add Qt sources…”. Then you need to select C:\QtSDK\QtSources\4.8.0. I was originally making the mistake of selecting C:\QtSDK\QtSources\4.8.0\src – which obviously was failing.

Once you OK out of the dialog you should be able to debug into the Qt source code in QtCreator.

May 8, 2012

p.kreker p.kreker
Lab Rat
9 posts

bmanc wrote:
I was having problems despite seeing the feature for the source. I am adding this in hopes that it will save others some time. I am using the QtSDK with QtCreator 2.4.1, and I have downloaded the source using the QtSDK package manger. The source is located in the default path (relative to the SDK root) C:\QtSDK\QtSources\4.8.0.

In the QtCreator options, under Debugger->General you need to click on “Add Qt sources…”. Then you need to select C:\QtSDK\QtSources\4.8.0. I was originally making the mistake of selecting C:\QtSDK\QtSources\4.8.0\src – which obviously was failing.

Once you OK out of the dialog you should be able to debug into the Qt source code in QtCreator.

Thank you for your solution. :)

 
  ‹‹ Qt debugger and pointers to arrays      [solved]How to break into C++ code? ››

You must log in to post a reply. Not a member yet? Register here!