Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.

Talk:IDE Debug Helpers

From Qt Wiki
Revision as of 09:50, 16 July 2021 by Thomas H. Schmidt (talk | contribs) (→‎QDate showing MDY in addition to Julian day: new section)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

For people that have trouble with the QList expansion, please update the current QList part in qt5.natvis with:

   <Type Name="QList<*>">
       <AlternativeType Name="QStringList"></AlternativeType>
       <AlternativeType Name="QQueue<*>"></AlternativeType>
       <DisplayString>{{ size = {d->end - d->begin} }}</DisplayString>
       <Expand>
           <Item Name="[referenced]">d->ref.atomic._q_value</Item>
           <IndexListItems Condition="QTypeInfo<$T1>::isLarge || QTypeInfo<$T1>::isStatic">
               <Size>d->end - d->begin</Size>
               <ValueNode>*reinterpret_cast<$T1*>(reinterpret_cast<Node*>(d->array + d->begin + $i)->v)</ValueNode>
           </IndexListItems>
           <IndexListItems Condition="!(QTypeInfo<$T1>::isLarge || QTypeInfo<$T1>::isStatic)">
               <Size>d->end - d->begin</Size>
           	<ValueNode>*reinterpret_cast<$T1*>(d->array + d->begin + $i)</ValueNode>
           </IndexListItems>
       </Expand>
   </Type>

This fixes some Node* expansion issues when you have a struct that is exactly sizeof(void*) (which somehow end up being in a Node instead of being directly in the QList)

Someone might want to apply this as a patch to the next version of the qt5.natvis file.

--- Can someone who understands what is supposed to go in the autoexp.dat file please fix the formatting of this page? Rakslice (talk) 01:11, 12 May 2017 (UTC)

QDate showing MDY in addition to Julian day

It would be an improvement for qt5.natvis if QDate was shown not only as Julian day

  { julian day = 2459412 }

but also in a DMY form like this

   { julian day = 2459412 }
      [day]: 16
      [month]: 7
      [year]: 2021
   [Raw View]: {jd=2459412 }

this can be done by using

 <Type Name="QDate">
   <DisplayString>{{ julian day = {jd} }}</DisplayString>
   <Expand>
     <Item Name="[day]">((5 * (((4 * (jd + 1401 + (((4 * jd + 274277) / 146097) * 3) / 4 - 38) + 3) % 1461) / 4) + 2) % 153) / 5 + 1</Item>
     <Item Name="[month]">((5 * (((4 * (jd + 1401 + (((4 * jd + 274277) / 146097) * 3) / 4 - 38) + 3) % 1461) / 4) + 2) / 153 + 2) % 12 + 1</Item>
     <Item Name="[year]">((4 * (jd + 1401 + (((4 * jd + 274277) / 146097) * 3) / 4 - 38) + 3) / 1461) - 4716 + (14 - (((5 * (((4 * (jd + 1401 + (((4 * jd + 274277) / 146097) * 3) / 4 - 38) + 3) % 1461) / 4) + 2) / 153 + 2) % 12 + 1)) / 12</Item>
   </Expand>
 </Type>

instead of

  <Type Name="QDate">
    <DisplayString>{{ julian day = {jd} }}</DisplayString>
    <Expand></Expand>
  </Type>

as it is done currently.