@@ -131,6 +131,7 void AxisAnimation::updateCurrentValue (const QVariant &value ) | |||
|
131 | 131 | Q_ASSERT(vector.count() != 0); |
|
132 | 132 | m_axis->setLayout(vector); |
|
133 | 133 | m_axis->updateGeometry(); |
|
134 | m_axis->checkLayout(); | |
|
134 | 135 | } |
|
135 | 136 | |
|
136 | 137 | } |
@@ -120,6 +120,7 void ChartCategoryAxisX::updateGeometry() | |||
|
120 | 120 | lineItem = static_cast<QGraphicsLineItem*>(axis.at(i+1)); |
|
121 | 121 | lineItem->setLine(layout[i],m_rect.bottom(),layout[i], m_rect.bottom() + 5); |
|
122 | 122 | } |
|
123 | ||
|
123 | 124 | } |
|
124 | 125 | |
|
125 | 126 | void ChartCategoryAxisX::handleAxisUpdated() |
@@ -129,6 +129,7 void ChartCategoryAxisY::updateGeometry() | |||
|
129 | 129 | lineItem = static_cast<QGraphicsLineItem*>(axis.at(i+1)); |
|
130 | 130 | lineItem->setLine(m_rect.left()-5,layout[i],m_rect.left(),layout[i]); |
|
131 | 131 | } |
|
132 | ||
|
132 | 133 | } |
|
133 | 134 | |
|
134 | 135 | void ChartCategoryAxisY::handleAxisUpdated() |
@@ -26,6 +26,7 | |||
|
26 | 26 | #include <qmath.h> |
|
27 | 27 | #include <QDateTime> |
|
28 | 28 | #include <QValueAxis> |
|
29 | #include <QGraphicsLayout> | |
|
29 | 30 | |
|
30 | 31 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
31 | 32 | |
@@ -138,6 +139,7 void ChartAxis::updateLayout(QVector<qreal> &layout) | |||
|
138 | 139 | else { |
|
139 | 140 | setLayout(layout); |
|
140 | 141 | updateGeometry(); |
|
142 | checkLayout(); | |
|
141 | 143 | } |
|
142 | 144 | } |
|
143 | 145 | |
@@ -381,6 +383,17 void ChartAxis::createNumberLabels(QStringList &labels,qreal min, qreal max, int | |||
|
381 | 383 | } |
|
382 | 384 | } |
|
383 | 385 | |
|
386 | void ChartAxis::checkLayout() | |
|
387 | { | |
|
388 | if(m_minWidth > m_rect.width()) { | |
|
389 | presenter()->layout()->invalidate(); | |
|
390 | } | |
|
391 | ||
|
392 | if(m_minHeight > m_rect.height()) { | |
|
393 | presenter()->layout()->invalidate(); | |
|
394 | } | |
|
395 | } | |
|
396 | ||
|
384 | 397 | #include "moc_chartaxis_p.cpp" |
|
385 | 398 | |
|
386 | 399 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -98,6 +98,7 protected: | |||
|
98 | 98 | virtual void updateGeometry() = 0; |
|
99 | 99 | virtual QVector<qreal> calculateLayout() const = 0; |
|
100 | 100 | void createNumberLabels(QStringList &labels,qreal min, qreal max,int ticks) const; |
|
101 | void checkLayout(); | |
|
101 | 102 | |
|
102 | 103 | public Q_SLOTS: |
|
103 | 104 | virtual void handleAxisUpdated(); |
General Comments 0
You need to be logged in to leave comments.
Login now