Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. Independent Developers
  4. qml application got crashed after adding chartview.
Forum Update on Monday, May 27th 2025

qml application got crashed after adding chartview.

Scheduled Pinned Locked Moved Solved Independent Developers
3 Posts 2 Posters 3.3k 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.
  • N Offline
    N Offline
    NIvil Wilson
    wrote on 15 Dec 2020, 14:00 last edited by
    #1

    sir,
    qml application got crashed after adding chartview.
    the code is given below.
    main.qml

    import QtQuick 2.12
    import QtQuick.Window 2.12
    import QtCharts 2.3
    
    Window {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")
    
        ChartView {
            width: 400
            height: 300
            theme: ChartView.ChartThemeBrownSand
            antialiasing: true
    
            PieSeries {
                id: pieSeries
                PieSlice { label: "eaten"; value: 94.9 }
                PieSlice { label: "not yet eaten"; value: 5.1 }
            }
        }
    
    
    }
    
    
    

    .pro file

    QT += quick charts
    
    CONFIG += c++11
    
    # The following define makes your compiler emit warnings if you use
    # any Qt feature that has been marked deprecated (the exact warnings
    # depend on your compiler). Refer to the documentation for the
    # deprecated API to know how to port your code away from it.
    DEFINES += QT_DEPRECATED_WARNINGS
    
    # You can also make your code fail to compile if it uses deprecated APIs.
    # In order to do so, uncomment the following line.
    # You can also select to disable deprecated APIs only up to a certain version of Qt.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    SOURCES += \
            main.cpp
    
    RESOURCES += qml.qrc
    
    # Additional import path used to resolve QML modules in Qt Creator's code model
    QML_IMPORT_PATH =
    
    # Additional import path used to resolve QML modules just for Qt Quick Designer
    QML_DESIGNER_IMPORT_PATH =
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    

    Application output

    19:19:54: Starting /home/nivilwilsonp/qt_workspace/build-untitled-Desktop_Qt_5_14_2_GCC_64bit-Debug/untitled ...
    QML debugging is enabled. Only use this in a safe environment.
    Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
    19:19:55: The program has unexpectedly finished.
    19:19:55: The process was ended forcefully.
    19:19:55: /home/nivilwilsonp/qt_workspace/build-untitled-Desktop_Qt_5_14_2_GCC_64bit-Debug/untitled crashed.

    O 1 Reply Last reply 15 Dec 2020, 16:00
    1
    • N NIvil Wilson
      15 Dec 2020, 14:00

      sir,
      qml application got crashed after adding chartview.
      the code is given below.
      main.qml

      import QtQuick 2.12
      import QtQuick.Window 2.12
      import QtCharts 2.3
      
      Window {
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")
      
          ChartView {
              width: 400
              height: 300
              theme: ChartView.ChartThemeBrownSand
              antialiasing: true
      
              PieSeries {
                  id: pieSeries
                  PieSlice { label: "eaten"; value: 94.9 }
                  PieSlice { label: "not yet eaten"; value: 5.1 }
              }
          }
      
      
      }
      
      
      

      .pro file

      QT += quick charts
      
      CONFIG += c++11
      
      # The following define makes your compiler emit warnings if you use
      # any Qt feature that has been marked deprecated (the exact warnings
      # depend on your compiler). Refer to the documentation for the
      # deprecated API to know how to port your code away from it.
      DEFINES += QT_DEPRECATED_WARNINGS
      
      # You can also make your code fail to compile if it uses deprecated APIs.
      # In order to do so, uncomment the following line.
      # You can also select to disable deprecated APIs only up to a certain version of Qt.
      #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
      
      SOURCES += \
              main.cpp
      
      RESOURCES += qml.qrc
      
      # Additional import path used to resolve QML modules in Qt Creator's code model
      QML_IMPORT_PATH =
      
      # Additional import path used to resolve QML modules just for Qt Quick Designer
      QML_DESIGNER_IMPORT_PATH =
      
      # Default rules for deployment.
      qnx: target.path = /tmp/$${TARGET}/bin
      else: unix:!android: target.path = /opt/$${TARGET}/bin
      !isEmpty(target.path): INSTALLS += target
      
      

      Application output

      19:19:54: Starting /home/nivilwilsonp/qt_workspace/build-untitled-Desktop_Qt_5_14_2_GCC_64bit-Debug/untitled ...
      QML debugging is enabled. Only use this in a safe environment.
      Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
      19:19:55: The program has unexpectedly finished.
      19:19:55: The process was ended forcefully.
      19:19:55: /home/nivilwilsonp/qt_workspace/build-untitled-Desktop_Qt_5_14_2_GCC_64bit-Debug/untitled crashed.

      O Offline
      O Offline
      ODБOï
      wrote on 15 Dec 2020, 16:00 last edited by
      #2

      @NIvil-Wilson hi

      Please read the note under the example here https://doc.qt.io/qt-5/qtcharts-qmlmodule.html
      Are you using QApplication or QGuiApplication ?

      N 1 Reply Last reply 16 Dec 2020, 06:16
      3
      • O ODБOï
        15 Dec 2020, 16:00

        @NIvil-Wilson hi

        Please read the note under the example here https://doc.qt.io/qt-5/qtcharts-qmlmodule.html
        Are you using QApplication or QGuiApplication ?

        N Offline
        N Offline
        NIvil Wilson
        wrote on 16 Dec 2020, 06:16 last edited by
        #3

        @LeLev
        sir,
        sorry for my ignorance and thank you for helping me .i usually use offfline documentation for application develepmemt.

        1 Reply Last reply
        1

        1/3

        15 Dec 2020, 14:00

        • Login

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