Qt Creator crashes after implementing any kind of charts in Qt Designer Studio Qml
-
Hi, I am creating a small desktop app where the design is made in design studio(qml) and some backend is created in C++. I tried to implement a bar chart in design studio which led to the crash of the program. I tried to add charts to the cmake file but gave the same result. Why could that be?
-
@Kiovtorov said in Qt Creator crashes after implementing any kind of charts in Qt Designer Studio Qml:
Hi, I am creating a small desktop app where the design is made in design studio(qml) and some backend is created in C++. I tried to implement a bar chart in design studio which led to the crash of the program. I tried to add charts to the cmake file but gave the same result. Why could that be?
I got a car with five seats, four tires and two doors.
What color is it?:D
Sorry but you need to provide a lil more information on what you are doing :)
From just knowing that you've created a QML/C++ app, nobody is able to help you :)So, please provide more context or some actual code which leads to the crash.
Also, define "App is crashing". What happens exactly? Any error message? -
No error message. I am not that good at debugging so excuse me .The debugger stopped at
void QWidgetTextControl::setCursorWidth(int width) { Q_D(QWidgetTextControl); if (width == -1) width = QApplication::style()->pixelMetric(QStyle::PM_TextCursorWidth, nullptr, qobject_cast<QWidget *>(parent())); d->doc->documentLayout()->setProperty("cursorWidth", width); d->repaintCursor(); }
esp this pat
width = QApplication::style()->pixelMetric(QStyle::PM_TextCursorWidth, nullptr, qobject_cast<QWidget *>(parent()));
-
@Pl45m4 The code is indeed inside qt library
the code that causes the crash isRectangle { id: rectangle_33 width: 918 height: 362 color: "#4dffffff" radius: 10 border.color: "#727272" border.width: 1 anchors.left: parent.left anchors.top: parent.top anchors.leftMargin: 28 anchors.topMargin: 453 ChartView { id: area x: 279 y: 62 width: 300 height: 300 AreaSeries { name: "AreaSeries" upperSeries: LineSeries { XYPoint { x: 0 y: 1.5 } XYPoint { x: 1 y: 3 } XYPoint { x: 3 y: 4.3 } XYPoint { x: 6 y: 1.1 } } } } }
There is no html or any styling. The files are .ui.qml generated from figma but they are not the problem. The app works perfect without the chart. And it only crashes in Qt Creator before the login page loads the dashboard page
logInButton.onClicked: { var username = usernameField.text; var password = passwordField.text; login.logInUser(username, password); login.logInSuccessful() { loader.source = "Dashboard.qml"; signInWindow.visible = false; } }
-
Found the answer in https://forum.qt.io/topic/70575/qt-charts-crash
In main.cpp you should change QGuiApplication to QApplication
QApplication app(argc, argv);
-