Uploaded image for project: 'Qt 3D Studio'
  1. Qt 3D Studio
  2. QT3DS-1646

Fix public demos for 2.0

    XMLWordPrintable

Details

    Description

      Someone with access rights to public-demos/qt3dstudio needs to apply the following to make kria and homeautomation work correctly on all platforms with the new runtime. (for instance kria does not work on Ubuntu with Intel without this)

      diff --git a/HomeAutomation/HomeAutom.pro b/HomeAutomation/HomeAutom.pro
      index e0b724c..75c3afb 100644
      --- a/HomeAutomation/HomeAutom.pro
      +++ b/HomeAutomation/HomeAutom.pro
      @@ -12,7 +12,7 @@ KNX_BOARD {
           CONFIG += c++11
       }
       
      -QT += qml quick
      +QT += qml quick 3dstudioruntime2
       
       CONFIG += resources_big
       
      diff --git a/HomeAutomation/main.cpp b/HomeAutomation/main.cpp
      index 5f39d93..cf1214a 100644
      --- a/HomeAutomation/main.cpp
      +++ b/HomeAutomation/main.cpp
      @@ -59,6 +59,7 @@
       #if defined(KNX_BACKEND)
       #include "qmlknxdemo.h"
       #endif
      +#include <q3dsruntimeglobal.h>
       
       // Uncomment for 1280x900 window
       //#define FIXEDWINDOW
      @@ -75,18 +76,10 @@ int applyRatio(const int value, const int ratio)
       
       int main(int argc, char *argv[])
       {
      -#if defined(Q_OS_MACOS)
      -    QSurfaceFormat openGLFormat;
      -    openGLFormat.setRenderableType(QSurfaceFormat::OpenGL);
      -    openGLFormat.setProfile(QSurfaceFormat::CoreProfile);
      -    openGLFormat.setMajorVersion(4);
      -    openGLFormat.setMinorVersion(1);
      -    openGLFormat.setStencilBufferSize(8);
      -    QSurfaceFormat::setDefaultFormat(openGLFormat);
      -#endif
      -
           QGuiApplication app(argc, argv);
       
      +    QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat());
      +
           // Define size variants for scaling
           qreal refDpi = 96.;
           qreal refWidth = 1280.;
      diff --git a/HomeAutomation/qml/HomeAutom/HomeView.qml b/HomeAutomation/qml/HomeAutom/HomeView.qml
      index 5ea1c40..2e52600 100644
      --- a/HomeAutomation/qml/HomeAutom/HomeView.qml
      +++ b/HomeAutomation/qml/HomeAutom/HomeView.qml
      @@ -50,7 +50,7 @@
       
       import QtQuick 2.8
       import QtQuick.Controls 2.1
      -import QtStudio3D 1.1
      +import QtStudio3D 2.0
       
       Item {
           id: home
      diff --git a/kria-cluster-3d-demo/kria3dclusterdemo.pro b/kria-cluster-3d-demo/kria3dclusterdemo.pro
      index beca73e..198ad2c 100644
      --- a/kria-cluster-3d-demo/kria3dclusterdemo.pro
      +++ b/kria-cluster-3d-demo/kria3dclusterdemo.pro
      @@ -1,6 +1,6 @@
       TEMPLATE = app
       
      -QT += qml quick
      +QT += qml quick 3dstudioruntime2
       
       target.path = $$[QT_INSTALL_EXAMPLES]/studio3d/$$TARGET
       INSTALLS += target
      diff --git a/kria-cluster-3d-demo/main.cpp b/kria-cluster-3d-demo/main.cpp
      index 5c2b0ec..c15022a 100644
      --- a/kria-cluster-3d-demo/main.cpp
      +++ b/kria-cluster-3d-demo/main.cpp
      @@ -53,24 +53,17 @@
       #include <QtQuick/QQuickView>
       #include <QtQml/QQmlEngine>
       #include <QtGui/QFontDatabase>
      +#include <q3dsruntimeglobal.h>
       
       int main(int argc, char *argv[])
       {
      -#if defined(Q_OS_MACOS)
      -    QSurfaceFormat openGLFormat;
      -    openGLFormat.setRenderableType(QSurfaceFormat::OpenGL);
      -    openGLFormat.setProfile(QSurfaceFormat::CoreProfile);
      -    openGLFormat.setMajorVersion(4);
      -    openGLFormat.setMinorVersion(1);
      -    openGLFormat.setStencilBufferSize(8);
      -    QSurfaceFormat::setDefaultFormat(openGLFormat);
      -#endif
      -
           qputenv("QML_DISABLE_DISK_CACHE", "true");
       
           QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
           QGuiApplication app(argc, argv);
       
      +    QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat());
      +
           QQuickView viewer;
       
           QFontDatabase::addApplicationFont("qrc:/qml/fonts/TitilliumWeb-SemiBold.ttf");
      diff --git a/kria-cluster-3d-demo/qml/main.qml b/kria-cluster-3d-demo/qml/main.qml
      index e8f0cc1..cc087ac 100644
      --- a/kria-cluster-3d-demo/qml/main.qml
      +++ b/kria-cluster-3d-demo/qml/main.qml
      @@ -49,7 +49,7 @@
       ****************************************************************************/
       
       import QtQuick 2.9
      -import QtStudio3D 1.1
      +import QtStudio3D 2.0
       import QtQuick.Controls 2.1
       
       Item {
      

      Note that TennisGame is not supported by the new runtime.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              e0150566 Janne Koskinen
              lagocs Laszlo Agocs
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes