<div dir="ltr">Hi Mark,<div><br></div><div style>QSGNodes form a tree, so you can do something like:</div><div style><br></div><div style>QSGGeometryNode *background = new QSGGeometryNode();<br></div><div style>QSGGeometryNode *line1 = new QSGGeometryNode();</div>

<div style>QSGGeometryNode *line2 = new QSGGeometryNode();</div><div style><br></div><div style>// ... setup background, line1 and line2 </div><div style><br></div><div style>background ->appendChildNode(line1);</div>
<div style>
background ->appendChildNode(line2);</div><div style><br></div><div style>Josh</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 5, 2013 at 10:14 AM, Mark <span dir="ltr"><<a href="mailto:markg85@gmail.com" target="_blank">markg85@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Another day, another Scene Graph question.<br>
<br>
In plain QML it's very easy to make a few rectangles laying on top of<br>
each other. I'm having trouble doing the same thing in a Scene Graph<br>
QML Component plugin (updatePaintNode specifically).<br>
<br>
What i want to do is draw a few shapes. One is a plain simple<br>
rectangle where i want to draw multiple lines (to make a grid). each<br>
line is probably it's own QSGGeometry::Point2D so there is issue one.<br>
How can i have multiple lines?<br>
<br>
Even if i get that done, i still want to put another "layer" on top of<br>
that grid to display something. Like a line graph/chart.<br>
<br>
Or is the right approach to think very abstract here and have - lets<br>
say - 3 different custom components.<br>
1. background<br>
2. grid<br>
3. custom shape on top of grid<br>
<br>
If that's the case then i'd still like to know how i can draw multiple<br>
lines from within updatePaintNode :)<br>
<br>
In QML that would look like this:<br>
<br>
CustomRectangle {<br>
  width: 200<br>
  height: 200<br>
  CustomGrid {<br>
    anchors.fill: parent<br>
  }<br>
  CustomShape {<br>
    anchors.fill: parent<br>
  }<br>
}<br>
<br>
Note: in case you're wondering. The result i'm trying to get is<br>
somewhat like this [1] only with settable colors.<br>
<br>
Regards,<br>
Mark<br>
<br>
[1] <a href="http://i.stack.imgur.com/Zk2RG.png" target="_blank">http://i.stack.imgur.com/Zk2RG.png</a><br>
_______________________________________________<br>
Interest mailing list<br>
<a href="mailto:Interest@qt-project.org">Interest@qt-project.org</a><br>
<a href="http://lists.qt-project.org/mailman/listinfo/interest" target="_blank">http://lists.qt-project.org/mailman/listinfo/interest</a><br>
</blockquote></div><br></div>