Qt无法调试Qvector
Posted judes
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Qt无法调试Qvector相关的知识,希望对你有一定的参考价值。
现象:
解决:
打开文件 $(VSDIR)Common7PackagesDebuggerautoexp.dat (VSDIR是本机Visual Studio的安装目录)
把定义QVector和QMap显示内容的语句改成以下语句
;------------------------------------------------------------------------------ ; QVector, QStack ;------------------------------------------------------------------------------ QVector<*>|*::QVector<*>|QStack<*>|*::QStack<*>{ preview ( #if ($c.d->size <= 10) ( #( "[", $c.d->size, "](", #array ( expr: (($T1*)((char*)($c.d)+ $c.d->offset))[$i], size: $c.d->size ), ")" ) ) #else ( #( "[", $c.d->size, "](", #array ( expr: (($T1*)((char*)($c.d)+ $c.d->offset))[$i], size: $c.d->size ), ", ...)" ) ) ) children ( #array ( expr: (($T1*)((char*)($c.d)+ $c.d->offset))[$i], size: $c.d->size ) ) } ;------------------------------------------------------------------------------ ; QMap ;------------------------------------------------------------------------------ QMapNode<*,*>{ preview ( #( "(", $e.key, "; ", $e.value, ")" ) ) children ( #( key: $e.key, value: $e.value ) ) } QMap<*>{ children ( #( raw data: [$c,!], #tree ( head: &($e.d->header), size: $e.d->size, left: left, right: right, ) : ((QMapNode<$T1>*)&$e) ) ) preview ( #( "[", $e.d->size, "](", #tree ( head: &($e.d->header), size: $e.d->size, left: left, right: right, ) : ((QMapNode<$T1>*)&$e), ")" ) ) }
以上是关于Qt无法调试Qvector的主要内容,如果未能解决你的问题,请参考以下文章
Qt - 如何将 QVector<QString> 保存并加载到多个标签中?