title: Accessing Qt / QML objects with C++
body: <p>I'm working on a C++ Qt project that will eventually communicate with the serial port. One part of this is accessing QML objects in the C++ portion. I have code that can set properties of the QML, but accessing those features that are methods now has me stumped. View the following code:</p>
  
  <pre><code>object = view.rootObject();
  
  rect = object-&gt;findChild&lt;QObject *&gt;("box");
  rect-&gt;setProperty("color", "red");                  // Verifies the object tree is accessible
  viewer = object-&gt;findChild&lt;QObject *&gt;("viewer");    // Access the viewer text box
  
  viewer-&gt;append("dummy text");           // OOPS! This doesn't compile!!!
  </code></pre>
  
  <p>Now, the type  as a method setProperty(..), but how do you access methods of an object. "viewer" is a TextArea and I want to first do a selectAll(), then a cut() to clear the box.</p>
  
  <p>The question here is how is this coded? Thanks all.</p>