Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Use scene graph (qt quick 2.0) in c++ without qml?
Forum Update on Monday, May 27th 2025

Use scene graph (qt quick 2.0) in c++ without qml?

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 2.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tiftof
    wrote on last edited by
    #1

    Hi,

    I was wondering how I would start to implement a c++ application that is using an OpenGL scene graph (qt quick 2.0). I have an application based onQGraphicsView/Scene for the moment. It basically creates QGraphicsItems (QGraphicsTextItem, QGraphicsVideoItem, my own QGraphicsItems...) on the fly in this scene and animates them (moving or update/paint of the item itself).

    Can I do the same thing using qt quick 2.0 but without using qml and just use the backend of qml in c++ to get the performing opengl backend? I was looking at QtQuickCanvas and QtQuickItem but there are no classes for example to have a rectangle in the scene but there are rectangles available in qml. Are these qml items not usable in a pure c++ application? Can anyone point me to a simple example of for example drawing some text or a rectangle in a scene graph without using qml, only c++?

    Any guidance for converting a QGraphicsScene/View application to QtQuick 2.0 is welcome!

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Many QtQuick classes are private, where only QML interface is available. But, I think you could do it in 2 ways:

      Through QML-C++ bindings, generate QML components instead of QGraphicsItem's

      Create your own QML elements with custom painting code

      But it would take some serious effort to do this, probably. I would suggest to go with QML. Or, you can take a look at how Qt devs paint SceneGraph objects to get the idea on how it should be done.

      (Z(:^

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved