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 Clipping my viewport to bottom left quadrant of window
Qt 6.11 is out! See what's new in the release blog

Qt3D Clipping my viewport to bottom left quadrant of window

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.2k 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.
  • F Offline
    F Offline
    fireking
    wrote on last edited by
    #1

    Using Mac version...

    I'm displaying objects in a QGLView window and I cannot get the viewport to match the window size. It keeps drawing all my object in bottom left quadrant of the screen.

    Resizing has no effect. Actually, when I implement resizeGL is does not even get called?

    @
    void CubeView::paintGL(QGLPainter *painter)
    {
    painter->setStandardEffect(QGL::LitMaterial);
    painter->setFaceColor(QGL::AllFaces, QColor(170, 202, 0));

    // Draw the set of objects in the scene.
    if ( !vdm.isEmpty())
    {
        // Need to traverse all the SceneNodes and draw them...
        foreach(  VisualDataModel *VisualDataItem, vdm )
        {
            VisualDataItem->getNode()->draw(painter);
        }
    }
    

    }
    @

    1 Reply Last reply
    0
    • F Offline
      F Offline
      fireking
      wrote on last edited by
      #2

      So reading bugs... I'm guessing this is related to hiDPI support for Mac since window is 2x viewport dimensions? Should I be using Qt3D / OpenGL on Mac with Retina Display?

      Changing display resolution does not seem to help.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        arici
        wrote on last edited by
        #3

        I found a workaround - in qglwindowsurface.cpp modify the function QRect QGLWindowSurface::viewportGL() const, changing the return statement to:
        @
        return QRect(0,0,geom.width() * window()->devicePixelRatio(), geom.height() * window()->devicePixelRatio());
        @
        Multiplying by devicePixelRatio handles scaling by two - should work on other platforms as well but I haven't tested it.

        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