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. QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat()); crash Studio3D scene loaded with QML

QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat()); crash Studio3D scene loaded with QML

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

    I try to load Studio3D scene following qt3d-runtime-requirements (http://doc.qt.io/qt3dstudio/runtime/qt3d-runtime-requirements.html)

    but QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat()); make it crash.

    with my code below, I have to add button to reload the presentation to make it working, otherwise, I have black screen...:

    I try kits QT 5.11.0 32 / MSVC 2015; QT 5.11.0 64 / MSVC 2015; QT 5.11.0 64 / MSVC 2017 same for all of them...

    main.cpp

    #include <QtWidgets/QApplication> // for MessageDialog
    #include <QtQuick/QQuickView>
    #include <q3dsruntimeglobal.h>
    #include <QSurfaceFormat>
    
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
    
        // Use the ideal format (i.e. OpenGL version and profile) recommended by
        // the Qt 3D Studio runtime. Without this the format set on the QQuickView
        // would be used instead.
      //QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat());
    
        QQuickView viewer;
        viewer.setSource(QUrl("qrc:/main.qml"));
        viewer.setTitle(QStringLiteral("Qt 3D Studio Example"));
        viewer.setResizeMode(QQuickView::SizeRootObjectToView);
        viewer.resize(1280, 720);
        viewer.show();
        return app.exec();
    }
    

    main.qml

    import QtQuick 2.0
    import QtStudio3D 2.0
    import QtQuick.Controls 2.2
    
    Rectangle{
        id: root
        color: "lightGray"
    
        Studio3D {
            focus: true
            anchors.margins: 60
            anchors.fill: parent
            Presentation {
                id:s3dpres
                source: "file:///F:/corvette_cluster_2018/corvette_cluster_2018.uip"
                profilingEnabled: true
                profileUiScale: profUiScale.value / 100
    
            }
    
        }
        Button {
            text: "Reload"
            onClicked: s3dpres.reload()
            focusPolicy: Qt.NoFocus
        }
    }
    

    Any idea to help me?

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

      Solve with replacing on project environment

      QT_OPENGL desktop in place of angle

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved