##// END OF EJS Templates
Fix oscilloscope demos on android...
Heikkinen Miikka -
r2526:383eb97e1450
parent child
Show More
@@ -41,9 +41,8 DataSource::DataSource(QDeclarativeView *appViewer, QObject *parent) :
41
41
42 void DataSource::update(QAbstractSeries *series)
42 void DataSource::update(QAbstractSeries *series)
43 {
43 {
44 QXYSeries *xySeries = qobject_cast<QXYSeries *>(series);
44 if (series) {
45 Q_ASSERT(xySeries);
45 QXYSeries *xySeries = static_cast<QXYSeries *>(series);
46
47 m_index++;
46 m_index++;
48 if (m_index > m_data.count() - 1)
47 if (m_index > m_data.count() - 1)
49 m_index = 0;
48 m_index = 0;
@@ -52,6 +51,7 void DataSource::update(QAbstractSeries *series)
52 // Use replace instead of clear + append, it's optimized for performance
51 // Use replace instead of clear + append, it's optimized for performance
53 xySeries->replace(points);
52 xySeries->replace(points);
54 }
53 }
54 }
55
55
56 void DataSource::generateData(int type, int rowCount, int colCount)
56 void DataSource::generateData(int type, int rowCount, int colCount)
57 {
57 {
@@ -42,9 +42,8 DataSource::DataSource(QQuickView *appViewer, QObject *parent) :
42
42
43 void DataSource::update(QAbstractSeries *series)
43 void DataSource::update(QAbstractSeries *series)
44 {
44 {
45 QXYSeries *xySeries = qobject_cast<QXYSeries *>(series);
45 if (series) {
46 Q_ASSERT(xySeries);
46 QXYSeries *xySeries = static_cast<QXYSeries *>(series);
47
48 m_index++;
47 m_index++;
49 if (m_index > m_data.count() - 1)
48 if (m_index > m_data.count() - 1)
50 m_index = 0;
49 m_index = 0;
@@ -53,6 +52,7 void DataSource::update(QAbstractSeries *series)
53 // Use replace instead of clear + append, it's optimized for performance
52 // Use replace instead of clear + append, it's optimized for performance
54 xySeries->replace(points);
53 xySeries->replace(points);
55 }
54 }
55 }
56
56
57 void DataSource::generateData(int type, int rowCount, int colCount)
57 void DataSource::generateData(int type, int rowCount, int colCount)
58 {
58 {
General Comments 0
You need to be logged in to leave comments. Login now