Exception with ChartView and ApplicationWindow



  • Hi,
    when I use a ChartView in an ApplicationWindow, I get an exception when closing the application:

    import QtQuick 2.10
    import QtQuick.Window 2.10
    import QtQuick.Controls 2.3
    import QtCharts 2.2
    
    Window { // works fine
    //ApplicationWindow { // exception
        visible: true
        width: 640
        height: 480
    
        ChartView {
            id: chart
            anchors.fill: parent
    
            SplineSeries {
                XYPoint { x: 0; y: 0.0 }
                XYPoint { x: 1.1; y: 3.2 }
                XYPoint { x: 1.9; y: 2.4 }
                XYPoint { x: 2.1; y: 2.1 }
                XYPoint { x: 2.9; y: 2.6 }
                XYPoint { x: 3.4; y: 2.3 }
                XYPoint { x: 4.1; y: 3.1 }
            }
        }
    }
    

    The debugger stops here:

    void QQmlContextData::ContextGuard::objectDestroyed(QObject *)
    {
        if (context->contextObject && !QObjectPrivate::get(context->contextObject)->wasDeleted) // stop
            bindings.notify();
    }
    

    If I use a Window instead of ApplicationWindow the application closes without any exception. I'm using Qt5.10 with MSVC2017.

    The application also closes successfully with ApplicationWindow, if I don't use a Series:

    import QtQuick 2.10
    import QtQuick.Window 2.10
    import QtQuick.Controls 2.3
    import QtCharts 2.2
    
    ApplicationWindow {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")
    
        ChartView {
            id: chart
            anchors.fill: parent
    
    // Closes without problems
    //        SplineSeries {
    //            id: pieSeries
    //            XYPoint { x: 0; y: 0.0 }
    //            XYPoint { x: 1.1; y: 3.2 }
    //            XYPoint { x: 1.9; y: 2.4 }
    //            XYPoint { x: 2.1; y: 2.1 }
    //            XYPoint { x: 2.9; y: 2.6 }
    //            XYPoint { x: 3.4; y: 2.3 }
    //            XYPoint { x: 4.1; y: 3.1 }
    //        }
        }
    }
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.