From 2e1854c933cd1de50f62543fc3327bf1c483010d Mon Sep 17 00:00:00 2001 From: Brandon Taylor Date: Thu, 21 Nov 2024 19:57:57 +0000 Subject: [PATCH] fix --- CMakeLists.txt | 2 +- src/justly.cpp | 13 ++++++------- tests/CMakeLists.txt | 1 - 3 files changed, 7 insertions(+), 9 deletions(-) delete mode 100644 tests/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 6955aa4..42bb731 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -144,7 +144,7 @@ install_executable(Justly) if (BUILD_TESTS) qt_add_executable(JustlyTests) - add_subdirectory(tests) + target_sources(JustlyTests PRIVATE tests/test.cpp) target_include_directories(JustlyTests PRIVATE ${Justly_SOURCE_DIR}) target_link_libraries(JustlyTests PRIVATE diff --git a/src/justly.cpp b/src/justly.cpp index be14e09..e6fd054 100644 --- a/src/justly.cpp +++ b/src/justly.cpp @@ -3166,13 +3166,12 @@ struct PercussionInstrumentEditor : public NamedEditor { }; struct AbstractRationalEditor : public QFrame { - QSpinBox &numerator_box; - QSpinBox &denominator_box; - QHBoxLayout &row_layout; + QSpinBox &numerator_box = *(new QSpinBox); + QSpinBox &denominator_box = *(new QSpinBox); + QHBoxLayout &row_layout = *(new QHBoxLayout(this)); explicit AbstractRationalEditor(QWidget *parent_pointer) - : QFrame(parent_pointer), numerator_box(*(new QSpinBox)), - denominator_box(*(new QSpinBox)), row_layout(*(new QHBoxLayout(this))) { + : QFrame(parent_pointer) { setFrameStyle(QFrame::StyledPanel); setAutoFillBackground(true); @@ -3199,10 +3198,10 @@ struct IntervalEditor : public AbstractRationalEditor { Q_PROPERTY(Interval interval READ value WRITE setValue USER true) public: - QSpinBox &octave_box; + QSpinBox &octave_box = *(new QSpinBox); explicit IntervalEditor(QWidget *parent_pointer) - : AbstractRationalEditor(parent_pointer), octave_box(*(new QSpinBox)) { + : AbstractRationalEditor(parent_pointer) { octave_box.setMinimum(-MAX_OCTAVE); octave_box.setMaximum(MAX_OCTAVE); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt deleted file mode 100644 index 0a03fcc..0000000 --- a/tests/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -target_sources(JustlyTests PRIVATE test.cpp) \ No newline at end of file