diff options
author | Liang Qi <liang.qi@qt.io> | 2018-01-20 22:37:34 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-01-20 22:38:24 +0100 |
commit | c844c1e5bde966c50a41d43c942b806d5c2f251e (patch) | |
tree | 02edb1651786a653c0d1ab12cf17780eecbbda14 | |
parent | 146e375210f406e62fd952d150bc1bcd926d60cb (diff) | |
parent | 175d864fbb96ed64cc609fe08df4b28668368040 (diff) |
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
.qmake.conf
Change-Id: I03085b7c604cda9c4a173ca8f6dd34d522e59b16
-rw-r--r-- | dist/changes-5.9.3 | 24 | ||||
-rw-r--r-- | dist/changes-5.9.4 | 25 | ||||
-rw-r--r-- | examples/charts/barmodelmapper/barmodelmapper.pro | 1 | ||||
-rw-r--r-- | examples/charts/chartthemes/chartthemes.pro | 1 | ||||
-rw-r--r-- | examples/charts/modeldata/modeldata.pro | 1 | ||||
-rw-r--r-- | examples/charts/piechartcustomization/piechartcustomization.pro | 1 | ||||
-rw-r--r-- | src/charts/axis/chartaxiselement.cpp | 4 | ||||
-rw-r--r-- | src/charts/barchart/abstractbarchartitem.cpp | 9 | ||||
-rw-r--r-- | tests/auto/qvalueaxis/tst_qvalueaxis.cpp | 36 |
9 files changed, 100 insertions, 2 deletions
diff --git a/dist/changes-5.9.3 b/dist/changes-5.9.3 new file mode 100644 index 00000000..9c14f39f --- /dev/null +++ b/dist/changes-5.9.3 @@ -0,0 +1,24 @@ +Qt 5.9.3 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.9.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +http://doc.qt.io/qt-5/index.html + +The Qt version 5.9 series is binary compatible with the 5.8.x series. +Applications compiled for 5.8 will continue to run with 5.9. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Qt 5.9.3 Changes * +**************************************************************************** + +- [QTBUG-63807] Add shaders suitable for CoreProfile for QtQuick charts diff --git a/dist/changes-5.9.4 b/dist/changes-5.9.4 new file mode 100644 index 00000000..d49a42f5 --- /dev/null +++ b/dist/changes-5.9.4 @@ -0,0 +1,25 @@ +Qt 5.9.4 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.9.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +http://doc.qt.io/qt-5/index.html + +The Qt version 5.9 series is binary compatible with the 5.8.x series. +Applications compiled for 5.8 will continue to run with 5.9. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Qt 5.9.4 Changes * +**************************************************************************** + + - This release contains only minor code improvements. + diff --git a/examples/charts/barmodelmapper/barmodelmapper.pro b/examples/charts/barmodelmapper/barmodelmapper.pro index 45a5e224..0ff60561 100644 --- a/examples/charts/barmodelmapper/barmodelmapper.pro +++ b/examples/charts/barmodelmapper/barmodelmapper.pro @@ -1,4 +1,5 @@ QT += charts +requires(qtConfig(tableview)) HEADERS += \ customtablemodel.h \ diff --git a/examples/charts/chartthemes/chartthemes.pro b/examples/charts/chartthemes/chartthemes.pro index 193dc4e6..5def152f 100644 --- a/examples/charts/chartthemes/chartthemes.pro +++ b/examples/charts/chartthemes/chartthemes.pro @@ -1,4 +1,5 @@ QT += charts +requires(qtConfig(combobox)) HEADERS += \ themewidget.h diff --git a/examples/charts/modeldata/modeldata.pro b/examples/charts/modeldata/modeldata.pro index 95d3d689..b71a9d66 100644 --- a/examples/charts/modeldata/modeldata.pro +++ b/examples/charts/modeldata/modeldata.pro @@ -1,4 +1,5 @@ QT += charts +requires(qtConfig(tableview)) HEADERS += \ customtablemodel.h \ diff --git a/examples/charts/piechartcustomization/piechartcustomization.pro b/examples/charts/piechartcustomization/piechartcustomization.pro index 081e9105..8c3bf136 100644 --- a/examples/charts/piechartcustomization/piechartcustomization.pro +++ b/examples/charts/piechartcustomization/piechartcustomization.pro @@ -1,4 +1,5 @@ QT += charts +requires(qtConfig(combobox)) HEADERS += \ brushtool.h \ diff --git a/src/charts/axis/chartaxiselement.cpp b/src/charts/axis/chartaxiselement.cpp index c5a1ab91..5282ee36 100644 --- a/src/charts/axis/chartaxiselement.cpp +++ b/src/charts/axis/chartaxiselement.cpp @@ -343,7 +343,7 @@ QStringList ChartAxisElement::createValueLabels(qreal min, qreal max, int ticks, if (max <= min || ticks < 1) return labels; - if (format.isNull()) { + if (format.isEmpty()) { int n = qMax(int(-qFloor(std::log10((max - min) / (ticks - 1)))), 0) + 1; for (int i = 0; i < ticks; i++) { qreal value = min + (i * (max - min) / (ticks - 1)); @@ -395,7 +395,7 @@ QStringList ChartAxisElement::createLogValueLabels(qreal min, qreal max, qreal b else firstTick = qCeil(std::log10(max) / std::log10(base)); - if (format.isNull()) { + if (format.isEmpty()) { int n = 0; if (ticks > 1) n = qMax(int(-qFloor(std::log10((max - min) / (ticks - 1)))), 0); diff --git a/src/charts/barchart/abstractbarchartitem.cpp b/src/charts/barchart/abstractbarchartitem.cpp index 86bfbf8d..2d0d0e25 100644 --- a/src/charts/barchart/abstractbarchartitem.cpp +++ b/src/charts/barchart/abstractbarchartitem.cpp @@ -398,6 +398,15 @@ void AbstractBarChartItem::handleBarValueRemove(int index, int count, QBarSet *b // Value removals from the middle of barset need to dirty the rest of the labels of the set. markLabelsDirty(barset, index, -1); + + // make sure labels are not visible for removed bars + const auto bars = m_barMap.value(barset); + for (int c = barset->count(); c < bars.count(); ++c) { + auto label = bars.at(c)->labelItem(); + if (label) + label->setVisible(false); + } + handleLayoutChanged(); } diff --git a/tests/auto/qvalueaxis/tst_qvalueaxis.cpp b/tests/auto/qvalueaxis/tst_qvalueaxis.cpp index 4de89cb1..1527cb2b 100644 --- a/tests/auto/qvalueaxis/tst_qvalueaxis.cpp +++ b/tests/auto/qvalueaxis/tst_qvalueaxis.cpp @@ -71,6 +71,7 @@ private slots: void autoscale_data(); void autoscale(); void reverse(); + void labels(); private: QValueAxis* m_valuesaxis; @@ -437,6 +438,41 @@ void tst_QValueAxis::reverse() QCOMPARE(m_valuesaxis->isReverse(), true); } +void tst_QValueAxis::labels() +{ + m_chart->setAxisX(m_valuesaxis, m_series); + m_view->resize(300, 300); + m_view->show(); + QTest::qWaitForWindowShown(m_view); + + QList<QGraphicsItem *> childItems = m_chart->scene()->items(); + QList<QGraphicsTextItem *> textItems; + QStringList originalStrings; + for (QGraphicsItem *i : childItems) { + if (QGraphicsTextItem *text = qgraphicsitem_cast<QGraphicsTextItem *>(i)) { + if (text->parentItem() != m_chart) { + textItems << text; + originalStrings << text->toPlainText(); + } + } + } + m_valuesaxis->setLabelFormat("%.0f"); + // Wait for the format to have updated + QTest::qWait(100); + QStringList updatedStrings; + for (QGraphicsTextItem *i : textItems) + updatedStrings << i->toPlainText(); + // The order will be the same as we kept the order of the items + QVERIFY(originalStrings != updatedStrings); + updatedStrings.clear(); + // The labels should be back to the original defaults + m_valuesaxis->setLabelFormat(""); + QTest::qWait(100); + for (QGraphicsTextItem *i : textItems) + updatedStrings << i->toPlainText(); + QCOMPARE(originalStrings, updatedStrings); +} + QTEST_MAIN(tst_QValueAxis) #include "tst_qvalueaxis.moc" |