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. Exception with ChartView and ApplicationWindow

Exception with ChartView and ApplicationWindow

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

    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 }
    //        }
        }
    }
    
    1 Reply Last reply
    0
    • Y Offline
      Y Offline
      YvesS
      wrote on last edited by
      #2

      I encountered the same problem. Did someone have a solution ?

      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