title: Structured constants in QML
body: <p>Based on other posts (across sites), I have created a Constants.qml file which contains:</p>
  <pre><code>pragma Singleton
  import QtQuick 2.6
  
  QtObject {
      readonly property alias MyConst: myConst_
  
      QtObject
      {
          id: myConst_
          readonly property int Test: 1
          readonly property int Apple: 2
          readonly property int Dog: 4
      }
  }
  </code></pre>
  <p>And elsewhere I am trying to reference these values like this:</p>
  <pre><code>var a = Constants.MyConst.Test
  </code></pre>
  <p>Which generates error:</p>
  <pre><code>TypeError: Cannot read property 'Test' of undefined    
  </code></pre>
  <p>Can someone explain how to make this work?</p>