diff --git a/examples/examples.pro b/examples/examples.pro index 10a3d683..ed20c16f 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -14,7 +14,6 @@ SUBDIRS += \ splinechart \ stackedbarchart \ stackedbarchartdrilldown \ - tablemodelchart \ zoomlinechart \ modeldata diff --git a/examples/tablemodelchart/tablemodelchart.pro b/examples/tablemodelchart/tablemodelchart.pro deleted file mode 100644 index 242bfbbd..00000000 --- a/examples/tablemodelchart/tablemodelchart.pro +++ /dev/null @@ -1,22 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2012-03-08T14:30:24 -# -#------------------------------------------------- - -!include( ../examples.pri ) { - error( "Couldn't find the examples.pri file!" ) -} - -QT += core gui - -TARGET = tablemodelchart -TEMPLATE = app - - -SOURCES += main.cpp\ - tablewidget.cpp \ - customtablemodel.cpp - -HEADERS += tablewidget.h \ - customtablemodel.h diff --git a/src/splinechart/splinechartitem_p.h b/src/splinechart/splinechartitem_p.h index 8e84dc90..82edfea7 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 d3ee496a..a15fe172 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 043579af..49a9025f 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/test/tablemodelchart/tablemodelchart.pro b/test/tablemodelchart/tablemodelchart.pro new file mode 100644 index 00000000..2f82e55e --- /dev/null +++ b/test/tablemodelchart/tablemodelchart.pro @@ -0,0 +1,16 @@ +!include( ../test.pri ) { + error( "Couldn't find the test.pri file!" ) +} + +QT += core gui + +TARGET = tablemodelchart +TEMPLATE = app + + +SOURCES += main.cpp\ + tablewidget.cpp \ + customtablemodel.cpp + +HEADERS += tablewidget.h \ + customtablemodel.h 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 e7efab50..1ebcc1eb 100644 --- a/test/test.pro +++ b/test/test.pro @@ -2,7 +2,8 @@ TEMPLATE = subdirs SUBDIRS += \ chartwidgettest \ wavechart \ - gdpbarchart + gdpbarchart \ + tablechartmodel !win32:{ SUBDIRS += auto