Important: Please read the Qt Code of Conduct -

Expression evaluator to see a particular field of a struct?

  • can i enter an expression, as one can in Xcode, to view a particular field of a struct as the "value" of said struct?
    eg: if i have this lovely struct:

    0_1548962799938_Screen Shot 2019-01-31 at 11.26.26 AM.png

    and i just want "this" to show "this->i_description.i_uni.i_nameP", so that i do NOT have to drill down to it every time, just see the value (in red) right next to "this"?

    eg: in Xcode i can enter this expression


    and then see "Main Thread Queue" as expected. How do we do this in Qt?

  • does anyone have any ideas here?

  • Moderators

    It's not specific to Qt. It's specific to the debugger. You didn't say which debugger you're using and on which platform.
    With CDB on Windows at least you simply write this->i_description.i_uni.i_nameP just like in code with no special syntax.

  • i need a solution for both mac and windows (mac: xcode, windows: Visual Studio 2017)

    note i don't want to type that into the expressions window, or have to look in a different panel. i want to just see it in place next to "this" every time i run the debugger (as you can do with Xcode)

  • Moderators

    Sorry, I never had a mac in my hands so "like in XCode" doesn't tell me much. Do you have something like debugging helpers in mind?

Log in to reply