Results 1 to 5 of 5

Thread: Whats the right way to link data to a QSGNode?

  1. #1
    Join Date
    Nov 2014
    Posts
    6
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Whats the right way to link data to a QSGNode?

    Hello,
    currently I'm learning how to create a new QQUickItem with OpenGL Rendering.
    With the QQUickItem i want to create a plot.
    The plot should represent some data, which contains a id and a x and y coordinate.

    Now I'm looking for a clean way, to link the id to the QSGNode.
    Can I simple Subclass QSGNode? Or is there a better way to link data to a QSGNode?
    Greetings,
    sheepy

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Whats the right way to link data to a QSGNode?

    Why do you want to link an id to scene-graph node? Nodes are used purely for rendering. Do you want to pass that ID to a shader?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Nov 2014
    Posts
    6
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Whats the right way to link data to a QSGNode?

    No i want to create an interaction screen, where the user can click to a coordinate. When the coordinate is cliked, I want to do somethin with a object, that refers by the id.
    Of course, I can create a Map in my QQuickItem that refers the point the object. But if I scale the screen I have some porblems with the mapping
    I doesn't know that the node only used for rendering. Thanks for this information

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Whats the right way to link data to a QSGNode?

    All data related to the item should be kept within the item (QQuickItem). QSGNode subclasses should only deal with rendering. There is an example in the docs showing how to draw a curve stored as a number of control points in the item.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    sheepy (28th November 2014)

  6. #5
    Join Date
    Nov 2014
    Posts
    6
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Whats the right way to link data to a QSGNode?

    I studied the beziercurve example. Now I know what is to do.

    Thank you

Similar Threads

  1. Whats is the best way for reporting in qt?
    By Júlio Brito in forum Newbie
    Replies: 4
    Last Post: 9th August 2014, 16:50
  2. get start to QT and whats qt-embedded
    By sudeep in forum Newbie
    Replies: 0
    Last Post: 26th May 2013, 17:09
  3. Replies: 11
    Last Post: 5th May 2011, 15:05
  4. get the data of link.
    By punit.doshi.85 in forum Qt Programming
    Replies: 1
    Last Post: 26th September 2008, 12:52
  5. Whats This box too small
    By bruccutler in forum Qt Programming
    Replies: 5
    Last Post: 31st March 2007, 00:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.