Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-116753

qml - qmlscene root item sizing discrepancy

    XMLWordPrintable

Details

    • 05e0dc2a8 (dev), 410c2a444 (6.6)

    Description

      Take this .qml file:

      import QtQuick
      import QtQuick3D
      
      Item {
          // width: 800
          // height: 800
          View3D {
              id: v3d
              anchors.fill: parent
      
              environment: SceneEnvironment {
                  clearColor: "green"
                  backgroundMode: SceneEnvironment.Color
              }
      
              PerspectiveCamera {
                  z: 600
              }
      
              Model {
                  source: "#Cube"
                  materials: PrincipledMaterial {
                      lighting: PrincipledMaterial.NoLighting
                  }
                  eulerRotation.y: 20
              }
          }
      }
      

      Run it with qml and qmlscene (no arguments needed apart from the filename).

      qml v3d.qml gives:

      The content only appears after manually resizing the window to a bigger size:

      qmlscene v3d.qml gives:

      If the root had the size set explicitly (which is commented out now), this of course would not happen. However this difference in behavior is pretty bad when working with data that is created to be used with a SizeRootObjectToView QQuickView, and then also wanting to view the scene with qml/qmlscene.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-116753
          # Subject Branch Project Status CR V

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              lagocs Laszlo Agocs
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes