##// END OF EJS Templates
bugfix signals not reconnected when domain changed
Michal Klocek -
r2292:29ed1b505c34
parent child
Show More
@@ -197,13 +197,18 bool ChartDataSet::attachAxis(QAbstractSeries* series,QAbstractAxis *axis)
197 197
198 198 if(!domain->attachAxis(axis)) return false;
199 199
200 series->d_ptr->m_axes<<axis;
201 axis->d_ptr->m_series<<series;
202
203 200 if(domain!=series->d_ptr->domain()){
201 foreach(QAbstractAxis* axis,series->d_ptr->m_axes){
202 series->d_ptr->domain()->detachAxis(axis);
203 domain->attachAxis(axis);
204 }
204 205 series->d_ptr->setDomain(domain);
205 206 series->d_ptr->initializeDomain();
206 207 }
208
209 series->d_ptr->m_axes<<axis;
210 axis->d_ptr->m_series<<series;
211
207 212 series->d_ptr->initializeAxes();
208 213 axis->d_ptr->initializeDomain(domain);
209 214
@@ -158,24 +158,22 QPointF XLogYDomain::calculateDomainPoint(const QPointF &point) const
158 158
159 159 bool XLogYDomain::attachAxis(QAbstractAxis* axis)
160 160 {
161 AbstractDomain::attachAxis(axis);
162 161 QLogValueAxis *logAxis = qobject_cast<QLogValueAxis *>(axis);
163 162
164 163 if(logAxis && logAxis->orientation()==Qt::Vertical)
165 164 QObject::connect(logAxis, SIGNAL(baseChanged(qreal)), this, SLOT(handleVerticalAxisBaseChanged(qreal)));
166 165
167 return true;
166 return AbstractDomain::attachAxis(axis);
168 167 }
169 168
170 169 bool XLogYDomain::detachAxis(QAbstractAxis* axis)
171 170 {
172 AbstractDomain::detachAxis(axis);
173 171 QLogValueAxis *logAxis = qobject_cast<QLogValueAxis *>(axis);
174 172
175 173 if(logAxis && logAxis->orientation()==Qt::Vertical)
176 174 QObject::disconnect(logAxis, SIGNAL(baseChanged(qreal)), this, SLOT(handleVerticalAxisBaseChanged(qreal)));
177 175
178 return true;
176 return AbstractDomain::detachAxis(axis);
179 177 }
180 178
181 179 void XLogYDomain::handleVerticalAxisBaseChanged(qreal baseY)
General Comments 0
You need to be logged in to leave comments. Login now