title: Ambiguity between class-name and enumerator-values in C++ natvis
body: <p>I want to create a natvis for <code>QObject</code>. There are dynamic properties concepts, which stored in form</p>
  <pre><code>  QList&lt;QByteArray&gt; propertyNames;
    QVector&lt;QVariant&gt; propertyValues;
  </code></pre>
  <p>and I want to group them and visualize as a map(key-value items).</p>
  <p>My natvis is pretty simple (for illustration purposes, I replaced all complex logic of getting data from <code>QList</code> and <code>QVector</code> with <code>_GetNameAsVoidPtr</code> and <code>_GetValueAsVoidPtr</code>):</p>
  <pre><code>&lt;Type Name=&quot;QObject&quot;&gt;
    ...
    &lt;Synthetic Name=&quot;dynamic_properties&quot;&gt;
      &lt;DisplayString&gt;{{ size = {propertyNames.d-&amp;gt;end - propertyNames.d-&amp;gt;begin} }}&lt;/DisplayString&gt;
      &lt;Expand&gt;
        &lt;CustomListItems&gt;
          &lt;Variable Name=&quot;index&quot; InitialValue=&quot;0&quot; /&gt;
          &lt;Variable Name=&quot;size&quot; InitialValue=&quot;propertyNames.d-&amp;gt;end - propertyNames.d-&amp;gt;begin&quot; /&gt;
          &lt;Loop&gt;
            &lt;Break Condition=&quot;index &gt;= size&quot; /&gt;
            &lt;Item Name=&quot;[{index}] {*reinterpret_cast&amp;lt;const QByteArray*&amp;gt;(_GetNameAsVoidPtr(index))}&quot;&gt;
              {*reinterpret_cast&amp;lt;const QVariant*&amp;gt;(_GetValueAsVoidPtr(index))}
            &lt;/Item&gt;
            &lt;Exec&gt;++index&lt;/Exec&gt;
          &lt;/Loop&gt;
        &lt;/CustomListItems&gt;
      &lt;/Expand&gt;
    &lt;/Synthetic&gt;
    ...
  &lt;/Type&gt;
  </code></pre>
  <p>I get the following error:</p>
  <pre><code>Natvis: QObject.natvis(217,21): Error: constant &quot;QByteArray&quot; is not a type name
      Error while evaluating '*reinterpret_cast&lt;const QByteArray*&gt;(_GetNameAsVoidPtr(index))' in the context of type 'Qt5Cored.dll!QObject'.
  Natvis: QObject.natvis(217,21): Error: constant &quot;QVariant&quot; is not a type name
      Error while evaluating '*reinterpret_cast&lt;const QVariant*&gt;(_GetValueAsVoidPtr(index))' in the context of type 'Qt5Widgetsd.dll!QObject'.
  
  </code></pre>
  <p>I tried to replace <code>reinterpret_cast&amp;lt;const QByteArray*&amp;gt;</code> with <code>reinterpret_cast&amp;lt;const Qt5Cored.dll::QByteArray*&amp;gt;</code>, removed <code>const</code> and other things - nothing worked. Then I printed these values in VS-Watch window and get the following picture:
  <a href="https://i.stack.imgur.com/GtSaC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GtSaC.png" alt="TypesEnums" /></a></p>
  <p>And here I realised, that Qt has classes: <code>class QByteArray</code> and <code>class QVariant</code>,
  also, it has enum <a href="https://doc.qt.io/qt-6/qmetatype.html#Type-enum" rel="nofollow noreferrer">QMetaType::Type</a> with values <code>QByteArray</code> and <code>QVariant</code>.
  In most places, natvis use types as-is(as you type them in xml), but for some reason, inside <code>CustomListItems</code> section, it adds the module name in the front of all types.</p>
  <p>So, instead of <code>QByteArray</code> and <code>QVariant</code>, it treat them as <code>ModuleName.dll!QByteArray</code> and <code>ModuleName.dll!QVariant</code>. The same for <code>QString</code>, for instance. And as you can see on screenshot from Watch window, Visual studio interpet classes with explicit <code>ModuleName.dll</code> prefix as enum-values(not classes).</p>
  <p><strong>It there any way to to specify explicitly that <code>QVariant</code> is a class, not an enum?</strong></p>
  <p>I tried to add double colons(<code>::QVariant</code>) or &quot;class&quot; keyword(<code>class QVariant</code>) - does not work :(</p>
  <p>I have some ideas how to workaround that issue(if some of them work - i will reply), but first of all, I am curios is there proper way, to tell compiler that it is a class-name?</p>