Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt3D Multiple Viewports with C++
Forum Updated to NodeBB v4.3 + New Features

Qt3D Multiple Viewports with C++

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 1.0k Views 1 Watching
  • 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.
  • B Offline
    B Offline
    Blackfish
    wrote on last edited by Blackfish
    #1

    I would like to create multiple viewports for a C++ Qt3D a program. I’ve seen the QML example. However, I searched for a C++ method to no avail. I attempted to create 2 views:

    Qt3DExtras::Qt3DWindow *view1 = new Qt3DExtras::Qt3DWindow();
    
    Qt3DExtras::Qt3DWindow *view2 = new Qt3DExtras::Qt3DWindow();
    

    And eventually:

    View1->setRootEntity(rootEntity);
    
    view2->setRootEntity(rootEntity);
    

    This results with only view2 displaying the scene. Is it possible to create multiple viewports for a non QML Qt3D application? Or can a root entity created in C++ be passed to a QML viewport?

    1 Reply Last reply
    0
    • H Offline
      H Offline
      HappyFeet
      wrote on last edited by
      #2

      You only need (and should only use) one 3D window. You set the root entity like you do in your example and then create a framegraph like the one on the QML example. To "activate" this framegraph you have to retrieve the QRenderSettings from the 3D window using the method renderSettings() (the only purpose of the render settings is holding the active framegraph) and then setting your custom framegraph by calling setActiveFramegraph(QFramegraphNode*). The rootEntity in your example is the root of the objects that are to be displayed, the framegraph on the other hand specifies HOW it should be displayed.

      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