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. Qt Scene Graph Problem
Forum Updated to NodeBB v4.3 + New Features

Qt Scene Graph Problem

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 290 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.
  • lightwindL Offline
    lightwindL Offline
    lightwind
    wrote on last edited by
    #1

    Hello, I met a strange problem.
    I try to use the official example of Qt Scene Graph.
    I changed the Sequicle's size.

    m_renderer->setViewportSize(window()->size() * window()->devicePixelRatio()/2);
    glViewport(0, 0, m_viewportSize.width(), m_viewportSize.height());
    

    If I add a Rectangle Item in qml window, the Rectangle shows in Sequicle's range. It's so strangle.
    4a8aa976-baef-4160-9838-84cc637fc067-image.png

    Do someone knows how to address this problem?
    I just want to add my own opengl Item in qml window.

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      Squircle size is bigger than the rectangle. Check the size & make appropriate anchors. It will work

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • lightwindL Offline
        lightwindL Offline
        lightwind
        wrote on last edited by
        #3

        Thank you very much! I find that glviewport() function control this. It draws everything by four elements. I draw what I want at right position, and it worked!

        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