Totalview get the value of QString

落爺英雄遲暮 提交于 2020-01-02 10:34:04

问题


When I double clicked on QString object in totalview debugger this window appears. How can I get the exact value of it.

I have tried command.toUtf8().constData() but it prints Cannot find name "toUtf8".


回答1:


::TV::TTF::RTF::build_struct_transform { 
    name {^struct QString$} 
    members { 
       { ascii { $wstring_u16 cast { * { d -> unicode } } } } 
    } 
} 

::TV::TTF::RTF::build_struct_transform { 
    name {^struct QString$} 
    members { 
       { ascii { $wstring_u16 cast {* {d -> data} } } } 
    } 
}

Add this to $HOME/.tvdrc flie. First is for Qt3 and second for Qt4.




回答2:


For QT5 please add the following to the file $HOME/.tvdrc

::TV::TTF::RTF::build_struct_transform { 
    name {^class QString$}
    members { 
       { string { $wstring_s16 cast {{ * { d }} + 1  } } }     
    } 
}


来源:https://stackoverflow.com/questions/16959607/totalview-get-the-value-of-qstring

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!