qt6.natvis 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. ****************************************************************************
  4. **
  5. ** Copyright (C) 2021 The Qt Company Ltd.
  6. ** Contact: https://www.qt.io/licensing/
  7. **
  8. ** This file is part of the Qt VS Tools.
  9. **
  10. ** $QT_BEGIN_LICENSE:GPL-EXCEPT$
  11. ** Commercial License Usage
  12. ** Licensees holding valid commercial Qt licenses may use this file in
  13. ** accordance with the commercial license agreement provided with the
  14. ** Software or, alternatively, in accordance with the terms contained in
  15. ** a written agreement between you and The Qt Company. For licensing terms
  16. ** and conditions see https://www.qt.io/terms-conditions. For further
  17. ** information use the contact form at https://www.qt.io/contact-us.
  18. **
  19. ** GNU General Public License Usage
  20. ** Alternatively, this file may be used under the terms of the GNU
  21. ** General Public License version 3 as published by the Free Software
  22. ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
  23. ** included in the packaging of this file. Please review the following
  24. ** information to ensure the GNU General Public License requirements will
  25. ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
  26. **
  27. ** $QT_END_LICENSE$
  28. **
  29. ****************************************************************************
  30. -->
  31. <AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
  32. <Type Name="QSpecialInteger&lt;*&gt;">
  33. <DisplayString>{val}</DisplayString>
  34. <Expand>
  35. <Item Name="[value]">val</Item>
  36. </Expand>
  37. </Type>
  38. <Type Name="QBasicAtomicInteger&lt;*&gt;">
  39. <DisplayString>{_q_value}</DisplayString>
  40. <Expand>
  41. <Item Name="[value]">_q_value</Item>
  42. </Expand>
  43. </Type>
  44. <Type Name="QBasicAtomicPointer&lt;*&gt;">
  45. <Intrinsic Name="isNull" Expression="value()==0" />
  46. <Intrinsic Name="value" Expression="_q_value.value()" />
  47. <DisplayString Condition="isNull()">empty</DisplayString>
  48. <DisplayString Condition="!isNull()">{_q_value}</DisplayString>
  49. <Expand>
  50. <Item Name=" " Condition="!isNull()">*value()</Item>
  51. </Expand>
  52. </Type>
  53. <Type Name="QPoint">
  54. <AlternativeType Name="QPointF"/>
  55. <DisplayString>{{ x = {xp}, y = {yp} }}</DisplayString>
  56. <Expand>
  57. <Item Name="[x]">xp</Item>
  58. <Item Name="[y]">yp</Item>
  59. </Expand>
  60. </Type>
  61. <Type Name="QRect">
  62. <DisplayString>{{ x = {x1}, y = {y1}, width = {x2 - x1 + 1}, height = {y2 - y1 + 1} }}</DisplayString>
  63. <Expand>
  64. <Item Name="[x]">x1</Item>
  65. <Item Name="[y]">y1</Item>
  66. <Item Name="[width]">x2 - x1 + 1</Item>
  67. <Item Name="[height]">y2 - y1 + 1</Item>
  68. </Expand>
  69. </Type>
  70. <Type Name="QRectF">
  71. <DisplayString>{{ x = {xp}, y = {yp}, width = {w}, height = {h} }}</DisplayString>
  72. <Expand>
  73. <Item Name="[x]">xp</Item>
  74. <Item Name="[y]">yp</Item>
  75. <Item Name="[width]">w</Item>
  76. <Item Name="[height]">h</Item>
  77. </Expand>
  78. </Type>
  79. <Type Name="QSize">
  80. <AlternativeType Name="QSizeF"/>
  81. <DisplayString>{{ width = {wd}, height = {ht} }}</DisplayString>
  82. <Expand>
  83. <Item Name="[width]">wd</Item>
  84. <Item Name="[height]">ht</Item>
  85. </Expand>
  86. </Type>
  87. <Type Name="QLine">
  88. <AlternativeType Name="QLineF"/>
  89. <DisplayString>{{ start point = {pt1}, end point = {pt2} }}</DisplayString>
  90. <Expand>
  91. <Synthetic Name="[start point]">
  92. <DisplayString>{pt1}</DisplayString>
  93. <Expand>
  94. <ExpandedItem>pt1</ExpandedItem>
  95. </Expand>
  96. </Synthetic>
  97. <Synthetic Name="[end point]">
  98. <DisplayString>{pt2}</DisplayString>
  99. <Expand>
  100. <ExpandedItem>pt2</ExpandedItem>
  101. </Expand>
  102. </Synthetic>
  103. </Expand>
  104. </Type>
  105. <Type Name="QPolygon">
  106. <DisplayString>{{ size={d-&gt;size} }}</DisplayString>
  107. <Expand>
  108. <Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item>
  109. <ArrayItems>
  110. <Size>d-&gt;size</Size>
  111. <ValuePointer>(QPoint*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)</ValuePointer>
  112. </ArrayItems>
  113. </Expand>
  114. </Type>
  115. <Type Name="QPolygonF">
  116. <DisplayString>{{ size={d-&gt;size} }}</DisplayString>
  117. <Expand>
  118. <Item Name="[closed]">
  119. d-&gt;size &gt; 0
  120. &amp;&amp; ((((QPointF*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)[0]).xp
  121. == (((QPointF*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)[d-&gt;size - 1]).xp)
  122. &amp;&amp; ((((QPointF*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)[0]).yp
  123. == (((QPointF*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)[d-&gt;size - 1]).yp)
  124. </Item>
  125. <Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item>
  126. <ArrayItems>
  127. <Size>d-&gt;size</Size>
  128. <ValuePointer>(QPointF*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)</ValuePointer>
  129. </ArrayItems>
  130. </Expand>
  131. </Type>
  132. <Type Name="QVector2D">
  133. <DisplayString>{{ x = {xp}, y = {yp} }}</DisplayString>
  134. <Expand>
  135. <Item Name="[x]">xp</Item>
  136. <Item Name="[y]">yp</Item>
  137. </Expand>
  138. </Type>
  139. <Type Name="QVector3D">
  140. <DisplayString>{{ x = {xp}, y = {yp}, z = {zp} }}</DisplayString>
  141. <Expand>
  142. <Item Name="[x]">xp</Item>
  143. <Item Name="[y]">yp</Item>
  144. <Item Name="[z]">zp</Item>
  145. </Expand>
  146. </Type>
  147. <Type Name="QVector4D">
  148. <DisplayString>{{ x = {xp}, y = {yp}, z = {zp}, w = {wp} }}</DisplayString>
  149. <Expand>
  150. <Item Name="[x]">xp</Item>
  151. <Item Name="[y]">yp</Item>
  152. <Item Name="[z]">zp</Item>
  153. <Item Name="[w]">wp</Item>
  154. </Expand>
  155. </Type>
  156. <Type Name="QMatrix">
  157. <DisplayString>
  158. {{ m11 = {_m11}, m12 = {_m12}, m21 = {_m21}, m22 = {_m22}, ... }}
  159. </DisplayString>
  160. <Expand>
  161. <Item Name="[m11]">_m11</Item>
  162. <Item Name="[m12]">_m12</Item>
  163. <Item Name="[m21]">_m21</Item>
  164. <Item Name="[m22]">_m22</Item>
  165. <Item Name="[dx]">_dx</Item>
  166. <Item Name="[dy]">_dy</Item>
  167. </Expand>
  168. </Type>
  169. <Type Name="QMatrix4x4">
  170. <DisplayString>
  171. {{ m11 = {m[0][0]}, m12 = {m[1][0]}, m13 = {m[2][0]}, m14 = {m[3][0]}, ... }}
  172. </DisplayString>
  173. <Expand>
  174. <Item Name="[m11]">m[0][0]</Item>
  175. <Item Name="[m12]">m[1][0]</Item>
  176. <Item Name="[m13]">m[2][0]</Item>
  177. <Item Name="[m14]">m[3][0]</Item>
  178. <Item Name="[m21]">m[0][1]</Item>
  179. <Item Name="[m22]">m[1][1]</Item>
  180. <Item Name="[m23]">m[2][1]</Item>
  181. <Item Name="[m24]">m[3][1]</Item>
  182. <Item Name="[m31]">m[0][2]</Item>
  183. <Item Name="[m32]">m[1][2]</Item>
  184. <Item Name="[m33]">m[2][2]</Item>
  185. <Item Name="[m34]">m[3][2]</Item>
  186. <Item Name="[m41]">m[0][3]</Item>
  187. <Item Name="[m42]">m[1][3]</Item>
  188. <Item Name="[m43]">m[2][3]</Item>
  189. <Item Name="[m44]">m[3][3]</Item>
  190. </Expand>
  191. </Type>
  192. <Type Name="QSizePolicy">
  193. <DisplayString>
  194. {{ horizontal = {static_cast&lt;Policy&gt;(bits.horPolicy)}, vertical = {static_cast&lt;Policy&gt;(bits.verPolicy)}, type = {ControlType(1 &lt;&lt; bits.ctype)} }}
  195. </DisplayString>
  196. <Expand>
  197. <Synthetic Name="[vertical policy]">
  198. <DisplayString>QSizePolicy::Policy::{static_cast&lt;Policy&gt;(bits.verPolicy)}</DisplayString>
  199. </Synthetic>
  200. <Synthetic Name="[horizontal policy]">
  201. <DisplayString>QSizePolicy::Policy::{static_cast&lt;Policy&gt;(bits.horPolicy)}</DisplayString>
  202. </Synthetic>
  203. <Synthetic Name="[control type]">
  204. <DisplayString>QSizePolicy::ControlType::{ControlType(1 &lt;&lt; bits.ctype)}</DisplayString>
  205. </Synthetic>
  206. <Synthetic Name="[expanding directions]">
  207. <DisplayString
  208. Condition="(static_cast&lt;Policy&gt;(bits.verPolicy) &amp; ExpandFlag)">
  209. Qt::Vertical (2)
  210. </DisplayString>
  211. <DisplayString
  212. Condition="(static_cast&lt;Policy&gt;(bits.horPolicy) &amp; ExpandFlag)">
  213. Qt::Horizontal (1)
  214. </DisplayString>
  215. </Synthetic>
  216. <Item Name="[vertical stretch]">static_cast&lt;int&gt;(bits.verStretch)</Item>
  217. <Item Name="[horizontal stretch]">static_cast&lt;int&gt;(bits.horStretch)</Item>
  218. <Item Name="[has height for width]">bits.hfw == 1</Item>
  219. <Item Name="[has width for height]">bits.wfh == 1</Item>
  220. </Expand>
  221. </Type>
  222. <Type Name="QChar">
  223. <DisplayString>{ucs,c}</DisplayString>
  224. <StringView>ucs,c</StringView>
  225. <Expand>
  226. <Item Name="[latin 1]">ucs > 0xff ? '\0' : char(ucs),c</Item>
  227. <Item Name="[unicode]">ucs,c</Item>
  228. </Expand>
  229. </Type>
  230. <Type Name="QString">
  231. <DisplayString>&quot;{(reinterpret_cast&lt;unsigned short*&gt;(d.ptr)),sub}&quot;</DisplayString>
  232. <StringView>(reinterpret_cast&lt;unsigned short*&gt;(d.ptr)),sub</StringView>
  233. <Expand>
  234. <Item Name="[size]">d.size</Item>
  235. <ArrayItems>
  236. <Size>d.size</Size>
  237. <ValuePointer>d.ptr</ValuePointer>
  238. </ArrayItems>
  239. </Expand>
  240. </Type>
  241. <Type Name="QStringRef">
  242. <DisplayString Condition="m_string == nullptr">{m_string,[m_size]} u""</DisplayString>
  243. <DisplayString Condition="m_string != nullptr">{m_string-&gt;d.ptr+m_position,[m_size]}</DisplayString>
  244. <StringView Condition="m_string == nullptr">""</StringView>
  245. <StringView Condition="m_string != nullptr">m_string,[m_position+m_size]</StringView>
  246. <Expand>
  247. <Item Name="[position]" ExcludeView="simple">m_position</Item>
  248. <Item Name="[size]" ExcludeView="simple">m_size</Item>
  249. <ArrayItems Condition="m_string != nullptr">
  250. <Size>m_size</Size>
  251. <ValuePointer>m_string-&gt;d.ptr+m_position</ValuePointer>
  252. </ArrayItems>
  253. </Expand>
  254. </Type>
  255. <Type Name="QStringView">
  256. <DisplayString>{m_data,[m_size]}</DisplayString>
  257. <StringView>m_data,[m_size]</StringView>
  258. <Expand>
  259. <Item Name="[size]" ExcludeView="simple">m_size</Item>
  260. <ArrayItems>
  261. <Size>m_size</Size>
  262. <ValuePointer>m_data</ValuePointer>
  263. </ArrayItems>
  264. </Expand>
  265. </Type>
  266. <Type Name="QByteArray">
  267. <DisplayString>&quot;{((reinterpret_cast&lt;char*&gt;(d.ptr))),sb}&quot;</DisplayString>
  268. <StringView>((reinterpret_cast&lt;char*&gt;(d.ptr))),sb</StringView>
  269. <Expand>
  270. <Item Name="[size]">d.size</Item>
  271. <ArrayItems>
  272. <Size>d.size</Size>
  273. <ValuePointer>d.ptr</ValuePointer>
  274. </ArrayItems>
  275. </Expand>
  276. </Type>
  277. <Type Name="QUrl">
  278. <Intrinsic Name="isEmpty" Expression="size==0">
  279. <Parameter Name="size" Type="int"/>
  280. </Intrinsic>
  281. <Intrinsic Name="memberOffset" Expression="sizeof(QAtomicInt) + sizeof(int) + (sizeof(QString) * count)">
  282. <Parameter Name="count" Type="int"/>
  283. </Intrinsic>
  284. <Intrinsic Name="scheme" Expression="*((QString*)(((char*)(d) + memberOffset(0))))" />
  285. <Intrinsic Name="username" Expression="*((QString*)(((char*)(d) + memberOffset(1))))" />
  286. <Intrinsic Name="password" Expression="*((QString*)(((char*)(d) + memberOffset(2))))" />
  287. <Intrinsic Name="host" Expression="*((QString*)(((char*)(d) + memberOffset(3))))" />
  288. <Intrinsic Name="path" Expression="*((QString*)(((char*)(d) + memberOffset(4))))" />
  289. <Intrinsic Name="query" Expression="*((QString*)(((char*)(d) + memberOffset(5))))" />
  290. <Intrinsic Name="fragment" Expression="*((QString*)(((char*)(d) + memberOffset(6))))" />
  291. <DisplayString Condition="!isEmpty(scheme().d-&gt;size)">{scheme()}://{host()}{path()}</DisplayString>
  292. <DisplayString Condition="isEmpty(scheme().d-&gt;size)">{path()}</DisplayString>
  293. <Expand>
  294. <Item Name="[scheme]">scheme()</Item>
  295. <Item Name="[username]">username()</Item>
  296. <Item Name="[password]">password()</Item>
  297. <Item Name="[host]">host()</Item>
  298. <Item Name="[path]">path()</Item>
  299. <Item Name="[query]">query()</Item>
  300. <Item Name="[fragment]">fragment()</Item>
  301. </Expand>
  302. </Type>
  303. <Type Name="QDate">
  304. <DisplayString>{{ julian day = {jd} }}</DisplayString>
  305. </Type>
  306. <Type Name="QTime">
  307. <Intrinsic Name="hour" Expression="mds / 3600000" />
  308. <Intrinsic Name="minute" Expression="(mds % 3600000) / 60000" />
  309. <Intrinsic Name="second" Expression="(mds / 1000) % 60" />
  310. <Intrinsic Name="millisecond" Expression="mds % 1000" />
  311. <DisplayString Condition="mds == 1">{{ millisecond = {mds} }}</DisplayString>
  312. <DisplayString Condition="mds != 1">{{ milliseconds = {mds} }}</DisplayString>
  313. <Expand>
  314. <Item Name="[hour]"
  315. Condition="(mds / 3600000) == 1">hour(), d</Item>
  316. <Item Name="[hours]"
  317. Condition="(mds / 3600000) != 1">hour(), d</Item>
  318. <Item Name="[minute]"
  319. Condition="((mds % 3600000) / 60000) == 1">minute(), d</Item>
  320. <Item Name="[minutes]"
  321. Condition="((mds % 3600000) / 60000) != 1">minute(), d</Item>
  322. <Item Name="[second]"
  323. Condition="((mds / 1000) % 60) == 1">second(), d</Item>
  324. <Item Name="[seconds]"
  325. Condition="((mds / 1000) % 60) != 1">second(), d</Item>
  326. <Item Name="[millisecond]"
  327. Condition="(mds % 1000) == 1">millisecond(), d</Item>
  328. <Item Name="[milliseconds]"
  329. Condition="(mds % 1000) != 1">millisecond(), d</Item>
  330. </Expand>
  331. </Type>
  332. <Type Name="QPair&lt;*,*&gt;">
  333. <DisplayString>({first}, {second})</DisplayString>
  334. <Expand>
  335. <Item Name="[first]">first</Item>
  336. <Item Name="[second]">second</Item>
  337. </Expand>
  338. </Type>
  339. <Type Name="QList&lt;*&gt;">
  340. <AlternativeType Name="QVector&lt;*&gt;"/>
  341. <DisplayString>{{ size={d.size} }}</DisplayString>
  342. <Expand>
  343. <ArrayItems>
  344. <Size>d.size</Size>
  345. <ValuePointer>reinterpret_cast&lt;$T1*&gt;(d.ptr)</ValuePointer>
  346. </ArrayItems>
  347. </Expand>
  348. </Type>
  349. <Type Name="QVarLengthArray&lt;*&gt;">
  350. <DisplayString>{{ size={s} }}</DisplayString>
  351. <Expand>
  352. <Item Name="[capacity]">a</Item>
  353. <ArrayItems>
  354. <Size>s</Size>
  355. <ValuePointer>ptr</ValuePointer>
  356. </ArrayItems>
  357. </Expand>
  358. </Type>
  359. <Type Name="QMap&lt;*,*&gt;">
  360. <AlternativeType Name="QMultiMap&lt;*,*&gt;"/>
  361. <DisplayString>{{ size={d.d-&gt;m._Mypair._Myval2._Myval2._Mysize} }}</DisplayString>
  362. <Expand>
  363. <Item Name="[std::map]">d.d-&gt;m</Item>
  364. </Expand>
  365. </Type>
  366. <Type Name="QHash&lt;*,*&gt;">
  367. <AlternativeType Name="QMultiHash&lt;*,*&gt;"/>
  368. <DisplayString>{{ size = {d-&gt;size} }}</DisplayString>
  369. <Expand>
  370. <Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item>
  371. </Expand>
  372. </Type>
  373. </AutoVisualizer>