From bc2e34b01b7b1633c58c63ad9fe9dca82dbd74d7 Mon Sep 17 00:00:00 2001 From: Sami Varanka Date: Mon, 6 Jun 2022 14:19:03 +0300 Subject: Fix manual test compilation errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Many of the manual tests were not compiling, because many of the signals and slots had not compatible signatures. Pick-to: 6.4 6.3 6.2 Change-Id: Ibd881e5cca37ec666cb160c95b948e064ac09e5d Reviewed-by: Tomi Korpipää --- tests/manual/barstest/CMakeLists.txt | 2 + tests/manual/barstest/buttonwrapper.cpp | 40 +++++++++++ tests/manual/barstest/buttonwrapper.h | 48 ++++++++++++++ tests/manual/barstest/chart.cpp | 24 +++---- tests/manual/barstest/chart.h | 26 ++++---- tests/manual/barstest/main.cpp | 99 +++++++++++++++++----------- tests/manual/barstest/sliderwrapper.cpp | 39 +++++++++++ tests/manual/barstest/sliderwrapper.h | 49 ++++++++++++++ tests/manual/scattertest/scatterchart.cpp | 12 ++-- tests/manual/scattertest/scatterchart.h | 12 ++-- tests/manual/surfacetest/CMakeLists.txt | 2 + tests/manual/surfacetest/buttonwrapper.cpp | 40 +++++++++++ tests/manual/surfacetest/buttonwrapper.h | 48 ++++++++++++++ tests/manual/surfacetest/checkboxwrapper.cpp | 40 +++++++++++ tests/manual/surfacetest/checkboxwrapper.h | 49 ++++++++++++++ tests/manual/surfacetest/graphmodifier.cpp | 56 ++++++++-------- tests/manual/surfacetest/graphmodifier.h | 56 ++++++++-------- tests/manual/surfacetest/main.cpp | 51 +++++++++----- 18 files changed, 546 insertions(+), 147 deletions(-) create mode 100644 tests/manual/barstest/buttonwrapper.cpp create mode 100644 tests/manual/barstest/buttonwrapper.h create mode 100644 tests/manual/barstest/sliderwrapper.cpp create mode 100644 tests/manual/barstest/sliderwrapper.h create mode 100644 tests/manual/surfacetest/buttonwrapper.cpp create mode 100644 tests/manual/surfacetest/buttonwrapper.h create mode 100644 tests/manual/surfacetest/checkboxwrapper.cpp create mode 100644 tests/manual/surfacetest/checkboxwrapper.h diff --git a/tests/manual/barstest/CMakeLists.txt b/tests/manual/barstest/CMakeLists.txt index 8c4c9295..2d268023 100644 --- a/tests/manual/barstest/CMakeLists.txt +++ b/tests/manual/barstest/CMakeLists.txt @@ -7,6 +7,8 @@ qt_internal_add_manual_test(barstest GUI SOURCES chart.cpp chart.h + sliderwrapper.cpp sliderwrapper.h + buttonwrapper.cpp buttonwrapper.h custominputhandler.cpp custominputhandler.h main.cpp ) diff --git a/tests/manual/barstest/buttonwrapper.cpp b/tests/manual/barstest/buttonwrapper.cpp new file mode 100644 index 00000000..e1098fe9 --- /dev/null +++ b/tests/manual/barstest/buttonwrapper.cpp @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Data Visualization module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "buttonwrapper.h" +#include + +ButtonWrapper::ButtonWrapper(QPushButton *button) +{ + m_button = button; +} + +void ButtonWrapper::setEnabled(int state) +{ + m_button->setEnabled(state); +} diff --git a/tests/manual/barstest/buttonwrapper.h b/tests/manual/barstest/buttonwrapper.h new file mode 100644 index 00000000..f3f40c7b --- /dev/null +++ b/tests/manual/barstest/buttonwrapper.h @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Data Visualization module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BUTTONWRAPPER_H +#define BUTTONWRAPPER_H + +#include +class QPushButton; + +class ButtonWrapper : public QObject +{ + Q_OBJECT +public: + ButtonWrapper(QPushButton *button); + +public Q_SLOTS: + void setEnabled(int state); + +private: + QPushButton *m_button; +}; + +#endif // BUTTONWRAPPER_H diff --git a/tests/manual/barstest/chart.cpp b/tests/manual/barstest/chart.cpp index 4f006024..51ec95e4 100644 --- a/tests/manual/barstest/chart.cpp +++ b/tests/manual/barstest/chart.cpp @@ -268,7 +268,7 @@ void GraphModifier::start() restart(false); } -void GraphModifier::restart(bool dynamicData) +void GraphModifier::restart(int dynamicData) { m_static = !dynamicData; @@ -343,7 +343,7 @@ void GraphModifier::releaseSeries() m_graph->removeSeries(series); } -void GraphModifier::flipViews() +void GraphModifier::flipViews(bool checked) { m_graph->scene()->setSecondarySubviewOnTop(!m_graph->scene()->isSecondarySubviewOnTop()); qDebug() << "secondary subview on top:" << m_graph->scene()->isSecondarySubviewOnTop(); @@ -735,7 +735,7 @@ void GraphModifier::handleSelectionChange(const QPoint &position) qDebug() << "Selected bar position:" << position << "series:" << index; } -void GraphModifier::setUseNullInputHandler(bool useNull) +void GraphModifier::setUseNullInputHandler(int useNull) { qDebug() << "setUseNullInputHandler" << useNull; if (m_useNullInputHandler == useNull) @@ -828,7 +828,7 @@ QBarDataArray *GraphModifier::makeDummyData() } // Executes one step of the primary series test -void GraphModifier::primarySeriesTest() +void GraphModifier::primarySeriesTest(bool checked) { static int nextStep = 0; @@ -1050,7 +1050,7 @@ void GraphModifier::insertRemoveTestToggle() } } -void GraphModifier::toggleRotation() +void GraphModifier::toggleRotation(bool checked) { if (m_rotationTimer.isActive()) m_rotationTimer.stop(); @@ -1058,7 +1058,7 @@ void GraphModifier::toggleRotation() m_rotationTimer.start(20); } -void GraphModifier::useLogAxis() +void GraphModifier::useLogAxis(bool checked) { static int counter = -1; static QLogValue3DAxisFormatter *logFormatter = 0; @@ -1214,7 +1214,7 @@ void GraphModifier::addRemoveSeries() counter++; } -void GraphModifier::testItemAndRowChanges() +void GraphModifier::testItemAndRowChanges(bool checked) { static int counter = 0; const int rowCount = 12; @@ -1604,7 +1604,7 @@ void GraphModifier::rotateY(int rotation) m_graph->scene()->activeCamera()->setCameraPosition(m_xRotation, m_yRotation); } -void GraphModifier::setFpsMeasurement(bool enable) +void GraphModifier::setFpsMeasurement(int enable) { m_graph->setMeasureFps(enable); } @@ -1673,7 +1673,7 @@ void GraphModifier::setMaxY(int max) m_maxval = max; } -void GraphModifier::changeColorStyle() +void GraphModifier::changeColorStyle(bool checked) { int style = m_graph->activeTheme()->colorStyle(); @@ -1683,7 +1683,7 @@ void GraphModifier::changeColorStyle() m_graph->activeTheme()->setColorStyle(Q3DTheme::ColorStyle(style)); } -void GraphModifier::useOwnTheme() +void GraphModifier::useOwnTheme(bool checked) { // Own theme is persistent, any changes to it via UI will be remembered if (!m_ownTheme) { @@ -1722,7 +1722,7 @@ void GraphModifier::changeBaseColor(const QColor &color) m_graph->activeTheme()->setBaseColors(colors); } -void GraphModifier::setGradient() +void GraphModifier::setGradient(bool checked) { QLinearGradient barGradient(0, 0, 1, 100); barGradient.setColorAt(1.0, Qt::lightGray); @@ -1762,7 +1762,7 @@ void GraphModifier::toggleMultiseriesScaling() m_graph->setMultiSeriesUniform(!m_graph->isMultiSeriesUniform()); } -void GraphModifier::setReflection(bool enabled) +void GraphModifier::setReflection(int enabled) { m_graph->setReflection(enabled); } diff --git a/tests/manual/barstest/chart.h b/tests/manual/barstest/chart.h index dabaa5e2..afbec86d 100644 --- a/tests/manual/barstest/chart.h +++ b/tests/manual/barstest/chart.h @@ -68,7 +68,7 @@ public: void changeFontSize(int fontsize); void rotateX(int rotation); void rotateY(int rotation); - void setFpsMeasurement(bool enable); + void setFpsMeasurement(int state); void setBackgroundEnabled(int enabled); void setGridEnabled(int enabled); void setSpecsRatio(int barwidth); @@ -84,43 +84,43 @@ public: void setMinY(int min); void setMaxY(int max); void start(); - void restart(bool dynamicData); + void restart(int dynamicData); void selectBar(); void swapAxis(); void releaseAxes(); void releaseSeries(); void createMassiveArray(); - void useOwnTheme(); + void useOwnTheme(bool checked); void changeBaseColor(const QColor &color); - void changeColorStyle(); + void changeColorStyle(bool checked); void showFiveSeries(); QBarDataArray *makeDummyData(); - void primarySeriesTest(); + void primarySeriesTest(bool checked); void insertRemoveTestToggle(); - void toggleRotation(); - void useLogAxis(); + void toggleRotation(bool checked); + void useLogAxis(bool checked); void changeValueAxisFormat(const QString & text); void changeLogBase(const QString & text); void setFpsLabel(QLabel *fpsLabel) { m_fpsLabel = fpsLabel; } void addRemoveSeries(); - void testItemAndRowChanges(); + void testItemAndRowChanges(bool checked); void reverseValueAxis(int enabled); void setInputHandlerRotationEnabled(int enabled); void setInputHandlerZoomEnabled(int enabled); void setInputHandlerSelectionEnabled(int enabled); void setInputHandlerZoomAtTargetEnabled(int enabled); - void setReflection(bool enabled); + void setReflection(int enabled); void setReflectivity(int value); void toggleCustomItem(); public Q_SLOTS: - void flipViews(); - void setGradient(); + void flipViews(bool checked); + void setGradient(bool checked); void toggleMultiseriesScaling(); void changeShadowQuality(int quality); void shadowQualityUpdatedByVisual(QAbstract3DGraph::ShadowQuality shadowQuality); void handleSelectionChange(const QPoint &position); - void setUseNullInputHandler(bool useNull); + void setUseNullInputHandler(int useNull); void changeValueAxisSegments(int value); void handleRowAxisChanged(QCategory3DAxis *axis); @@ -152,7 +152,7 @@ private: int m_rowCount; float m_xRotation; float m_yRotation; - bool m_static; + int m_static; float m_barSpacingX; float m_barSpacingZ; float m_barSeriesMarginX; diff --git a/tests/manual/barstest/main.cpp b/tests/manual/barstest/main.cpp index 1b14d08d..0fe90c9c 100644 --- a/tests/manual/barstest/main.cpp +++ b/tests/manual/barstest/main.cpp @@ -28,6 +28,8 @@ ****************************************************************************/ #include "chart.h" +#include "sliderwrapper.h" +#include "buttonwrapper.h" #include #include @@ -613,12 +615,14 @@ int main(int argc, char **argv) QObject::connect(rotationCheckBox, &QCheckBox::stateChanged, modifier, &GraphModifier::setUseNullInputHandler); - QObject::connect(rotationCheckBox, &QCheckBox::stateChanged, rotationSliderX, - &QSlider::setEnabled); + SliderWrapper *rotationSliderWrapperX = new SliderWrapper(rotationSliderX); + SliderWrapper *rotationSliderWrapperY = new SliderWrapper(rotationSliderY); + QObject::connect(rotationCheckBox, &QCheckBox::stateChanged, rotationSliderWrapperX, + &SliderWrapper::setEnabled); QObject::connect(rotationCheckBox, &QCheckBox::stateChanged, rotationSliderX, &QSlider::setValue); - QObject::connect(rotationCheckBox, &QCheckBox::stateChanged, rotationSliderY, - &QSlider::setEnabled); + QObject::connect(rotationCheckBox, &QCheckBox::stateChanged, rotationSliderWrapperY, + &SliderWrapper::setEnabled); QObject::connect(rotationCheckBox, &QCheckBox::stateChanged, rotationSliderY, &QSlider::setValue); @@ -633,40 +637,59 @@ int main(int argc, char **argv) QObject::connect(toggleCustomItemButton, &QPushButton::clicked, modifier, &GraphModifier::toggleCustomItem); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, addDataButton, - &QPushButton::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, addMultiDataButton, - &QPushButton::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, insertDataButton, - &QPushButton::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, insertMultiDataButton, - &QPushButton::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, changeSingleDataButton, - &QPushButton::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, changeRowButton, - &QPushButton::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, changeRowsButton, - &QPushButton::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, removeRowButton, - &QPushButton::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, removeRowsButton, - &QPushButton::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, massiveArrayButton, - &QPushButton::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, sampleSliderX, - &QSlider::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, sampleSliderZ, - &QSlider::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, minSliderX, - &QSlider::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, minSliderZ, - &QSlider::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, minSliderY, - &QSlider::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, maxSliderY, - &QSlider::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, swapAxisButton, - &QSlider::setEnabled); + ButtonWrapper *addDataButtonWrapper = new ButtonWrapper(addDataButton); + ButtonWrapper *addMultiDataButtonWrapper = new ButtonWrapper(addMultiDataButton); + ButtonWrapper *insertDataButtonWrapper = new ButtonWrapper(insertDataButton); + ButtonWrapper *insertMultiDataButtonWrapper = new ButtonWrapper(insertMultiDataButton); + ButtonWrapper *changeSingleDataButtonWrapper = new ButtonWrapper(changeSingleDataButton); + ButtonWrapper *changeRowButtonWrapper = new ButtonWrapper(changeRowButton); + ButtonWrapper *changeRowsButtonWrapper = new ButtonWrapper(changeRowsButton); + ButtonWrapper *massiveArrayButtonWrapper = new ButtonWrapper(massiveArrayButton); + ButtonWrapper *removeRowButtonWrapper = new ButtonWrapper(removeRowButton); + ButtonWrapper *removeRowsButtonWrapper = new ButtonWrapper(removeRowsButton); + + SliderWrapper *sampleSliderWrapperX = new SliderWrapper(sampleSliderX); + SliderWrapper *sampleSliderWrapperZ = new SliderWrapper(sampleSliderZ); + SliderWrapper *minSliderWrapperX = new SliderWrapper(minSliderX); + SliderWrapper *minSliderWrapperZ = new SliderWrapper(minSliderZ); + SliderWrapper *minSliderWrapperY = new SliderWrapper(minSliderY); + SliderWrapper *maxSliderWrapperY = new SliderWrapper(maxSliderY); + ButtonWrapper *swapAxisButtonWrapper = new ButtonWrapper(swapAxisButton); + + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, addDataButtonWrapper, + &ButtonWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, addMultiDataButtonWrapper, + &ButtonWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, insertDataButtonWrapper, + &ButtonWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, insertMultiDataButtonWrapper, + &ButtonWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, changeSingleDataButtonWrapper, + &ButtonWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, changeRowButtonWrapper, + &ButtonWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, changeRowsButtonWrapper, + &ButtonWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, removeRowButtonWrapper, + &ButtonWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, removeRowsButtonWrapper, + &ButtonWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, massiveArrayButtonWrapper, + &ButtonWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, sampleSliderWrapperX, + &SliderWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, sampleSliderWrapperZ, + &SliderWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, minSliderWrapperX, + &SliderWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, minSliderWrapperZ, + &SliderWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, minSliderWrapperY, + &SliderWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, maxSliderWrapperY, + &SliderWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, swapAxisButtonWrapper, + &ButtonWrapper::setEnabled); QObject::connect(staticCheckBox, &QCheckBox::stateChanged, modifier, &GraphModifier::restart); modifier->setFpsLabel(fpsLabel); diff --git a/tests/manual/barstest/sliderwrapper.cpp b/tests/manual/barstest/sliderwrapper.cpp new file mode 100644 index 00000000..652f766c --- /dev/null +++ b/tests/manual/barstest/sliderwrapper.cpp @@ -0,0 +1,39 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Data Visualization module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "sliderwrapper.h" + +SliderWrapper::SliderWrapper(QSlider *slider) +{ + m_slider = slider; +} + +void SliderWrapper::setEnabled(int enabled) +{ + m_slider->setEnabled(enabled); +} diff --git a/tests/manual/barstest/sliderwrapper.h b/tests/manual/barstest/sliderwrapper.h new file mode 100644 index 00000000..38136490 --- /dev/null +++ b/tests/manual/barstest/sliderwrapper.h @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Data Visualization module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef SLIDERWRAPPER_H +#define SLIDERWRAPPER_H +#include +#include + +class SliderWrapper : public QObject +{ + Q_OBJECT + +public: + explicit SliderWrapper(QSlider *slider); + +public Q_SLOTS: + void setEnabled(int enabled); + +private: + QSlider *m_slider = nullptr; + +}; + +#endif // SLIDERWRAPPER_H diff --git a/tests/manual/scattertest/scatterchart.cpp b/tests/manual/scattertest/scatterchart.cpp index ca8414ac..7f056aa5 100644 --- a/tests/manual/scattertest/scatterchart.cpp +++ b/tests/manual/scattertest/scatterchart.cpp @@ -244,7 +244,7 @@ void ScatterDataModifier::massiveTestAppendAndScroll() m_chart->axisZ()->setRange(min, max); } -void ScatterDataModifier::setFpsMeasurement(bool enable) +void ScatterDataModifier::setFpsMeasurement(int enable) { m_chart->setMeasureFps(enable); } @@ -973,14 +973,14 @@ void ScatterDataModifier::changeRadialLabelOffset(int offset) m_chart->setRadialLabelOffset(float(offset) / 100.0f); } -void ScatterDataModifier::toggleAxisTitleVisibility(bool enabled) +void ScatterDataModifier::toggleAxisTitleVisibility(int enabled) { m_chart->axisX()->setTitleVisible(enabled); m_chart->axisY()->setTitleVisible(enabled); m_chart->axisZ()->setTitleVisible(enabled); } -void ScatterDataModifier::toggleAxisTitleFixed(bool enabled) +void ScatterDataModifier::toggleAxisTitleFixed(int enabled) { m_chart->axisX()->setTitleFixed(enabled); m_chart->axisY()->setTitleFixed(enabled); @@ -1009,12 +1009,12 @@ void ScatterDataModifier::renderToImage() } } -void ScatterDataModifier::togglePolar(bool enable) +void ScatterDataModifier::togglePolar(int enable) { m_chart->setPolar(enable); } -void ScatterDataModifier::toggleStatic(bool enable) +void ScatterDataModifier::toggleStatic(int enable) { if (enable) m_chart->setOptimizationHints(QAbstract3DGraph::OptimizationStatic); @@ -1022,7 +1022,7 @@ void ScatterDataModifier::toggleStatic(bool enable) m_chart->setOptimizationHints(QAbstract3DGraph::OptimizationDefault); } -void ScatterDataModifier::toggleOrtho(bool enable) +void ScatterDataModifier::toggleOrtho(int enable) { m_chart->setOrthoProjection(enable); } diff --git a/tests/manual/scattertest/scatterchart.h b/tests/manual/scattertest/scatterchart.h index 43fabeac..bf1f060c 100644 --- a/tests/manual/scattertest/scatterchart.h +++ b/tests/manual/scattertest/scatterchart.h @@ -67,7 +67,7 @@ public: void massiveDataTest(); void massiveTestScroll(); void massiveTestAppendAndScroll(); - void setFpsMeasurement(bool enable); + void setFpsMeasurement(int enable); void setFpsLabel(QLabel *fpsLabel) { m_fpsLabel = fpsLabel; } void testItemChanges(); void testAxisReverse(); @@ -101,12 +101,12 @@ public Q_SLOTS: void handleFpsChange(qreal fps); void changeLabelRotation(int rotation); void changeRadialLabelOffset(int offset); - void toggleAxisTitleVisibility(bool enabled); - void toggleAxisTitleFixed(bool enabled); + void toggleAxisTitleVisibility(int enabled); + void toggleAxisTitleFixed(int enabled); void renderToImage(); - void togglePolar(bool enable); - void toggleStatic(bool enable); - void toggleOrtho(bool enable); + void togglePolar(int enable); + void toggleStatic(int enable); + void toggleOrtho(int enable); void setCameraTargetX(int value); void setCameraTargetY(int value); void setCameraTargetZ(int value); diff --git a/tests/manual/surfacetest/CMakeLists.txt b/tests/manual/surfacetest/CMakeLists.txt index c59f9488..a1e68d25 100644 --- a/tests/manual/surfacetest/CMakeLists.txt +++ b/tests/manual/surfacetest/CMakeLists.txt @@ -6,6 +6,8 @@ set(CMAKE_AUTOUIC ON) qt_internal_add_manual_test(surfacetest GUI SOURCES + buttonwrapper.cpp buttonwrapper.h + checkboxwrapper.cpp checkboxwrapper.h graphmodifier.cpp graphmodifier.h main.cpp ) diff --git a/tests/manual/surfacetest/buttonwrapper.cpp b/tests/manual/surfacetest/buttonwrapper.cpp new file mode 100644 index 00000000..e1098fe9 --- /dev/null +++ b/tests/manual/surfacetest/buttonwrapper.cpp @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Data Visualization module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "buttonwrapper.h" +#include + +ButtonWrapper::ButtonWrapper(QPushButton *button) +{ + m_button = button; +} + +void ButtonWrapper::setEnabled(int state) +{ + m_button->setEnabled(state); +} diff --git a/tests/manual/surfacetest/buttonwrapper.h b/tests/manual/surfacetest/buttonwrapper.h new file mode 100644 index 00000000..f3f40c7b --- /dev/null +++ b/tests/manual/surfacetest/buttonwrapper.h @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Data Visualization module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BUTTONWRAPPER_H +#define BUTTONWRAPPER_H + +#include +class QPushButton; + +class ButtonWrapper : public QObject +{ + Q_OBJECT +public: + ButtonWrapper(QPushButton *button); + +public Q_SLOTS: + void setEnabled(int state); + +private: + QPushButton *m_button; +}; + +#endif // BUTTONWRAPPER_H diff --git a/tests/manual/surfacetest/checkboxwrapper.cpp b/tests/manual/surfacetest/checkboxwrapper.cpp new file mode 100644 index 00000000..3ee7548b --- /dev/null +++ b/tests/manual/surfacetest/checkboxwrapper.cpp @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Data Visualization module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "checkboxwrapper.h" +#include + +CheckBoxWrapper::CheckBoxWrapper(QCheckBox *cb) +{ + m_checkbox = cb; +} + +void CheckBoxWrapper::setEnabled(int enabled) +{ + m_checkbox->setEnabled(enabled); +} diff --git a/tests/manual/surfacetest/checkboxwrapper.h b/tests/manual/surfacetest/checkboxwrapper.h new file mode 100644 index 00000000..d0dda7ba --- /dev/null +++ b/tests/manual/surfacetest/checkboxwrapper.h @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Data Visualization module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef CHECKBOXWRAPPER_H +#define CHECKBOXWRAPPER_H + +#include + +class QCheckBox; + +class CheckBoxWrapper : public QObject +{ + Q_OBJECT +public: + explicit CheckBoxWrapper(QCheckBox *cb); + +public Q_SLOTS: + void setEnabled(int enabled); + +private: + QCheckBox *m_checkbox; +}; + +#endif // CHECKBOXWRAPPER_H diff --git a/tests/manual/surfacetest/graphmodifier.cpp b/tests/manual/surfacetest/graphmodifier.cpp index 76c5afb9..01999ee0 100644 --- a/tests/manual/surfacetest/graphmodifier.cpp +++ b/tests/manual/surfacetest/graphmodifier.cpp @@ -193,7 +193,7 @@ void GraphModifier::fillSeries() m_multiseries[3]->dataProxy()->resetArray(dataArray4); } -void GraphModifier::toggleSeries1(bool enabled) +void GraphModifier::toggleSeries1(int enabled) { qDebug() << __FUNCTION__ << " enabled = " << enabled; @@ -204,7 +204,7 @@ void GraphModifier::toggleSeries1(bool enabled) } } -void GraphModifier::toggleSeries2(bool enabled) +void GraphModifier::toggleSeries2(int enabled) { qDebug() << __FUNCTION__ << " enabled = " << enabled; @@ -215,7 +215,7 @@ void GraphModifier::toggleSeries2(bool enabled) } } -void GraphModifier::toggleSeries3(bool enabled) +void GraphModifier::toggleSeries3(int enabled) { qDebug() << __FUNCTION__ << " enabled = " << enabled; @@ -226,7 +226,7 @@ void GraphModifier::toggleSeries3(bool enabled) } } -void GraphModifier::toggleSeries4(bool enabled) +void GraphModifier::toggleSeries4(int enabled) { qDebug() << __FUNCTION__ << " enabled = " << enabled; @@ -237,7 +237,7 @@ void GraphModifier::toggleSeries4(bool enabled) } } -void GraphModifier::toggleSmooth(bool enabled) +void GraphModifier::toggleSmooth(int enabled) { qDebug() << "GraphModifier::toggleSmooth " << enabled; m_theSeries->setFlatShadingEnabled(enabled); @@ -246,7 +246,7 @@ void GraphModifier::toggleSmooth(bool enabled) #endif } -void GraphModifier::toggleSurfaceGrid(bool enable) +void GraphModifier::toggleSurfaceGrid(int enable) { qDebug() << "GraphModifier::toggleSurfaceGrid" << enable; if (enable) @@ -260,7 +260,7 @@ void GraphModifier::toggleSurfaceGrid(bool enable) #endif } -void GraphModifier::toggleSurface(bool enable) +void GraphModifier::toggleSurface(int enable) { qDebug() << "GraphModifier::toggleSurface" << enable; if (enable) @@ -274,7 +274,7 @@ void GraphModifier::toggleSurface(bool enable) #endif } -void GraphModifier::toggleSeriesVisible(bool enable) +void GraphModifier::toggleSeriesVisible(int enable) { m_theSeries->setVisible(enable); #ifdef MULTI_SERIES @@ -282,13 +282,13 @@ void GraphModifier::toggleSeriesVisible(bool enable) #endif } -void GraphModifier::toggleSmoothS2(bool enabled) +void GraphModifier::toggleSmoothS2(int enabled) { qDebug() << __FUNCTION__ << enabled; m_multiseries[1]->setFlatShadingEnabled(enabled); } -void GraphModifier::toggleSurfaceGridS2(bool enable) +void GraphModifier::toggleSurfaceGridS2(int enable) { qDebug() << __FUNCTION__ << enable; if (enable) @@ -299,7 +299,7 @@ void GraphModifier::toggleSurfaceGridS2(bool enable) m_multiseries[1]->setDrawMode(m_drawMode2); } -void GraphModifier::toggleSurfaceS2(bool enable) +void GraphModifier::toggleSurfaceS2(int enable) { qDebug() << __FUNCTION__ << enable; if (enable) @@ -310,19 +310,19 @@ void GraphModifier::toggleSurfaceS2(bool enable) m_multiseries[1]->setDrawMode(m_drawMode2); } -void GraphModifier::toggleSeries2Visible(bool enable) +void GraphModifier::toggleSeries2Visible(int enable) { qDebug() << __FUNCTION__ << enable; m_multiseries[1]->setVisible(enable); } -void GraphModifier::toggleSmoothS3(bool enabled) +void GraphModifier::toggleSmoothS3(int enabled) { qDebug() << __FUNCTION__ << enabled; m_multiseries[2]->setFlatShadingEnabled(enabled); } -void GraphModifier::toggleSurfaceGridS3(bool enable) +void GraphModifier::toggleSurfaceGridS3(int enable) { qDebug() << __FUNCTION__ << enable; if (enable) @@ -333,7 +333,7 @@ void GraphModifier::toggleSurfaceGridS3(bool enable) m_multiseries[2]->setDrawMode(m_drawMode3); } -void GraphModifier::toggleSurfaceS3(bool enable) +void GraphModifier::toggleSurfaceS3(int enable) { qDebug() << __FUNCTION__ << enable; if (enable) @@ -344,19 +344,19 @@ void GraphModifier::toggleSurfaceS3(bool enable) m_multiseries[2]->setDrawMode(m_drawMode3); } -void GraphModifier::toggleSeries3Visible(bool enable) +void GraphModifier::toggleSeries3Visible(int enable) { qDebug() << __FUNCTION__ << enable; m_multiseries[2]->setVisible(enable); } -void GraphModifier::toggleSmoothS4(bool enabled) +void GraphModifier::toggleSmoothS4(int enabled) { qDebug() << __FUNCTION__ << enabled; m_multiseries[3]->setFlatShadingEnabled(enabled); } -void GraphModifier::toggleSurfaceGridS4(bool enable) +void GraphModifier::toggleSurfaceGridS4(int enable) { qDebug() << __FUNCTION__ << enable; if (enable) @@ -367,7 +367,7 @@ void GraphModifier::toggleSurfaceGridS4(bool enable) m_multiseries[3]->setDrawMode(m_drawMode4); } -void GraphModifier::toggleSurfaceS4(bool enable) +void GraphModifier::toggleSurfaceS4(int enable) { qDebug() << __FUNCTION__ << enable; if (enable) @@ -378,13 +378,13 @@ void GraphModifier::toggleSurfaceS4(bool enable) m_multiseries[3]->setDrawMode(m_drawMode4); } -void GraphModifier::toggleSeries4Visible(bool enable) +void GraphModifier::toggleSeries4Visible(int enable) { qDebug() << __FUNCTION__ << enable; m_multiseries[3]->setVisible(enable); } -void GraphModifier::toggleSqrtSin(bool enable) +void GraphModifier::toggleSqrtSin(int enable) { if (enable) { qDebug() << "Create Sqrt&Sin surface, (" << m_xCount << ", " << m_zCount << ")"; @@ -426,7 +426,7 @@ void GraphModifier::toggleSqrtSin(bool enable) } } -void GraphModifier::togglePlane(bool enable) +void GraphModifier::togglePlane(int enable) { qDebug() << "GraphModifier::togglePlane " << enable; @@ -749,21 +749,21 @@ void GraphModifier::changeLabelRotation(int rotation) m_graph->axisZ()->setLabelAutoRotation(float(rotation)); } -void GraphModifier::toggleAxisTitleVisibility(bool enabled) +void GraphModifier::toggleAxisTitleVisibility(int enabled) { m_graph->axisX()->setTitleVisible(enabled); m_graph->axisY()->setTitleVisible(enabled); m_graph->axisZ()->setTitleVisible(enabled); } -void GraphModifier::toggleAxisTitleFixed(bool enabled) +void GraphModifier::toggleAxisTitleFixed(int enabled) { m_graph->axisX()->setTitleFixed(enabled); m_graph->axisY()->setTitleFixed(enabled); m_graph->axisZ()->setTitleFixed(enabled); } -void GraphModifier::toggleXAscending(bool enabled) +void GraphModifier::toggleXAscending(int enabled) { m_ascendingX = enabled; @@ -793,7 +793,7 @@ void GraphModifier::toggleXAscending(bool enabled) } } -void GraphModifier::toggleZAscending(bool enabled) +void GraphModifier::toggleZAscending(int enabled) { m_ascendingZ = enabled; @@ -823,7 +823,7 @@ void GraphModifier::toggleZAscending(bool enabled) } } -void GraphModifier::togglePolar(bool enabled) +void GraphModifier::togglePolar(int enabled) { m_graph->setPolar(enabled); } @@ -1681,7 +1681,7 @@ void GraphModifier::setHorizontalAspectRatio(int ratio) m_graph->setHorizontalAspectRatio(aspectRatio); } -void GraphModifier::setSurfaceTexture(bool enabled) +void GraphModifier::setSurfaceTexture(int enabled) { if (enabled) m_multiseries[3]->setTexture(QImage(":/maps/mapimage")); diff --git a/tests/manual/surfacetest/graphmodifier.h b/tests/manual/surfacetest/graphmodifier.h index e535021a..747cec8d 100644 --- a/tests/manual/surfacetest/graphmodifier.h +++ b/tests/manual/surfacetest/graphmodifier.h @@ -53,29 +53,29 @@ public: explicit GraphModifier(Q3DSurface *graph, QWidget *parentWidget); ~GraphModifier(); - void toggleSeries1(bool enabled); - void toggleSeries2(bool enabled); - void toggleSeries3(bool enabled); - void toggleSeries4(bool enabled); - void toggleSmooth(bool enabled); - void toggleSurfaceGrid(bool enable); - void toggleSurface(bool enable); - void toggleSeriesVisible(bool enable); - void toggleSmoothS2(bool enabled); - void toggleSurfaceGridS2(bool enable); - void toggleSurfaceS2(bool enable); - void toggleSeries2Visible(bool enable); - void toggleSmoothS3(bool enabled); - void toggleSurfaceGridS3(bool enable); - void toggleSurfaceS3(bool enable); - void toggleSeries3Visible(bool enable); - void toggleSmoothS4(bool enabled); - void toggleSurfaceGridS4(bool enable); - void toggleSurfaceS4(bool enable); - void toggleSeries4Visible(bool enable); + void toggleSeries1(int enabled); + void toggleSeries2(int enabled); + void toggleSeries3(int enabled); + void toggleSeries4(int enabled); + void toggleSmooth(int enabled); + void toggleSurfaceGrid(int enable); + void toggleSurface(int enable); + void toggleSeriesVisible(int enable); + void toggleSmoothS2(int enabled); + void toggleSurfaceGridS2(int enable); + void toggleSurfaceS2(int enable); + void toggleSeries2Visible(int enable); + void toggleSmoothS3(int enabled); + void toggleSurfaceGridS3(int enable); + void toggleSurfaceS3(int enable); + void toggleSeries3Visible(int enable); + void toggleSmoothS4(int enabled); + void toggleSurfaceGridS4(int enable); + void toggleSurfaceS4(int enable); + void toggleSeries4Visible(int enable); - void toggleSqrtSin(bool enable); - void togglePlane(bool enable); + void toggleSqrtSin(int enable); + void togglePlane(int enable); void setHeightMapData(bool enable); void toggleGridSliderLock(bool enable); void setGridSliderX(QSlider *slider) { m_gridSliderX = slider; } @@ -123,7 +123,7 @@ public: void testDataOrdering(); void setAspectRatio(int ratio); void setHorizontalAspectRatio(int ratio); - void setSurfaceTexture(bool enabled); + void setSurfaceTexture(int enabled); public Q_SLOTS: void changeShadowQuality(int quality); @@ -138,11 +138,11 @@ public Q_SLOTS: void handleAxisZChanged(QValue3DAxis *axis); void handleFpsChange(qreal fps); void changeLabelRotation(int rotation); - void toggleAxisTitleVisibility(bool enabled); - void toggleAxisTitleFixed(bool enabled); - void toggleXAscending(bool enabled); - void toggleZAscending(bool enabled); - void togglePolar(bool enabled); + void toggleAxisTitleVisibility(int enabled); + void toggleAxisTitleFixed(int enabled); + void toggleXAscending(int enabled); + void toggleZAscending(int enabled); + void togglePolar(int enabled); void setCameraTargetX(int value); void setCameraTargetY(int value); void setCameraTargetZ(int value); diff --git a/tests/manual/surfacetest/main.cpp b/tests/manual/surfacetest/main.cpp index 239a6eba..bad8e75b 100644 --- a/tests/manual/surfacetest/main.cpp +++ b/tests/manual/surfacetest/main.cpp @@ -28,6 +28,8 @@ ****************************************************************************/ #include "graphmodifier.h" +#include "buttonwrapper.h" +#include "checkboxwrapper.h" #include #include @@ -580,49 +582,66 @@ int main(int argc, char *argv[]) QObject::connect(series4VisibleCB, &QCheckBox::stateChanged, modifier, &GraphModifier::toggleSeries4Visible); + CheckBoxWrapper *series1SmoothCBWrapper = new CheckBoxWrapper(smoothCB); + CheckBoxWrapper *series1SurfaceGridCBWrapper = new CheckBoxWrapper(surfaceGridCB); + CheckBoxWrapper *series1surfaceCBWrapper = new CheckBoxWrapper(surfaceCB); + CheckBoxWrapper *series1VisibleCBWrapper = new CheckBoxWrapper(seriesVisibleCB); QObject::connect(series1CB, &QCheckBox::stateChanged, modifier, &GraphModifier::toggleSeries1); QObject::connect(series1CB, &QCheckBox::stateChanged, - smoothCB, &QPushButton::setEnabled); + series1SmoothCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series1CB, &QCheckBox::stateChanged, - surfaceGridCB, &QPushButton::setEnabled); + series1SurfaceGridCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series1CB, &QCheckBox::stateChanged, - surfaceCB, &QPushButton::setEnabled); + series1surfaceCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series1CB, &QCheckBox::stateChanged, - seriesVisibleCB, &QPushButton::setEnabled); + series1VisibleCBWrapper, &CheckBoxWrapper::setEnabled); + + CheckBoxWrapper *series2SmoothCBWrapper = new CheckBoxWrapper(smoothS2CB); + CheckBoxWrapper *series2SurfaceGridCBWrapper = new CheckBoxWrapper(surfaceGridS2CB); + CheckBoxWrapper *series2surfaceCBWrapper = new CheckBoxWrapper(surfaceS2CB); + CheckBoxWrapper *series2VisibleCBWrapper = new CheckBoxWrapper(series2VisibleCB); QObject::connect(series2CB, &QCheckBox::stateChanged, modifier, &GraphModifier::toggleSeries2); QObject::connect(series2CB, &QCheckBox::stateChanged, - smoothS2CB, &QPushButton::setEnabled); + series2SmoothCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series2CB, &QCheckBox::stateChanged, - surfaceGridS2CB, &QPushButton::setEnabled); + series2SurfaceGridCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series2CB, &QCheckBox::stateChanged, - surfaceS2CB, &QPushButton::setEnabled); + series2surfaceCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series2CB, &QCheckBox::stateChanged, - series2VisibleCB, &QPushButton::setEnabled); + series2VisibleCBWrapper, &CheckBoxWrapper::setEnabled); + CheckBoxWrapper *series3SmoothCBWrapper = new CheckBoxWrapper(smoothS3CB); + CheckBoxWrapper *series3SurfaceGridCBWrapper = new CheckBoxWrapper(surfaceGridS3CB); + CheckBoxWrapper *series3surfaceCBWrapper = new CheckBoxWrapper(surfaceS3CB); + CheckBoxWrapper *series3VisibleCBWrapper = new CheckBoxWrapper(series3VisibleCB); QObject::connect(series3CB, &QCheckBox::stateChanged, modifier, &GraphModifier::toggleSeries3); QObject::connect(series3CB, &QCheckBox::stateChanged, - smoothS3CB, &QPushButton::setEnabled); + series3SmoothCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series3CB, &QCheckBox::stateChanged, - surfaceGridS3CB, &QPushButton::setEnabled); + series3SurfaceGridCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series3CB, &QCheckBox::stateChanged, - surfaceS3CB, &QPushButton::setEnabled); + series3surfaceCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series3CB, &QCheckBox::stateChanged, - series3VisibleCB, &QPushButton::setEnabled); + series3VisibleCBWrapper, &CheckBoxWrapper::setEnabled); + CheckBoxWrapper *series4SmoothCBWrapper = new CheckBoxWrapper(smoothS4CB); + CheckBoxWrapper *series4SurfaceGridCBWrapper = new CheckBoxWrapper(surfaceGridS4CB); + CheckBoxWrapper *series4surfaceCBWrapper = new CheckBoxWrapper(surfaceS4CB); + CheckBoxWrapper *series4VisibleCBWrapper = new CheckBoxWrapper(series4VisibleCB); QObject::connect(series4CB, &QCheckBox::stateChanged, modifier, &GraphModifier::toggleSeries4); QObject::connect(series4CB, &QCheckBox::stateChanged, - smoothS4CB, &QPushButton::setEnabled); + series4SmoothCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series4CB, &QCheckBox::stateChanged, - surfaceGridS4CB, &QPushButton::setEnabled); + series4SurfaceGridCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series4CB, &QCheckBox::stateChanged, - surfaceS4CB, &QPushButton::setEnabled); + series4surfaceCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series4CB, &QCheckBox::stateChanged, - series4VisibleCB, &QPushButton::setEnabled); + series4VisibleCBWrapper, &CheckBoxWrapper::setEnabled); #else QObject::connect(sqrtSinCB, &QRadioButton::toggled, modifier, &GraphModifier::toggleSqrtSin); -- cgit v1.2.3