Unfortunately to the rest of you, the explanations are in russian, so you must try harder I guess ;). OK, don't despair, spending my childhood in a communist country finaly pays out ;) - here comes a short explanation how to create and install the visualizer. 1. Take this code and save it as (for example) qt4and5.natvis :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | <? xml version = "1.0" encoding = "utf-8" ?> <!-- Qt 4 --> < Type Name = "QString" > < DisplayString >{d->data,su}</ DisplayString > < StringView >d->data,su</ StringView > < Expand > < Item Name = "[size]" >d->size</ Item > < Item Name = "[referenced]" >d->ref._q_value</ Item > < ArrayItems > < Size >d->size</ Size > < ValuePointer >d->data,c</ ValuePointer > </ ArrayItems > </ Expand > </ Type > < Type Name = "QByteArray" > < DisplayString >{d->data,s}</ DisplayString > < StringView >d->data,s</ StringView > < Expand > < Item Name = "[size]" >d->size</ Item > < Item Name = "[referenced]" >d->ref._q_value</ Item > < ArrayItems > < Size >d->size</ Size > < ValuePointer >d->data,c</ ValuePointer > </ ArrayItems > </ Expand > </ Type > <!-- Qt 5 <Type Name="QString"> <DisplayString>{((reinterpret_cast<unsigned short*>(d)) + d->offset / 2),sub}</DisplayString> <StringView>((reinterpret_cast<unsigned short*>(d)) + d->offset / 2),sub</StringView> <Expand> <Item Name="[size]">d->size</Item> <Item Name="[referenced]">d->ref.atomic._q_value</Item> <ArrayItems> <Size>d->size</Size> <ValuePointer>((reinterpret_cast<unsigned short*>(d)) + d->offset / 2),c</ValuePointer> </ArrayItems> </Expand> </Type> <Type Name="QByteArray"> <DisplayString>{((reinterpret_cast<char*>(d)) + d->offset),sb}</DisplayString> <StringView>((reinterpret_cast<char*>(d)) + d->offset),sb</StringView> <Expand> <Item Name="[size]">d->size</Item> <Item Name="[referenced]">d->ref.atomic._q_value</Item> <ArrayItems> <Size>d->size</Size> <ValuePointer>((reinterpret_cast<char*>(d)) + d->offset),c</ValuePointer> </ArrayItems> </Expand> </Type> --> </ AutoVisualizer > |
* OK, the solution for VS 2012 + Qt 5.2 does show up, but my constraints are somehow more generic than that.
3 comments:
You could also take qt4.natvis and qt5.natvis from https://qt.gitorious.org/qt-labs/vstools
@hmuelner
Thanks! Alas, only qt5 visualizer could be easily found, qt4 seems to be elswhere.
It's amazing how much time a simple blog post can save. Thanks a ton!
Post a Comment