Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt Scene Graph Problem



  • 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.


  • Qt Champions 2017

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


  • Qt Champions 2017

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



  • 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!


Log in to reply