diff --git a/core/src/tableviewnew3d.cpp b/core/src/tableviewnew3d.cpp index c365b3c..180fcd0 100644 --- a/core/src/tableviewnew3d.cpp +++ b/core/src/tableviewnew3d.cpp @@ -32,6 +32,74 @@ TableViewNew3D::TableViewNew3D(QWidget *parent) : QWidget(parent) } } +void TableViewNew3D::clear() +{ + //Clear everything out + yaxis.clear(); + m_highlightList.clear(); + values.clear(); + xaxis.clear(); +} +void TableViewNew3D::rebuildTable() +{ + yaxis.clear(); + m_highlightList.clear(); + values.clear(); + xaxis.clear(); + for (int y=0;y row; + QList highlightrow; + highlightrow.append(0); //For the Y column + for (int x=0;x m_rowCount) + { + + } + else + { + //Row count stays the same + return; + } + //Assume row count is changing from 0 to whatever + m_rowCount = count; + rebuildTable(); +} +void TableViewNew3D::setItem(int row,int column,QString text) +{ + values[row][column] = text.toDouble(); + update(); +} + +void TableViewNew3D::setColumnCount(int count) +{ + m_columnCount = count; + rebuildTable(); +} + void TableViewNew3D::paintEvent (QPaintEvent *evt) { Q_UNUSED(evt) diff --git a/core/src/tableviewnew3d.h b/core/src/tableviewnew3d.h index f2fe509..bd1fa31 100644 --- a/core/src/tableviewnew3d.h +++ b/core/src/tableviewnew3d.h @@ -8,6 +8,12 @@ class TableViewNew3D : public QWidget Q_OBJECT public: explicit TableViewNew3D(QWidget *parent = 0); + void clear(); + void setRowCount(int count); + void setColumnCount(int count); + void setItem(int row,int column,QString text); + void rebuildTable(); + private: void paintEvent (QPaintEvent *evt); QList xaxis; @@ -23,10 +29,13 @@ class TableViewNew3D : public QWidget QPoint currentCell; QPoint startSelectCell; bool multiSelect; + int m_rowCount; + int m_columnCount; + void rebuildtable(); signals: public slots: }; -#endif // TABLEVIEWNEW3D_H +#endif // TABLEVIEWNEW3D_