Skip to content

Commit

Permalink
Fix QtCharts segfaulting
Browse files Browse the repository at this point in the history
QtCharts seems to be using QWidget internally. Add Widgets as a dependency and initialize
using QApplication
  • Loading branch information
emimvi authored and patrickelectric committed Nov 22, 2024
1 parent 9f515c6 commit 61eab01
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ find_package(Qt6 REQUIRED
Qml
Quick
QuickControls2
Widgets
)
qt_standard_project_setup()

Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
#include "providessomething.h"
#include "urlinterceptor.h"

#include <QApplication>
#include <QtCore/QDebug>
#include <QtCore/QDir>
#include <QtCore/QFile>
#include <QtGui/QGuiApplication>
#include <QtQml/QQmlApplicationEngine>

int main(int argc, char *argv[])
{
qmlRegisterSingletonType<ProvidesSomething>("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);
Expand Down

0 comments on commit 61eab01

Please sign in to comment.