summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2016-12-02 12:10:42 +0200
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2016-12-02 10:26:23 +0000
commit0f2552ffd5edc2998306362719d50c4cd6d474e9 (patch)
tree0ac414c8f537c1a6bb836c6f3f7013246b2d6749 /tests
parent2c3935a76fbadd5714882795f39ce59049aafb63 (diff)
Fix crash when log axis range is initialized to contain no ticks
Axis updateGeometry() expects there to always be at least one arrow item for the main axis arrow, but the arrow never got created if there were no ticks on the axis before axis was shown. Ensure that createItems() is called at least once for axis even if there are no ticks. Task-number: QTBUG-57328 Change-Id: I7847e2f0d4ee1c3e4546dca05df6078b4a4e81c8 Reviewed-by: Mika Salmela <mika.salmela@qt.io> Reviewed-by: Alexander Mishin <apmishin@yandex.com> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qlogvalueaxis/tst_qlogvalueaxis.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qlogvalueaxis/tst_qlogvalueaxis.cpp b/tests/auto/qlogvalueaxis/tst_qlogvalueaxis.cpp
index 3016007f..26523b4b 100644
--- a/tests/auto/qlogvalueaxis/tst_qlogvalueaxis.cpp
+++ b/tests/auto/qlogvalueaxis/tst_qlogvalueaxis.cpp
@@ -61,6 +61,8 @@ private slots:
void range_raw();
void range_data();
void range();
+ void range_before_show_data();
+ void range_before_show();
void range_animation_data();
void range_animation();
void noautoscale_data();
@@ -253,6 +255,7 @@ void tst_QLogValueAxis::range_raw_data()
QTest::newRow("0.1 - 1.0") << (qreal)0.1 << (qreal)1.0 << (qreal)0.1 << (qreal)1.0 << true << false;
QTest::newRow("25.0 - 75.0") << (qreal)25.0 << (qreal)75.0 << (qreal)25.0 << (qreal)75.0 << true << true;
QTest::newRow("10.0 - 5.0") << (qreal)10.0 << (qreal)5.0 << (qreal)1.0 << (qreal)1.0 << false << false;
+ QTest::newRow("2.0 - 7.0") << (qreal)2.0 << (qreal)7.0 << (qreal)2.0 << (qreal)7.0 << true << true;
}
void tst_QLogValueAxis::range_raw()
@@ -292,6 +295,20 @@ void tst_QLogValueAxis::range()
range_raw();
}
+void tst_QLogValueAxis::range_before_show_data()
+{
+ range_raw_data();
+}
+
+void tst_QLogValueAxis::range_before_show()
+{
+ range_raw();
+
+ m_chart->setAxisX(m_logvaluesaxis, m_series);
+ m_view->show();
+ QTest::qWaitForWindowShown(m_view);
+}
+
void tst_QLogValueAxis::range_animation_data()
{
range_data();