qml application got crashed after adding chartview.
-
sir,
qml application got crashed after adding chartview.
the code is given below.
main.qmlimport 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. -
Please read the note under the example here https://doc.qt.io/qt-5/qtcharts-qmlmodule.html
Are you using QApplication or QGuiApplication ? -
@LeLev
sir,
sorry for my ignorance and thank you for helping me .i usually use offfline documentation for application develepmemt.