[Interest] Multiple rectangles or any shapes in Scene Graph plugin?

Josh Faust jfaust at suitabletech.com
Wed Jun 5 19:30:11 CEST 2013


Hi Mark,

QSGNodes form a tree, so you can do something like:

QSGGeometryNode *background = new QSGGeometryNode();
QSGGeometryNode *line1 = new QSGGeometryNode();
QSGGeometryNode *line2 = new QSGGeometryNode();

// ... setup background, line1 and line2

background ->appendChildNode(line1);
background ->appendChildNode(line2);

Josh


On Wed, Jun 5, 2013 at 10:14 AM, Mark <markg85 at gmail.com> wrote:

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


More information about the Interest mailing list