From 61eab013f6587e058c375df939e4954aa12991c0 Mon Sep 17 00:00:00 2001 From: emimvi Date: Tue, 2 Jul 2024 15:15:26 +0200 Subject: [PATCH] Fix QtCharts segfaulting QtCharts seems to be using QWidget internally. Add Widgets as a dependency and initialize using QApplication --- CMakeLists.txt | 1 + src/CMakeLists.txt | 1 + src/main.cpp | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f66b31f..bb9090d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,7 @@ find_package(Qt6 REQUIRED Qml Quick QuickControls2 + Widgets ) qt_standard_project_setup() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ca8c3f9..a72957f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -25,6 +25,7 @@ target_link_libraries(qhot Qt6::Gui Qt6::Qml Qt6::QuickControls2 + Qt6::Widgets ) get_target_property(QT_MOC_EXECUTABLE Qt6::moc IMPORTED_LOCATION) diff --git a/src/main.cpp b/src/main.cpp index f581e78..86581cd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,10 +2,10 @@ #include "providessomething.h" #include "urlinterceptor.h" +#include #include #include #include -#include #include int main(int argc, char *argv[]) @@ -13,7 +13,7 @@ int main(int argc, char *argv[]) qmlRegisterSingletonType("ProvidesSomething", 1, 0, "ProvidesSomething", ProvidesSomething::qmlSingletonRegister); - QGuiApplication app(argc, argv); + QApplication app(argc, argv); app.setOrganizationDomain("patrickelectric.work"); app.setOrganizationName("patrickelectric"); CommandLineParser commandLineParser(argc, argv);