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 /src | |
parent | 146e375210f406e62fd952d150bc1bcd926d60cb (diff) | |
parent | 175d864fbb96ed64cc609fe08df4b28668368040 (diff) |
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
.qmake.conf
Change-Id: I03085b7c604cda9c4a173ca8f6dd34d522e59b16
Diffstat (limited to 'src')
-rw-r--r-- | src/charts/axis/chartaxiselement.cpp | 4 | ||||
-rw-r--r-- | src/charts/barchart/abstractbarchartitem.cpp | 9 |
2 files changed, 11 insertions, 2 deletions
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(); } |