Totalview获得QString的值

时间:2013-06-06 10:21:33

标签: c++ debugging qstring totalview

enter image description here

当我在totalview调试器中双击QString对象时,会出现此窗口。我怎样才能得到它的确切值。

我已尝试command.toUtf8().constData(),但会打印Cannot find name "toUtf8"

2 个答案:

答案 0 :(得分:2)

::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} } } } 
    } 
}

将此添加到$HOME/.tvdrc文件。第一个是Qt3,第二个是Qt4

答案 1 :(得分:0)

对于QT5,请将以下内容添加到文件$HOME/.tvdrc

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