Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add better QDate expansion for qt5.natvis #3

Open
ThomasHeinrichSchmidt opened this issue Jul 16, 2021 · 0 comments
Open

add better QDate expansion for qt5.natvis #3

ThomasHeinrichSchmidt opened this issue Jul 16, 2021 · 0 comments

Comments

@ThomasHeinrichSchmidt
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant