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. Surface3D closing error
Forum Updated to NodeBB v4.3 + New Features

Surface3D closing error

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 249 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.
  • beeckscheB Offline
    beeckscheB Offline
    beecksche
    wrote on last edited by beecksche
    #1

    Hi,
    when i'm using the Surface3D class and want to close the application it crashes and gives the message:

    Attempting to create QWindow-based QOffscreenSurface outside the gui thread. Expect failures.

    System: Qt 5.12.0, MSVC2017_x86, Win10

    Here is the code:

    main.qml

    import QtQuick 2.12
    import QtQuick.Window 2.12
    import QtDataVisualization 1.2
    
    Window {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")
    
        Surface3D {
            anchors.fill: parent
            Surface3DSeries {
                itemLabelFormat: "Pop density at (@xLabel N, @zLabel E): @yLabel"
                ItemModelSurfaceDataProxy {
                    itemModel: dataModel
                    // Mapping model roles to surface series rows, columns, and values.
                    rowRole: "longitude"
                    columnRole: "latitude"
                    yPosRole: "pop_density"
                }
            }
        }
        ListModel {
            id: dataModel
            ListElement{ longitude: "20"; latitude: "10"; pop_density: "4.75"; }
            ListElement{ longitude: "21"; latitude: "10"; pop_density: "3.00"; }
            ListElement{ longitude: "22"; latitude: "10"; pop_density: "1.24"; }
            ListElement{ longitude: "23"; latitude: "10"; pop_density: "2.53"; }
            ListElement{ longitude: "20"; latitude: "11"; pop_density: "2.55"; }
            ListElement{ longitude: "21"; latitude: "11"; pop_density: "2.03"; }
            ListElement{ longitude: "22"; latitude: "11"; pop_density: "3.46"; }
            ListElement{ longitude: "23"; latitude: "11"; pop_density: "5.12"; }
            ListElement{ longitude: "20"; latitude: "12"; pop_density: "1.37"; }
            ListElement{ longitude: "21"; latitude: "12"; pop_density: "2.98"; }
            ListElement{ longitude: "22"; latitude: "12"; pop_density: "3.33"; }
            ListElement{ longitude: "23"; latitude: "12"; pop_density: "3.23"; }
            ListElement{ longitude: "20"; latitude: "13"; pop_density: "4.34"; }
            ListElement{ longitude: "21"; latitude: "13"; pop_density: "3.54"; }
            ListElement{ longitude: "22"; latitude: "13"; pop_density: "1.65"; }
            ListElement{ longitude: "23"; latitude: "13"; pop_density: "2.67"; }
        }
    }
    

    main.cpp

    #include <QGuiApplication>
    #include <QQmlApplicationEngine>
    
    int main(int argc, char *argv[])
    {
        QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
    
        QGuiApplication app(argc, argv);
    
        QQmlApplicationEngine engine;
        engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
        if (engine.rootObjects().isEmpty())
            return -1;
    
        return app.exec();
    }
    

    Bug report: https://bugreports.qt.io/browse/QTBUG-73163

    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