34 #include <QVarLengthArray> 44 MyTable(QWidget * parent = 0,
const char * name = 0);
45 MyTable(
int numRows,
int numCols, QWidget * parent = 0,
const char * name = 0);
62 enum PlotDesignation{All = -1, None = 0, X = 1, Y = 2, Z = 3, xErr = 4, yErr = 5, Label = 6};
63 enum ColType{Numeric = 0, Text = 1, Date = 2, Time = 3, Month = 4, Day = 5};
73 Q3TableSelection getSelection();
76 void setNumericPrecision(
int prec);
78 void updateDecimalSeparators(
const QLocale& oldSeparators);
79 void setAutoUpdateValues(
bool on =
true);
80 virtual QString sizeToString();
82 double avg(
int col,
int startRow = 0,
int endRow = -1);
83 double sum(
int col,
int startRow = 0,
int endRow = -1);
84 double minColumnValue(
int col,
int startRow = 0,
int endRow = -1);
85 double maxColumnValue(
int col,
int startRow = 0,
int endRow = -1);
86 Table* extractData(
const QString& name,
const QString& condition,
int startRow = 0,
int endRow = -1);
87 static QDateTime dateTime(
double val);
88 static double fromDateTime(
const QDateTime& dt);
89 static double fromTime(
const QTime& t);
93 void copy(
Table *m,
bool values =
true);
96 void setNumRows(
int rows);
97 void setNumCols(
int cols);
102 double cell(
int row,
int col);
103 void setCell(
int row,
int col,
double val);
105 QString text(
int row,
int col);
106 QStringList columnsList();
108 QString colName(
int col);
109 void setColName(
int col,
const QString& text,
bool enumerateRight =
false,
bool warn =
true);
110 QString colLabel(
int col);
111 int colIndex(
const QString& name);
115 void setPlotDesignation(
PlotDesignation pd,
bool rightColumns =
false);
118 void setHeader(QStringList header);
119 void loadHeader(QStringList header);
120 void setHeaderColType();
121 void setText(
int row,
int col,
const QString & text);
122 void setRandomValues();
123 void setRandomValues(
int col,
int startRow = 0,
int endRow = -1);
124 void setNormalRandomValues();
125 void setNormalRandomValues(
int col,
int startRow = 0,
int endRow = -1,
double sigma = 1.0);
128 void cellEdited(
int,
int col);
129 void moveCurrentCell();
130 void clearCell(
int row,
int col);
131 bool isEmptyRow(
int row);
132 bool isEmptyColumn(
int col);
136 void print(QPrinter *);
137 void print(
const QString& fileName);
138 void exportPDF(
const QString& fileName);
142 bool eventFilter(QObject *
object, QEvent *e);
143 void customEvent( QEvent* e);
149 void removeCol(
const QStringList& list);
151 virtual void insertCols(
int start,
int count);
153 void addColumns(
int c);
154 virtual void moveColumn(
int,
int,
int);
155 void swapColumns(
int,
int);
156 void moveColumnBy(
int cols);
157 void hideSelectedColumns();
158 void showAllColumns();
159 void hideColumn(
int col,
bool =
true);
177 void sortColumn(
int col = -1,
int order = 0);
182 void sortTableDialog();
184 void sort(
int type = 0,
int order = 0,
const QString& leadCol = QString());
186 void sortColumns(
int type = 0,
int order = 0,
const QString& leadCol = QString());
193 void sortColumns(
const QStringList& cols,
int type = 0,
int order = 0,
const QString& leadCol = QString());
198 void sortColumnsDialog();
203 void normalizeCol(
int col=-1);
204 void normalizeSelection();
208 QVarLengthArray<double> col(
int ycol);
209 void columnRange(
int c,
double *
min,
double *max);
215 int colY(
int col,
int xCol = -1,
const QStringList& lst = QStringList());
219 void clearCommands();
221 void setCommands(
const QStringList& com);
223 void setCommands(
const QString& com);
225 void setCommand(
int col,
const QString& com);
227 bool calculate(
int col,
int startRow,
int endRow,
bool forceMuParser =
false,
bool notifyChanges =
true);
229 bool muParserCalculate(
int col,
int startRow,
int endRow,
bool notifyChanges =
true);
233 void updateValues(
Table*,
const QString& columnName);
237 void deleteSelectedRows();
238 void deleteRows(
int startRow,
int endRow);
240 void moveRow(
bool up =
true);
246 void copySelection();
247 void clearSelection();
248 void pasteSelection();
249 void selectAllTable();
254 void init(
int rows,
int cols);
255 QStringList writableSelectedColumns();
256 QStringList selectedColumns();
257 QStringList selectedYColumns();
258 QStringList selectedErrColumns();
259 QStringList selectedYLabels();
260 QStringList drawableColumnSelection();
261 QStringList YColumns();
262 int selectedColsNumber();
264 void setColumnWidth(
int width,
bool allCols);
265 void setColumnWidth(
int col,
int width);
266 int columnWidth(
int col);
267 QStringList columnWidths();
268 void setColWidths(
const QStringList& widths);
269 void adjustColumnsWidth(
bool selection =
true);
273 int firstSelectedColumn();
274 int numSelectedRows();
275 bool isRowSelected(
int row,
bool full=
false) {
return d_table->isRowSelected(row, full); }
276 bool isColumnSelected(
int col,
bool full=
false) {
return d_table->isColumnSelected(col, full); }
278 void goToRow(
int row);
280 void goToColumn(
int col);
282 void columnNumericFormat(
int col,
char *f,
int *precision);
283 void columnNumericFormat(
int col,
int *f,
int *precision);
288 void setColumnTypes(
const QStringList& ctl);
295 bool isReadOnlyColumn(
int col);
296 void setReadOnlyColumn(
int col,
bool on =
true);
300 void setColumnsFormat(
const QStringList& lst);
302 void setTextFormat(
int col);
303 void setColNumericFormat(
int col);
304 void setColNumericFormat(
int f,
int prec,
int col,
bool updateCells =
true);
305 bool setDateFormat(
const QString& format,
int col,
bool updateCells =
true);
306 bool setTimeFormat(
const QString& format,
int col,
bool updateCells =
true);
307 void setMonthFormat(
const QString& format,
int col,
bool updateCells =
true);
308 void setDayFormat(
const QString& format,
int col,
bool updateCells =
true);
310 bool exportExcel(
const QString& fname,
bool withLabels,
bool exportComments,
bool exportSelection);
311 bool exportOdsSpreadsheet(
const QString& fname,
bool withLabels,
bool exportComments,
bool exportSelection);
312 bool exportODF(
const QString& fname,
bool withLabels,
bool exportComments,
bool exportSelection);
313 bool exportASCII(
const QString& fname,
const QString& separator,
bool withLabels =
false,
314 bool exportComments =
false,
bool exportSelection =
false);
315 void importASCII(
const QString &fname,
const QString &sep =
"\t",
int ignoredLines = 0,
bool renameCols =
false,
316 bool stripSpaces =
false,
bool simplifySpaces =
false,
bool importComments =
false,
317 const QString& commentString =
"",
bool readOnly =
false,
318 ImportMode importAs = Overwrite,
const QLocale& importLocale = QLocale(),
int endLine = 0,
int maxRows = -1,
319 const QList<int>& newColTypes = QList<int>(),
const QStringList& colFormats = QStringList());
323 virtual void save(
const QString &fn,
const QString& geometry,
bool =
false);
324 void restore(
const QStringList& lst);
326 QString saveHeader();
327 QString saveComments();
328 QString saveCommands();
329 QString saveColumnWidths();
330 QString saveColumnTypes();
331 QString saveReadOnlyInfo();
332 QString saveHiddenColumnsInfo();
334 void setBackgroundColor(
const QColor& col);
335 void setTextColor(
const QColor& col);
336 void setHeaderColor(
const QColor& col);
337 void setTextFont(
const QFont& fnt);
338 void setHeaderFont(
const QFont& fnt);
342 QString comment(
int col);
343 void setColComment(
int col,
const QString& s);
346 void showComments(
bool on =
true);
350 void notifyChanges();
351 void notifyChanges(
const QString& colName);
354 void colWidthModified(
int,
int,
int);
357 void changedColHeader(
const QString&,
const QString&);
358 void removedCol(
const QString&);
359 void addedCol(
const QString&);
360 void removedCol(
int);
361 void colIndexChanged(
int,
int);
362 void modifiedData(
Table *,
const QString&);
363 void optionsDialog();
364 void colValuesDialog();
365 void resizedTable(QWidget*);
366 void showContextMenu(
bool selection);
375 QStringList commands, col_format,
comments, col_label;
382 void setColumnHeader(
int index,
const QString& label);
int selectedCol
Definition: Table.h:377
bool isColumnHidden(int col)
Definition: Table.h:160
QList< int > plotDesignations()
Definition: Table.h:116
void activateNextCell()
Definition: Table.cpp:4003
QStringList getCommands()
Definition: Table.h:217
QList< int > columnTypes()
Definition: Table.h:286
bool isColumnSelected(int col, bool full=false)
Definition: Table.h:276
void setColumnType(int col, ColType val)
Definition: Table.h:289
ImportMode
Definition: Table.h:65
An interpreter for evaluating scripting code. Abstract.
Definition: ScriptingEnv.h:50
add file as new rows to this table
Definition: Table.h:67
int verticalHeaderWidth()
Definition: Table.h:340
int selectedColumn()
Definition: Table.h:272
QList< int > colTypes
Definition: Table.h:376
int colPlotDesignation(int col)
Definition: Table.h:113
add file as new columns to this table
Definition: Table.h:66
#define min(a, b)
Definition: ShapiroWilkTest.cpp:36
MyTable * d_table
Definition: Table.h:369
QtiPlot's main window.
Definition: ApplicationWindow.h:133
QStringList colComments()
Definition: Table.h:344
QStringList getColumnsFormat()
Definition: Table.h:299
bool d_show_comments
Definition: Table.h:374
ColType
Definition: Table.h:63
QString columnFormat(int col)
Definition: Table.h:298
void setColComments(const QStringList &lst)
Definition: Table.h:345
void setSelectedCol(int col)
Definition: Table.h:271
double ** d_saved_cells
Definition: Table.h:379
MyTable * table()
Definition: Table.h:92
int columnType(int col)
Definition: Table.h:284
QStringList comments
Definition: Table.h:375
QStringList colNames()
Definition: Table.h:107
void saveToMemory(double **cells)
Definition: Table.h:291
Base class of all MDI client windows.
Definition: MdiSubWindow.h:51
Interface for maintaining a reference to the current ScriptingEnv.
Definition: Script.h:152
MyTable(QWidget *parent=0, const char *name=0)
Definition: Table.cpp:3995
int d_numeric_precision
Definition: Table.h:378
PlotDesignation
Definition: Table.h:62
NumericFormat
Definition: Table.h:64
MDI window providing a spreadsheet table with column logic.
Definition: Table.h:57
void setColumnTypes(QList< int > ctl)
Definition: Table.h:287
bool isRowSelected(int row, bool full=false)
Definition: Table.h:275
bool commentsEnabled()
Definition: Table.h:347