##// END OF EJS Templates
Fixed visibility initialization on axis
Marek Rosa -
r2345:25ac4815295c
parent child
Show More
@@ -47,17 +47,14 ChartAxis::ChartAxis(QAbstractAxis *axis, QGraphicsItem* item , bool intervalAxi
47 m_intervalAxis(intervalAxis)
47 m_intervalAxis(intervalAxis)
48 {
48 {
49 Q_ASSERT(item);
49 Q_ASSERT(item);
50 //initial initialization
50 //initial initialization
51 m_arrow->setHandlesChildEvents(false);
51 m_arrow->setHandlesChildEvents(false);
52 m_arrow->setZValue(ChartPresenter::AxisZValue);
52 m_arrow->setZValue(ChartPresenter::AxisZValue);
53 m_arrow->setVisible(m_axis->isLineVisible());
54 m_labels->setZValue(ChartPresenter::AxisZValue);
53 m_labels->setZValue(ChartPresenter::AxisZValue);
55 m_labels->setVisible(m_axis->labelsVisible());
56 m_shades->setZValue(ChartPresenter::ShadesZValue);
54 m_shades->setZValue(ChartPresenter::ShadesZValue);
57 m_shades->setVisible(m_axis->shadesVisible());
58 m_grid->setZValue(ChartPresenter::GridZValue);
55 m_grid->setZValue(ChartPresenter::GridZValue);
59 m_grid->setVisible(m_axis->isGridLineVisible());
60 m_title->setZValue(ChartPresenter::GridZValue);
56 m_title->setZValue(ChartPresenter::GridZValue);
57 handleVisibleChanged(m_axis->isVisible());
61 connectSlots();
58 connectSlots();
62
59
63 setFlag(QGraphicsItem::ItemHasNoContents,true);
60 setFlag(QGraphicsItem::ItemHasNoContents,true);
@@ -392,7 +389,7 void ChartAxis::handleVisibleChanged(bool visible)
392 m_title->setVisible(m_axis->isTitleVisible());
389 m_title->setVisible(m_axis->isTitleVisible());
393 }
390 }
394
391
395 presenter()->layout()->invalidate();
392 if(presenter()) presenter()->layout()->invalidate();
396 }
393 }
397
394
398 void ChartAxis::handleRangeChanged(qreal min, qreal max)
395 void ChartAxis::handleRangeChanged(qreal min, qreal max)
@@ -753,6 +753,7 QAbstractAxisPrivate::QAbstractAxisPrivate(QAbstractAxis *q)
753 m_gridLineVisible(true),
753 m_gridLineVisible(true),
754 m_labelsVisible(true),
754 m_labelsVisible(true),
755 m_labelsAngle(0),
755 m_labelsAngle(0),
756 m_titleVisible(true),
756 m_shadesVisible(false),
757 m_shadesVisible(false),
757 m_shadesBrush(Qt::SolidPattern),
758 m_shadesBrush(Qt::SolidPattern),
758 m_shadesOpacity(1.0),
759 m_shadesOpacity(1.0),
General Comments 0
You need to be logged in to leave comments. Login now