summaryrefslogtreecommitdiffstats
path: root/src/charts/axis/verticalaxis.cpp
diff options
context:
space:
mode:
authorTitta Heikkala <titta.heikkala@theqtcompany.com>2014-11-27 10:25:53 +0200
committerTitta Heikkala <titta.heikkala@theqtcompany.com>2014-11-27 11:00:28 +0200
commit8e20d47d8440630a1a6f2e1617fff4dbd8f04d2d (patch)
tree13eb740f5a5b396e6d88949cca867f221a179e92 /src/charts/axis/verticalaxis.cpp
parent39be6d68b7b88a4da77d9390e3586eed4aaa0a72 (diff)
Fix QLogValueAxis update
Reverting previous fix. Instead fix the update so that the axis arrow and title are updated for logarithmic axis even when the layout is empty. The logarithmic axis is special case as it can have zero ticks where the other axises have to have at least two. Change-Id: I47d49e83b713994d4b01e022df5badcb5d947095 Task-number: QTRD-3431 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>
Diffstat (limited to 'src/charts/axis/verticalaxis.cpp')
-rw-r--r--src/charts/axis/verticalaxis.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/charts/axis/verticalaxis.cpp b/src/charts/axis/verticalaxis.cpp
index 294e1a56..ddea15c3 100644
--- a/src/charts/axis/verticalaxis.cpp
+++ b/src/charts/axis/verticalaxis.cpp
@@ -36,14 +36,12 @@ void VerticalAxis::updateGeometry()
{
const QVector<qreal> &layout = ChartAxisElement::layout();
- if (layout.isEmpty())
+ if (layout.isEmpty() && axis()->type() != QAbstractAxis::AxisTypeLogValue)
return;
QStringList labelList = labels();
- QList<QGraphicsItem *> lines = gridItems();
QList<QGraphicsItem *> labels = labelItems();
- QList<QGraphicsItem *> shades = shadeItems();
QList<QGraphicsItem *> arrow = arrowItems();
QGraphicsTextItem *title = titleItem();
@@ -55,7 +53,6 @@ void VerticalAxis::updateGeometry()
qreal height = axisRect.bottom();
-
//arrow
QGraphicsLineItem *arrowItem = static_cast<QGraphicsLineItem*>(arrow.at(0));
@@ -93,6 +90,12 @@ void VerticalAxis::updateGeometry()
availableSpace -= titleBoundingRect.height();
}
+ if (layout.isEmpty() && axis()->type() == QAbstractAxis::AxisTypeLogValue)
+ return;
+
+ QList<QGraphicsItem *> lines = gridItems();
+ QList<QGraphicsItem *> shades = shadeItems();
+
for (int i = 0; i < layout.size(); ++i) {
//items
QGraphicsLineItem *gridItem = static_cast<QGraphicsLineItem *>(lines.at(i));