Go to the documentation of this file.00001
00022 #ifndef DGVTABLE_H
00023 #define DGVTABLE_H
00024
00025 #include <QtGui/QTableWidget>
00026 #include <QtGui/QtGui>
00027
00028 #include "DGVPlot.h"
00029
00030
00031 typedef double tableType;
00032
00040 class DGV_EXPORT DGVTable : public QTableWidget
00041 {
00042 Q_OBJECT
00043
00044 public:
00049 DGVTable(QWidget *parent = 0);
00054 virtual ~DGVTable();
00059 void setName(QString filename);
00064 virtual void setItem(int row, int column, tableType value);
00065 virtual void setItem(int row, int column, QString value);
00070 tableType getItem(int x, int y);
00071
00076 bool loadCSV(const QString filename);
00081 void setData(Array<tableType,2> &values);
00086 Array<tableType,2>& data();
00087
00092 inline void clearArray()
00093 { tableData.free(); }
00098 QString strippedName();
00103 QString strippedNamePrefix();
00104
00105 public slots:
00110 void zapSelection();
00115 void delSelection();
00120 void plotSelection();
00125 void scanSelection();
00130 void saveSelection();
00135 void saveAll();
00136
00137 signals:
00142 void plotAvailable(DGVPlot *);
00147
00148
00149 protected:
00150 QString name;
00151
00152 QAction *zapAct;
00153 QAction *delAct;
00154
00155 QAction *plotAct;
00156 QAction *scanAct;
00157
00158 QAction *saveAct;
00159 QAction *saveAllAct;
00160 QAction *closeAct;
00161
00162
00163 Array<tableType,2> tableData;
00164
00169 virtual void contextMenuEvent(QContextMenuEvent *event);
00174 void createConnections();
00175 };
00176
00177
00178
00179 #endif // DGVTABLE_H