@@ -248,13 +248,12 DeclarativeChart::DeclarativeChart(QDeclarativeItem *parent) | |||||
248 | connect(m_margins, SIGNAL(bottomChanged(int,int,int,int)), this, SLOT(changeMinimumMargins(int,int,int,int))); |
|
248 | connect(m_margins, SIGNAL(bottomChanged(int,int,int,int)), this, SLOT(changeMinimumMargins(int,int,int,int))); | |
249 | connect(m_margins, SIGNAL(leftChanged(int,int,int,int)), this, SLOT(changeMinimumMargins(int,int,int,int))); |
|
249 | connect(m_margins, SIGNAL(leftChanged(int,int,int,int)), this, SLOT(changeMinimumMargins(int,int,int,int))); | |
250 | connect(m_margins, SIGNAL(rightChanged(int,int,int,int)), this, SLOT(changeMinimumMargins(int,int,int,int))); |
|
250 | connect(m_margins, SIGNAL(rightChanged(int,int,int,int)), this, SLOT(changeMinimumMargins(int,int,int,int))); | |
251 |
connect(m_chart->d_ptr->m_dataset, SIGNAL(seriesAdded(QAbstractSeries* |
|
251 | connect(m_chart->d_ptr->m_dataset, SIGNAL(seriesAdded(QAbstractSeries*)), this, SLOT(handleSeriesAdded(QAbstractSeries*))); | |
252 | connect(m_chart->d_ptr->m_dataset, SIGNAL(seriesRemoved(QAbstractSeries*)), this, SIGNAL(seriesRemoved(QAbstractSeries*))); |
|
252 | connect(m_chart->d_ptr->m_dataset, SIGNAL(seriesRemoved(QAbstractSeries*)), this, SIGNAL(seriesRemoved(QAbstractSeries*))); | |
253 | } |
|
253 | } | |
254 |
|
254 | |||
255 |
void DeclarativeChart::handleSeriesAdded(QAbstractSeries *series |
|
255 | void DeclarativeChart::handleSeriesAdded(QAbstractSeries *series) | |
256 | { |
|
256 | { | |
257 | Q_UNUSED(domain) |
|
|||
258 | emit seriesAdded(series); |
|
257 | emit seriesAdded(series); | |
259 | } |
|
258 | } | |
260 |
|
259 |
@@ -157,7 +157,7 public Q_SLOTS: | |||||
157 | void changeMinimumMargins(int top, int bottom, int left, int right); |
|
157 | void changeMinimumMargins(int top, int bottom, int left, int right); | |
158 | void handleAxisXSet(QAbstractAxis *axis); |
|
158 | void handleAxisXSet(QAbstractAxis *axis); | |
159 | void handleAxisYSet(QAbstractAxis *axis); |
|
159 | void handleAxisYSet(QAbstractAxis *axis); | |
160 |
void handleSeriesAdded(QAbstractSeries *series |
|
160 | void handleSeriesAdded(QAbstractSeries *series); | |
161 |
|
161 | |||
162 | private: |
|
162 | private: | |
163 | // Extending QChart with DeclarativeChart is not possible because QObject does not support |
|
163 | // Extending QChart with DeclarativeChart is not possible because QObject does not support |
@@ -101,13 +101,13 void ChartAxis::setLayout(QVector<qreal> &layout) | |||||
101 |
|
101 | |||
102 | void ChartAxis::createItems(int count) |
|
102 | void ChartAxis::createItems(int count) | |
103 | { |
|
103 | { | |
104 |
if (m_arrow->child |
|
104 | if (m_arrow->childItems().size() == 0){ | |
105 | QGraphicsLineItem* arrow = new ArrowItem(this, this); |
|
105 | QGraphicsLineItem* arrow = new ArrowItem(this, this); | |
106 | arrow->setPen(m_axis->linePen()); |
|
106 | arrow->setPen(m_axis->linePen()); | |
107 | m_arrow->addToGroup(arrow); |
|
107 | m_arrow->addToGroup(arrow); | |
108 | } |
|
108 | } | |
109 |
|
109 | |||
110 |
if (m_intervalAxis && m_grid->child |
|
110 | if (m_intervalAxis && m_grid->childItems().size() == 0) { | |
111 | for (int i = 0 ; i < 2 ; i ++){ |
|
111 | for (int i = 0 ; i < 2 ; i ++){ | |
112 |
|
|
112 | QGraphicsLineItem* item = new QGraphicsLineItem(this); | |
113 |
|
|
113 | item->setPen(m_axis->gridLinePen()); | |
@@ -463,7 +463,7 QStringList ChartAxis::createLogValueLabels(qreal min, qreal max, qreal base, in | |||||
463 | labels << QString::number(value, 'f', n); |
|
463 | labels << QString::number(value, 'f', n); | |
464 | } |
|
464 | } | |
465 | } else { |
|
465 | } else { | |
466 |
QByteArray array = format.to |
|
466 | QByteArray array = format.toLatin1(); | |
467 | for (int i = firstTick; i < ticks + firstTick; i++) { |
|
467 | for (int i = firstTick; i < ticks + firstTick; i++) { | |
468 | qreal value = qPow(base, i); |
|
468 | qreal value = qPow(base, i); | |
469 | labels << QString().sprintf(array, value); |
|
469 | labels << QString().sprintf(array, value); |
@@ -889,8 +889,8 QAbstractAxis* QPieSeriesPrivate::createDefaultAxis(Qt::Orientation orientation) | |||||
889 |
|
889 | |||
890 | void QPieSeriesPrivate::initializeTheme(int index, ChartTheme* theme, bool forced) |
|
890 | void QPieSeriesPrivate::initializeTheme(int index, ChartTheme* theme, bool forced) | |
891 | { |
|
891 | { | |
892 | Q_Q(QPieSeries); |
|
892 | //Q_Q(QPieSeries); | |
893 | const QList<QColor>& colors = theme->seriesColors(); |
|
893 | //const QList<QColor>& colors = theme->seriesColors(); | |
894 | const QList<QGradient>& gradients = theme->seriesGradients(); |
|
894 | const QList<QGradient>& gradients = theme->seriesGradients(); | |
895 |
|
895 | |||
896 | for (int i(0); i < m_slices.count(); i++) { |
|
896 | for (int i(0); i < m_slices.count(); i++) { |
@@ -33,7 +33,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||||
33 | class QAbstractSeries; |
|
33 | class QAbstractSeries; | |
34 | class QAbstractAxis; |
|
34 | class QAbstractAxis; | |
35 | class QLegend; |
|
35 | class QLegend; | |
36 |
|
|
36 | class QChartPrivate; | |
37 |
|
37 | |||
38 | class QTCOMMERCIALCHART_EXPORT QChart : public QGraphicsWidget |
|
38 | class QTCOMMERCIALCHART_EXPORT QChart : public QGraphicsWidget | |
39 | { |
|
39 | { |
@@ -77,10 +77,10 public: | |||||
77 | GetGValue(colorGradientActiveCaptionRight), |
|
77 | GetGValue(colorGradientActiveCaptionRight), | |
78 | GetBValue(colorGradientActiveCaptionRight)); |
|
78 | GetBValue(colorGradientActiveCaptionRight)); | |
79 | g.setColorAt(1.0, end); |
|
79 | g.setColorAt(1.0, end); | |
80 | m_seriesColors.append(colorAt(g, 0.5)); |
|
80 | m_seriesColors.append(ChartThemeManager::colorAt(g, 0.5)); | |
81 |
|
81 | |||
82 | // Generate gradients from the base colors |
|
82 | // Generate gradients from the base colors | |
83 | generateSeriesGradients(); |
|
83 | ChartThemeManager::generateSeriesGradients(m_seriesColors); | |
84 |
|
84 | |||
85 | // Background fill color from COLOR_WINDOW |
|
85 | // Background fill color from COLOR_WINDOW | |
86 | QLinearGradient backgroundGradient; |
|
86 | QLinearGradient backgroundGradient; |
General Comments 0
You need to be logged in to leave comments.
Login now