diff options
author | Jere Tuliniemi <jere.tuliniemi@qt.io> | 2024-05-07 12:51:18 +0300 |
---|---|---|
committer | Jere Tuliniemi <jere.tuliniemi@qt.io> | 2024-05-08 13:45:58 +0300 |
commit | 10287d1dfcd8fc2b1587a135e8b50fee6a3703b7 (patch) | |
tree | 4713e6e826f1c5e320b7d482bfed0fe91726551f | |
parent | 403528d933b8e034d0b15a583e69fb4076462117 (diff) |
Fix qmlbarscatter manual test
Fixes: QTBUG-125137
Change-Id: I8704b547d9d5c8e258e46cd5b3b53491c1f7a380
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: <owais.akhtar@qt.io>
-rw-r--r-- | tests/manual/qmlbarscatter/barseries.cpp | 14 | ||||
-rw-r--r-- | tests/manual/qmlbarscatter/barseries.h | 2 | ||||
-rw-r--r-- | tests/manual/qmlbarscatter/qml/main.qml | 44 | ||||
-rw-r--r-- | tests/manual/qmlbarscatter/scatterseries.h | 2 |
4 files changed, 29 insertions, 33 deletions
diff --git a/tests/manual/qmlbarscatter/barseries.cpp b/tests/manual/qmlbarscatter/barseries.cpp index bc8eba2..9bcab0a 100644 --- a/tests/manual/qmlbarscatter/barseries.cpp +++ b/tests/manual/qmlbarscatter/barseries.cpp @@ -5,24 +5,14 @@ #include <QtGraphs/QBarSet> -BarSeries::BarSeries(QObject *series) - : QBarSeries(series) +BarSeries::BarSeries(QObject *parent) + : QBarSeries(parent) , m_cpuUpdater(this) - , m_axis1(this) - , m_axis2(this) , m_counter(0) { connect(&m_timer, &QTimer::timeout, this, &BarSeries::frameUpdate); m_timer.start(100); - m_axis1.setCategories({"Reading 1", "Reading 2", "Reading 3", "Reading 4", "Reading 5"}); - - m_axis2.setMin(0); - m_axis2.setMax(100); - - setAxisX(&m_axis1); - setAxisY(&m_axis2); - m_barList = new QBarSet(this); for (int i = 0; i < 5; ++i) diff --git a/tests/manual/qmlbarscatter/barseries.h b/tests/manual/qmlbarscatter/barseries.h index 1190b7f..15e1602 100644 --- a/tests/manual/qmlbarscatter/barseries.h +++ b/tests/manual/qmlbarscatter/barseries.h @@ -27,8 +27,6 @@ private: QBarSet *m_barList; QTimer m_timer; CpuUsageUpdater m_cpuUpdater; - QBarCategoryAxis m_axis1; - QValueAxis m_axis2; int m_counter; }; diff --git a/tests/manual/qmlbarscatter/qml/main.qml b/tests/manual/qmlbarscatter/qml/main.qml index a1b32fc..02223cf 100644 --- a/tests/manual/qmlbarscatter/qml/main.qml +++ b/tests/manual/qmlbarscatter/qml/main.qml @@ -76,11 +76,19 @@ Item { id: graph anchors.margins: 10 - backgroundColor: "#202020" - theme: GraphTheme { + theme: GraphsTheme { id: myTheme - colorTheme: GraphTheme.ColorThemeDark - axisXLabelsFont.pixelSize: 20 + theme: GraphsTheme.QtGreenNeon + axisXLabelFont.pixelSize: 20 + backgroundColor: "#202020" + } + + axisX: BarCategoryAxis { + categories: ["Reading 1", "Reading 2", "Reading 3", "Reading 4", "Reading 5"] + } + + axisY: ValueAxis { + max: 100 } CustomBar { @@ -92,25 +100,25 @@ Item { id: graph2 anchors.margins: 10 - backgroundColor: "#202020" - theme: GraphTheme { + theme: GraphsTheme { id: myTheme2 - colorTheme: GraphTheme.ColorThemeDark - axisXLabelsFont.pixelSize: 20 + theme: GraphsTheme.QtGreen + axisXLabelFont.pixelSize: 20 + backgroundColor: "#202020" } - CustomScatter { - id: scatterSeries + axisX: ValueAxis { + id: xAxis + max: 5 + } - axisX: ValueAxis { - id: xAxis - max: 5 - } + axisY: ValueAxis { + id: yAxis + max: 100 + } - axisY: ValueAxis { - id: yAxis - max: 100 - } + CustomScatter { + id: scatterSeries pointMarker: Image { property bool selected: false diff --git a/tests/manual/qmlbarscatter/scatterseries.h b/tests/manual/qmlbarscatter/scatterseries.h index 3997923..1373700 100644 --- a/tests/manual/qmlbarscatter/scatterseries.h +++ b/tests/manual/qmlbarscatter/scatterseries.h @@ -25,7 +25,7 @@ public Q_SLOTS: private: QTimer m_timer; CpuUsageUpdater m_cpuUpdater; - int m_counter; + int m_counter = 0; }; #endif // SCATTERSERIES_H |