title: How do I cast QML items to corresponding C++ Item in Qt Quick
body: <p>My question is best clarified by an example. I have QML with a <code>Text{}</code> item. In C++ I can get to this item and I have no problem using <code>qobject_cast</code> to turn anything into a <code>QQuickItem*</code>. But how do I turn it into the closest corresponding item so that I can call more specific methods directly like <code>setText()</code> the same way I might call <code>setWidth()</code>?  I realize I can use the generic setProperty() method but I'm after the compile time checking that casting offers. </p>
  
  <p>I'm after a more general answer for finding the correspondence between QML and their C++ classes, so that I can find out how to do this for Rectangles, MenuBars etc. I can't seem to find this in the docs.  For those that prefer code examples:</p>
  
  <pre><code>auto text_object = app_item-&gt;findChild&lt;QObject*&gt;("myTextArea");
  text_object-&gt;setProperty("text","New Text set from Code"); //THIS WORKS BUT...
  auto text_qitem = qobject_cast&lt;QQuickItem*&gt;(text_object);
  text_qitem-&gt;setWidth(128);
  auto text_quick_text = qobject_cast&lt;WHATGOESHERE???*&gt;(text_object);
  text_quick_text-&gt;setText("new Text for qml item");  //I WANT TO DO THIS
  </code></pre>