Qt Creator: how to debug and watch widget's properties?
I have a form and several widgets on it. Say, I have the following code and breakpoint on this line:
ui->labTitle->setMinimumHeight(64);
And I would like to know which height the labTitle has now. Where and how??? If I try 开发者_运维技巧to add ui->labTitle into watches list it says it doesn't know what is it. Maybe I need to adjust some debug settings but I don't know what exactly. Thanks
ui->labTitle
is actually this->ui->labTitle
, so it's only valid when being in a context where this
pointer is valid and points to the your main window. Adding to the watches should work, but don't forget the parantheses:
this->ui->labTitle->minimumHeight()
One thing you can check is to make sure your .pro
file contains a config setting that specifies "debug" like this:
CONFIG += debug
精彩评论