diff --git a/examples/examples.pro b/examples/examples.pro index 10a3d68..ed20c16 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -14,7 +14,6 @@ SUBDIRS += \ splinechart \ stackedbarchart \ stackedbarchartdrilldown \ - tablemodelchart \ zoomlinechart \ modeldata diff --git a/src/splinechart/splinechartitem_p.h b/src/splinechart/splinechartitem_p.h index 8e84dc9..82edfea 100644 --- a/src/splinechart/splinechartitem_p.h +++ b/src/splinechart/splinechartitem_p.h @@ -49,7 +49,7 @@ private: QPointF calculateGeometryControlPoint(int index) const; private: - QSplineSeries* m_series; + QSplineSeries *m_series; QPainterPath m_path; QRectF m_rect; QPen m_linePen; diff --git a/src/xychart/qxyseries.cpp b/src/xychart/qxyseries.cpp index d3ee496..a15fe17 100644 --- a/src/xychart/qxyseries.cpp +++ b/src/xychart/qxyseries.cpp @@ -380,7 +380,7 @@ void QXYSeries::modelUpdated(QModelIndex topLeft, QModelIndex bottomRight) } else { if (topLeft.column() >= d->m_mapFirst && (!d->m_mapLimited || topLeft.column() < d->m_mapFirst + d->m_mapCount)) emit d->pointReplaced(topLeft.column() - d->m_mapFirst); - } + } } /*! diff --git a/src/xychart/xychartitem.cpp b/src/xychart/xychartitem.cpp index 043579a..49a9025 100644 --- a/src/xychart/xychartitem.cpp +++ b/src/xychart/xychartitem.cpp @@ -110,8 +110,14 @@ void XYChartItem::handlePointAdded(int index) QPointF point; if (m_series->model()) { point = calculateGeometryPoint(index - m_series->mapFirst()); - points.insert(index - m_series->mapFirst(), point); - updateLayout(m_points, points, index - m_series->mapFirst()); + if (index < m_series->mapFirst()) { + points.insert(0, point); + updateLayout(m_points, points, 0); + } + else { + points.insert(index - m_series->mapFirst(), point); + updateLayout(m_points, points, index - m_series->mapFirst()); + } } else { // this checks do not work correctly if model is set diff --git a/examples/tablemodelchart/customtablemodel.cpp b/test/tablemodelchart/customtablemodel.cpp similarity index 100% rename from examples/tablemodelchart/customtablemodel.cpp rename to test/tablemodelchart/customtablemodel.cpp diff --git a/examples/tablemodelchart/customtablemodel.h b/test/tablemodelchart/customtablemodel.h similarity index 100% rename from examples/tablemodelchart/customtablemodel.h rename to test/tablemodelchart/customtablemodel.h diff --git a/examples/tablemodelchart/main.cpp b/test/tablemodelchart/main.cpp similarity index 100% rename from examples/tablemodelchart/main.cpp rename to test/tablemodelchart/main.cpp diff --git a/examples/tablemodelchart/tablemodelchart.pro b/test/tablemodelchart/tablemodelchart.pro similarity index 66% rename from examples/tablemodelchart/tablemodelchart.pro rename to test/tablemodelchart/tablemodelchart.pro index 242bfbb..2f82e55 100644 --- a/examples/tablemodelchart/tablemodelchart.pro +++ b/test/tablemodelchart/tablemodelchart.pro @@ -1,11 +1,5 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2012-03-08T14:30:24 -# -#------------------------------------------------- - -!include( ../examples.pri ) { - error( "Couldn't find the examples.pri file!" ) +!include( ../test.pri ) { + error( "Couldn't find the test.pri file!" ) } QT += core gui diff --git a/examples/tablemodelchart/tablewidget.cpp b/test/tablemodelchart/tablewidget.cpp similarity index 100% rename from examples/tablemodelchart/tablewidget.cpp rename to test/tablemodelchart/tablewidget.cpp diff --git a/examples/tablemodelchart/tablewidget.h b/test/tablemodelchart/tablewidget.h similarity index 100% rename from examples/tablemodelchart/tablewidget.h rename to test/tablemodelchart/tablewidget.h diff --git a/test/test.pro b/test/test.pro index e7efab5..1ebcc1e 100644 --- a/test/test.pro +++ b/test/test.pro @@ -2,7 +2,8 @@ TEMPLATE = subdirs SUBDIRS += \ chartwidgettest \ wavechart \ - gdpbarchart + gdpbarchart \ + tablechartmodel !win32:{ SUBDIRS += auto