1 | NO CONTENT: modified file |
|
NO CONTENT: modified file |
1 | NO CONTENT: modified file |
|
NO CONTENT: modified file |
@@ -80,7 +80,7 m_index(-1),m_chart(chart) | |||||
80 |
|
80 | |||
81 | //![4] |
|
81 | //![4] | |
82 | foreach (QSeries* series, m_series) { |
|
82 | foreach (QSeries* series, m_series) { | |
83 |
QObject::connect(series,SIGNAL(clicked( |
|
83 | QObject::connect(series,SIGNAL(clicked(QPointF)),this,SLOT(handlePointClicked(QPointF))); | |
84 | } |
|
84 | } | |
85 | //![4] |
|
85 | //![4] | |
86 | m_timer.start(); |
|
86 | m_timer.start(); |
@@ -40,7 +40,7 MainWindow::MainWindow(QWidget *parent) | |||||
40 | chart->axisX()->setRange(0, 4.5); |
|
40 | chart->axisX()->setRange(0, 4.5); | |
41 | chart->axisY()->setRange(0, 4.5); |
|
41 | chart->axisY()->setRange(0, 4.5); | |
42 |
|
42 | |||
43 |
connect(m_scatter, SIGNAL(clicked( |
|
43 | connect(m_scatter, SIGNAL(clicked(QPointF)), this, SLOT(handleClickedPoint(QPointF))); | |
44 |
|
44 | |||
45 | QChartView *chartView = new QChartView(chart); |
|
45 | QChartView *chartView = new QChartView(chart); | |
46 | chartView->setRenderHint(QPainter::Antialiasing); |
|
46 | chartView->setRenderHint(QPainter::Antialiasing); |
@@ -44,7 +44,7 AreaChartItem::AreaChartItem(QAreaSeries *areaSeries, ChartPresenter *presenter) | |||||
44 | m_lower = new AreaBoundItem(this,m_series->lowerSeries()); |
|
44 | m_lower = new AreaBoundItem(this,m_series->lowerSeries()); | |
45 |
|
45 | |||
46 | connect(m_series->d_func(),SIGNAL(updated()),this,SLOT(handleUpdated())); |
|
46 | connect(m_series->d_func(),SIGNAL(updated()),this,SLOT(handleUpdated())); | |
47 |
connect(this,SIGNAL(clicked( |
|
47 | connect(this,SIGNAL(clicked(QPointF)),areaSeries,SIGNAL(clicked(QPointF))); | |
48 |
|
48 | |||
49 | handleUpdated(); |
|
49 | handleUpdated(); | |
50 | } |
|
50 | } |
@@ -109,8 +109,8 private: | |||||
109 |
|
109 | |||
110 | class AxisItem: public QGraphicsLineItem |
|
110 | class AxisItem: public QGraphicsLineItem | |
111 | { |
|
111 | { | |
112 | public: |
|
|||
113 |
|
112 | |||
|
113 | public: | |||
114 | AxisItem(Axis *axis, QGraphicsItem *parent = 0) : QGraphicsLineItem(parent), m_axis(axis) {} |
|
114 | AxisItem(Axis *axis, QGraphicsItem *parent = 0) : QGraphicsLineItem(parent), m_axis(axis) {} | |
115 |
|
115 | |||
116 | protected: |
|
116 | protected: |
1 | NO CONTENT: modified file |
|
NO CONTENT: modified file |
@@ -68,6 +68,6 private: | |||||
68 |
|
68 | |||
69 | ChartConfig* ChartConfig::m_instance=0; |
|
69 | ChartConfig* ChartConfig::m_instance=0; | |
70 |
|
70 | |||
71 | #endif |
|
|||
72 |
|
||||
73 | QTCOMMERCIALCHART_END_NAMESPACE |
|
71 | QTCOMMERCIALCHART_END_NAMESPACE | |
|
72 | ||||
|
73 | #endif |
@@ -132,7 +132,7 void ChartPresenter::handleAxisAdded(QChartAxis* axis,Domain* domain) | |||||
132 | item->handleRangeChanged(domain->minY(),domain->maxY(),domain->tickYCount()); |
|
132 | item->handleRangeChanged(domain->minY(),domain->maxY(),domain->tickYCount()); | |
133 | } |
|
133 | } | |
134 |
|
134 | |||
135 |
QObject::connect(this,SIGNAL(geometryChanged( |
|
135 | QObject::connect(this,SIGNAL(geometryChanged(QRectF)),item,SLOT(handleGeometryChanged(QRectF))); | |
136 | //initialize |
|
136 | //initialize | |
137 | item->handleGeometryChanged(m_chartRect); |
|
137 | item->handleGeometryChanged(m_chartRect); | |
138 | m_axisItems.insert(axis, item); |
|
138 | m_axisItems.insert(axis, item); | |
@@ -151,7 +151,7 void ChartPresenter::handleSeriesAdded(QSeries* series,Domain* domain) | |||||
151 | { |
|
151 | { | |
152 | Chart *item = series->d_ptr->createGraphics(this); |
|
152 | Chart *item = series->d_ptr->createGraphics(this); | |
153 | Q_ASSERT(item); |
|
153 | Q_ASSERT(item); | |
154 |
QObject::connect(this,SIGNAL(geometryChanged( |
|
154 | QObject::connect(this,SIGNAL(geometryChanged(QRectF)),item,SLOT(handleGeometryChanged(QRectF))); | |
155 | QObject::connect(domain,SIGNAL(domainChanged(qreal,qreal,qreal,qreal)),item,SLOT(handleDomainChanged(qreal,qreal,qreal,qreal))); |
|
155 | QObject::connect(domain,SIGNAL(domainChanged(qreal,qreal,qreal,qreal)),item,SLOT(handleDomainChanged(qreal,qreal,qreal,qreal))); | |
156 | //initialize |
|
156 | //initialize | |
157 | item->handleDomainChanged(domain->minX(),domain->maxX(),domain->minY(),domain->maxY()); |
|
157 | item->handleDomainChanged(domain->minX(),domain->maxX(),domain->minY(),domain->maxY()); |
1 | NO CONTENT: modified file |
|
NO CONTENT: modified file |
1 | NO CONTENT: modified file |
|
NO CONTENT: modified file |
@@ -41,7 +41,7 XYChartItem::XYChartItem(QXYSeries *series, ChartPresenter *presenter):ChartItem | |||||
41 | connect(series->d_func(),SIGNAL(pointReplaced(int)),this,SLOT(handlePointReplaced(int))); |
|
41 | connect(series->d_func(),SIGNAL(pointReplaced(int)),this,SLOT(handlePointReplaced(int))); | |
42 | connect(series->d_func(),SIGNAL(pointAdded(int)),this,SLOT(handlePointAdded(int))); |
|
42 | connect(series->d_func(),SIGNAL(pointAdded(int)),this,SLOT(handlePointAdded(int))); | |
43 | connect(series->d_func(),SIGNAL(pointRemoved(int)),this,SLOT(handlePointRemoved(int))); |
|
43 | connect(series->d_func(),SIGNAL(pointRemoved(int)),this,SLOT(handlePointRemoved(int))); | |
44 |
connect(this,SIGNAL(clicked( |
|
44 | connect(this,SIGNAL(clicked(QPointF)),series,SIGNAL(clicked(QPointF))); | |
45 | } |
|
45 | } | |
46 |
|
46 | |||
47 | QPointF XYChartItem::calculateGeometryPoint(const QPointF &point) const |
|
47 | QPointF XYChartItem::calculateGeometryPoint(const QPointF &point) const |
1 | NO CONTENT: modified file |
|
NO CONTENT: modified file |
1 | NO CONTENT: modified file |
|
NO CONTENT: modified file |
1 | NO CONTENT: modified file |
|
NO CONTENT: modified file |
General Comments 0
You need to be logged in to leave comments.
Login now