##// END OF EJS Templates
Bugfix: remove restrictions from pie start & end angles...
Jani Honkonen -
r1207:614787b7b70d
parent child
Show More
@@ -104,14 +104,14 MainWidget::MainWidget(QWidget* parent)
104 m_sizeFactor->setValue(m_series->pieSize());
104 m_sizeFactor->setValue(m_series->pieSize());
105
105
106 m_startAngle = new QDoubleSpinBox();
106 m_startAngle = new QDoubleSpinBox();
107 m_startAngle->setMinimum(0.0);
107 m_startAngle->setMinimum(-720);
108 m_startAngle->setMaximum(360);
108 m_startAngle->setMaximum(720);
109 m_startAngle->setValue(m_series->pieStartAngle());
109 m_startAngle->setValue(m_series->pieStartAngle());
110 m_startAngle->setSingleStep(1);
110 m_startAngle->setSingleStep(1);
111
111
112 m_endAngle = new QDoubleSpinBox();
112 m_endAngle = new QDoubleSpinBox();
113 m_endAngle->setMinimum(0.0);
113 m_endAngle->setMinimum(-720);
114 m_endAngle->setMaximum(360);
114 m_endAngle->setMaximum(720);
115 m_endAngle->setValue(m_series->pieEndAngle());
115 m_endAngle->setValue(m_series->pieEndAngle());
116 m_endAngle->setSingleStep(1);
116 m_endAngle->setSingleStep(1);
117
117
@@ -341,8 +341,10 qreal QPieSeries::pieSize() const
341 void QPieSeries::setPieStartAngle(qreal angle)
341 void QPieSeries::setPieStartAngle(qreal angle)
342 {
342 {
343 Q_D(QPieSeries);
343 Q_D(QPieSeries);
344 if (d->setRealValue(d->m_pieStartAngle, angle, d->m_pieEndAngle))
344 if (qFuzzyIsNull(d->m_pieStartAngle - angle))
345 d->updateDerivativeData();
345 return;
346 d->m_pieStartAngle = angle;
347 d->updateDerivativeData();
346 }
348 }
347
349
348 qreal QPieSeries::pieStartAngle() const
350 qreal QPieSeries::pieStartAngle() const
@@ -363,9 +365,10 qreal QPieSeries::pieStartAngle() const
363 void QPieSeries::setPieEndAngle(qreal angle)
365 void QPieSeries::setPieEndAngle(qreal angle)
364 {
366 {
365 Q_D(QPieSeries);
367 Q_D(QPieSeries);
366
368 if (qFuzzyIsNull(d->m_pieEndAngle - angle))
367 if (d->setRealValue(d->m_pieEndAngle, angle, 360.0, d->m_pieStartAngle))
369 return;
368 d->updateDerivativeData();
370 d->m_pieEndAngle = angle;
371 d->updateDerivativeData();
369 }
372 }
370
373
371 /*!
374 /*!
@@ -234,6 +234,13 void tst_qpieseries::calculatedValues()
234 if (!ok)
234 if (!ok)
235 return;
235 return;
236
236
237 // modify pie angles
238 s.setPieStartAngle(-90);
239 s.setPieEndAngle(90);
240 verifyCalculatedData(s, &ok);
241 if (!ok)
242 return;
243
237 // clear all
244 // clear all
238 s.clear();
245 s.clear();
239 verifyCalculatedData(s, &ok);
246 verifyCalculatedData(s, &ok);
General Comments 0
You need to be logged in to leave comments. Login now