Qt QML: in-file definition of reusable objects
<p>I have a Qml component that is reasonably large so that I want to make it a reusable component but it is too small/non-generic such that I want to avoid creating its own .qml file.
It seems like Components are the right method to define reusable objects in the same file, but when I do that I don't know how to access and change properties of the contained objects.</p>

<p>More specifically, imagine having an in-file definition like this</p>

<pre><code>Component {
id: myReusableComponent
// This cannot be set because component does not allow properties
// (Would work fine in a separate file myReusableComponent.qml)
// property alias string innerText: innerText.text
Rectangle {
    id: rect
    width: 200
    height: 200
    color: "red"
    Text {
        id: innerText
        text: "Want to set text later"
    }
}
</code></pre>

<p>How can I reuse this component later, while changing some properties of it?
I know the following is not valid syntax, but I want to use it similarly to this:</p>

<pre><code>Loader {
id: hello
sourceComponent: myReusableComponent
item.innerText: "Hello" }

Text { text: "Some other stuff in between" }

Loader {
id: world
sourceComponent: myReusableComponent
item.anchors.left: hello.right
item.rect.width: 100
item.rect.color: "blue"
item.innerText: "World" }

Loader {
id: excl
sourceComponent: myReusableComponent
item.rect.color: "green"
item.innerText: "!!!" }
etc...
</code></pre>

<p>Any ideas? Or is there a fundamentally different way of doing this?<br>
What I essentially want is reusability of QML objects that are defined in place while still being able to change the properties of them.  </p>

<p><a href="https://stackoverflow.com/questions/28360339/how-to-access-the-qml-object-inside-the-loaders-sourcecomponent">This</a> seems to be related but does not solve the problem of creating multiple objects. Repeaters seem to be useful but don't give me the flexibility I want.</p>

<hr>

<p>NOTE: I will add some remarks about the answers here since they might get overlooked in the comments.
I like all three answers from Blabbouze, derM and ddriver!
I accepted Blabbouze's answer because it provides a concrete solution that is closest to what I was looking for.
However, I also didn't know about the overhead of Loaders and might consider using a different approach after reading derM's answer.
Finally, dynamic object creation as suggested by ddriver is not exactly what I was looking for but might be useful for others.
Thanks everyone!</p>