Important: Please read the Qt Code of Conduct -

Cannot see members of local variables during debug

  • I have created console Qt app to get http page.
    I have a problem with authorization and want to debug my app.
    I put breakpoint and run debugger.
    When it stops at breakpoint I can see only local variables in "Locals and Expressions" window
    but not there members.

    request QNetworkRequest
    d QSharedDataPointer<QNetworkRequestPrivate>
    this @0x7fff14d91400 HttpManager
    [QObject] QObject
    qnam @0x24b1d90 QNetworkAccessManager
    reply @0x403225 QNetworkReply
    url QUrl
    d @0x24b2c20 QUrlPrivate
    request QNetworkRequest
    Return Value

    The request variable must have Url member set
    and Authorization header of reaquest must have value also.

    What is wrong?

    I try to start Qt creator under root (gksu comand), but it didn't help.
    I have Qt5.0.2 on Ubuntu 12.04 LTS on VirtualBox under Windows7.

  • Hmm, did you simply try and dubble click the variable you need, and drag and drop in the "Locals and Expressions"?

  • Hi jeroentje,

    The variables are already in "Locals and examples" window.
    I simply click the arrows at the left of the variable to access it's members.
    But I don't see any members except, for example, "d 0x... QNetworkReply".

  • Moderators

    Do you have a debug build of Qt?

    Most classes in Qt have one member only (called d) which is a pointer to a private structure. This allows us to hide away implementation details of classes (we need to be binary compatible after all).

    One side effect of this is that the debugger will not find any information on the private structures in release builds and is thus unable to display anything for those.

Log in to reply