@@ -8,10 +8,7 | |||||
8 | ChartView::ChartView(QWidget* parent):QChartView(parent), |
|
8 | ChartView::ChartView(QWidget* parent):QChartView(parent), | |
9 | m_index(0) |
|
9 | m_index(0) | |
10 | { |
|
10 | { | |
11 | QTime now = QTime::currentTime(); |
|
11 | setChartTitle("Four charts"); | |
12 | qsrand((uint)now.msec()); |
|
|||
13 | setChartTitle("Three random line charts"); |
|
|||
14 |
|
||||
15 | QObject::connect(&m_timer,SIGNAL(timeout()),this,SLOT(handleTimeout())); |
|
12 | QObject::connect(&m_timer,SIGNAL(timeout()),this,SLOT(handleTimeout())); | |
16 | m_timer.setInterval(3000); |
|
13 | m_timer.setInterval(3000); | |
17 |
|
14 |
@@ -57,16 +57,16 void ChartWidget::keyPressEvent(QKeyEvent *event) | |||||
57 | zoomOut(); |
|
57 | zoomOut(); | |
58 | break; |
|
58 | break; | |
59 | case Qt::Key_Left: |
|
59 | case Qt::Key_Left: | |
60 |
scroll( |
|
60 | scrollLeft(); | |
61 | break; |
|
61 | break; | |
62 | case Qt::Key_Right: |
|
62 | case Qt::Key_Right: | |
63 |
scroll( |
|
63 | scrollRight(); | |
64 | break; |
|
64 | break; | |
65 | case Qt::Key_Up: |
|
65 | case Qt::Key_Up: | |
66 |
scroll( |
|
66 | scrollUp(); | |
67 | break; |
|
67 | break; | |
68 | case Qt::Key_Down: |
|
68 | case Qt::Key_Down: | |
69 |
scroll( |
|
69 | scrollDown(); | |
70 | break; |
|
70 | break; | |
71 | default: |
|
71 | default: | |
72 | QGraphicsView::keyPressEvent(event); |
|
72 | QGraphicsView::keyPressEvent(event); |
General Comments 0
You need to be logged in to leave comments.
Login now