##// END OF EJS Templates
Refcator scrol() to scrollLeft,Right,Up,Down
Michal Klocek -
r600:db004721a4d5
parent child
Show More
@@ -310,16 +310,21 QChart::AnimationOptions QChart::animationOptions() const
310 return m_presenter->animationOptions();
310 return m_presenter->animationOptions();
311 }
311 }
312
312
313 void QChart::scroll(int dx,int dy)
313 void QChart::scrollLeft()
314 {
314 {
315 //temporary
315 m_presenter->scroll(-m_presenter->geometry().width()/(axisX()->ticksCount()-1),0);
316 if(dx>0)
316 }
317 m_presenter->scroll(m_presenter->geometry().width()/(axisX()->ticksCount()-1),0);
317
318 if(dx<0)
318 void QChart::scrollRight()
319 m_presenter->scroll(-m_presenter->geometry().width()/(axisX()->ticksCount()-1),0);
319 {
320 if(dy>0)
320 m_presenter->scroll(m_presenter->geometry().width()/(axisX()->ticksCount()-1),0);
321 m_presenter->scroll(0,m_presenter->geometry().width()/(axisY()->ticksCount()-1));
321 }
322 if(dy<0)
322 void QChart::scrollUp()
323 {
324 m_presenter->scroll(0,m_presenter->geometry().width()/(axisY()->ticksCount()-1));
325 }
326 void QChart::scrollDown()
327 {
323 m_presenter->scroll(0,-m_presenter->geometry().width()/(axisY()->ticksCount()-1));
328 m_presenter->scroll(0,-m_presenter->geometry().width()/(axisY()->ticksCount()-1));
324 }
329 }
325
330
@@ -73,7 +73,10 public:
73 void zoomIn(const QRectF& rect);
73 void zoomIn(const QRectF& rect);
74 void zoomOut();
74 void zoomOut();
75 void zoomReset();
75 void zoomReset();
76 void scroll(int dx,int dy);
76 void scrollLeft();
77 void scrollRight();
78 void scrollUp();
79 void scrollDown();
77
80
78 QChartAxis* axisX() const;
81 QChartAxis* axisX() const;
79 QChartAxis* axisY() const;
82 QChartAxis* axisY() const;
@@ -380,11 +380,27 QChart::AnimationOptions QChartView::animationOptions() const
380 return m_chart->animationOptions();
380 return m_chart->animationOptions();
381 }
381 }
382
382
383 void QChartView::scroll(int dx,int dy)
383 void QChartView::scrollLeft()
384 {
384 {
385 m_chart->scroll(dx,dy);
385 m_chart->scrollLeft();
386 }
386 }
387
387
388 void QChartView::scrollRight()
389 {
390 m_chart->scrollRight();
391 }
392
393 void QChartView::scrollUp()
394 {
395 m_chart->scrollUp();
396 }
397
398 void QChartView::scrollDown()
399 {
400 m_chart->scrollDown();
401 }
402
403
388 #include "moc_qchartview.cpp"
404 #include "moc_qchartview.cpp"
389
405
390 QTCOMMERCIALCHART_END_NAMESPACE
406 QTCOMMERCIALCHART_END_NAMESPACE
@@ -43,8 +43,10 public:
43 void zoomIn();
43 void zoomIn();
44 void zoomIn(const QRect& rect);
44 void zoomIn(const QRect& rect);
45 void zoomOut();
45 void zoomOut();
46
46 void scrollLeft();
47 void scroll(int dx,int dy);
47 void scrollRight();
48 void scrollUp();
49 void scrollDown();
48
50
49 void setRubberBandPolicy(const RubberBandPolicy );
51 void setRubberBandPolicy(const RubberBandPolicy );
50 RubberBandPolicy rubberBandPolicy() const;
52 RubberBandPolicy rubberBandPolicy() const;
General Comments 0
You need to be logged in to leave comments. Login now