diff --git a/src/AxisModel.qml b/src/AxisModel.qml index 7b552c0..c4a1209 100644 --- a/src/AxisModel.qml +++ b/src/AxisModel.qml @@ -3,7 +3,7 @@ import QtQuick import QtQuick3D -import com.projectdissolve +import ProjectDissolve Node { id: root diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f22e5e0..1b9160e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,9 +1,10 @@ qt_add_qml_module( - unnamed + QuickPlot URI - com.projectdissolve + ProjectDissolve VERSION 1.0 + STATIC SOURCES axis.h axis.cpp @@ -19,17 +20,16 @@ qt_add_qml_module( scatterGeometry.h triangle.cpp QML_FILES - main.qml AxisModel.qml LineModel.qml ScatterModel.qml) target_include_directories( - unnamed PRIVATE ${PROJECT_SOURCE_DIR}/lib ${PROJECT_BINARY_DIR}/lib + QuickPlot PRIVATE ${PROJECT_SOURCE_DIR}/lib ${PROJECT_BINARY_DIR}/lib ${Qt6Widgets_INCLUDE_DIRS} ${Qt6Quick3D_INCLUDE_DIRS}) target_link_libraries( - unnamed + QuickPlot PUBLIC ${WHOLE_ARCHIVE_FLAG} # External libs Qt6::Widgets @@ -39,12 +39,18 @@ target_link_libraries( Qt6::3DExtras Qt6::Quick) -set_target_properties(unnamed PROPERTIES PUBLIC_HEADER lineGeometry.h) +set_target_properties(QuickPlot PROPERTIES PUBLIC_HEADER lineGeometry.h) -install(TARGETS unnamed) +install(TARGETS QuickPlot) # Main target -add_executable(demo main.cpp ${demo_MOC_SRCS}) +qt_add_executable(demo main.cpp) +qt_add_qml_module(demo + VERSION 1.0 + URI PlotDemo + QML_FILES + main.qml +) target_include_directories( demo @@ -52,7 +58,7 @@ target_include_directories( ${PROJECT_SOURCE_DIR}/lib ${PROJECT_BINARY_DIR}/lib ${Qt6Widgets_INCLUDE_DIRS} ${Qt6Quick3D_INCLUDE_DIRS}) -target_link_libraries(demo PRIVATE unnamed Qt6::Widgets Qt6::Gui Qt6::Qml +target_link_libraries(demo PRIVATE QuickPlot QuickPlotplugin Qt6::Widgets Qt6::Gui Qt6::Qml Qt6::Core Qt6::Quick3D) set_target_properties(demo PROPERTIES RUNTIME demo) diff --git a/src/LineModel.qml b/src/LineModel.qml index 5da4a42..1116f40 100644 --- a/src/LineModel.qml +++ b/src/LineModel.qml @@ -3,7 +3,7 @@ import QtQuick import QtQuick3D -import com.projectdissolve +import ProjectDissolve Model { id: root diff --git a/src/ScatterModel.qml b/src/ScatterModel.qml index ba2133a..22e7fcd 100644 --- a/src/ScatterModel.qml +++ b/src/ScatterModel.qml @@ -3,7 +3,7 @@ import QtQuick import QtQuick3D -import com.projectdissolve +import ProjectDissolve Model { id: root diff --git a/src/axis.cpp b/src/axis.cpp index 21b1c36..5942347 100644 --- a/src/axis.cpp +++ b/src/axis.cpp @@ -134,5 +134,5 @@ void Axis::nudge(double delta) { minimum_ += delta; maximum_ += delta; - emit dataChanged(); + Q_EMIT(dataChanged()); } diff --git a/src/axis.h b/src/axis.h index d32815f..7e3e1c7 100644 --- a/src/axis.h +++ b/src/axis.h @@ -51,7 +51,7 @@ class Axis : public QQuick3DGeometry Q_SIGNALS: void dataChanged(); - public slots: + public Q_SLOTS: /** Shift the axis bounds by a given distance */ virtual void nudge(double delta); diff --git a/src/logAxis.cpp b/src/logAxis.cpp index 91de9d8..04424ee 100644 --- a/src/logAxis.cpp +++ b/src/logAxis.cpp @@ -76,5 +76,5 @@ void LogAxis::nudge(double delta) { minimum_ = pow(10.0, log10(minimum_) + delta); maximum_ = pow(10.0, log10(maximum_) + delta); - emit Axis::dataChanged(); + Q_EMIT(Axis::dataChanged()); } diff --git a/src/main.cpp b/src/main.cpp index 6394721..29728dd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4,13 +4,14 @@ #include "lineGeometry.h" #include #include +#include int main(int argc, char *argv[]) { QApplication app(argc, argv); QQmlApplicationEngine engine; - engine.load(QUrl(QStringLiteral("./src/main.qml"))); + engine.load(QUrl(QStringLiteral("qrc:/PlotDemo/main.qml"))); return app.exec(); } diff --git a/src/main.qml b/src/main.qml index ee7c920..9ca6291 100644 --- a/src/main.qml +++ b/src/main.qml @@ -7,7 +7,8 @@ import QtQuick.Dialogs import QtQuick3D import QtQuick3D.Helpers import QtQuick.Controls -import com.projectdissolve +import ProjectDissolve +import "../ProjectDissolve" ApplicationWindow { id: root diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 50d4bb0..d7015af 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -12,7 +12,7 @@ target_include_directories( ${Qt6Widgets_INCLUDE_DIRS} ${Qt6Quick3D_INCLUDE_DIRS}) target_link_libraries( axis - PUBLIC unnamed + PUBLIC QuickPlot PRIVATE # External libs GTest::gtest_main Qt6::Core Qt6::Quick3D)