QtiPlot  0.9.8.2
TableStatistics.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : TableStatistics.h
3  Project : QtiPlot
4 --------------------------------------------------------------------
5  Copyright : (C) 2006 by Knut Franke
6  Email (use @ for *) : knut.franke*gmx.de
7  Description : Table subclass that displays statistics on
8  columns or rows of another table
9 
10  ***************************************************************************/
11 
12 /***************************************************************************
13  * *
14  * This program is free software; you can redistribute it and/or modify *
15  * it under the terms of the GNU General Public License as published by *
16  * the Free Software Foundation; either version 2 of the License, or *
17  * (at your option) any later version. *
18  * *
19  * This program is distributed in the hope that it will be useful, *
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22  * GNU General Public License for more details. *
23  * *
24  * You should have received a copy of the GNU General Public License *
25  * along with this program; if not, write to the Free Software *
26  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
27  * Boston, MA 02110-1301 USA *
28  * *
29  ***************************************************************************/
30 #ifndef TABLE_STATISTICS_H
31 #define TABLE_STATISTICS_H
32 
33 #include "Table.h"
34 
40 class TableStatistics : public Table
41 {
42  Q_OBJECT
43 
44  public:
46  enum Type { row, column };
48  TableStatistics(ScriptingEnv *env, ApplicationWindow *parent, Table *base, Type, QList<int> targets, int start = 0, int end = -1);
50  Type type() const { return d_type; }
52  Table *base() const { return d_base; }
53  void setBase(Table *t);
54  // saving
55  virtual void save(const QString&, const QString &geometry, bool = false);
56  void setColumnStatsTypes(const QList<int>& colStatTypes);
57  void setRange(int start, int end);
58 
59  QString baseName(){return d_base_name;}
60  void setBaseName(const QString& name){d_base_name = name;}
61 
62  public slots:
64  void update();
66  void update(Table*, const QString& colName);
68  void renameCol(const QString&, const QString&);
70  void removeCol(const QString&);
71 
72  private slots:
73  void closedBase();
74  void removeStatsCol(int);
75  void moveColumn(int, int, int);
76  void changeColIndex(int, int);
77  void insertCols(int start, int count);
78  void addCol(PlotDesignation pd = Y);
79 
80  private:
83  QList<int> d_targets;
84  QList<int> d_stats_col_type;
85  int d_start, d_end;
86  QString d_base_name;
87 };
88 
89 #endif
Definition: TableStatistics.h:47
void removeStatsCol(int)
Definition: TableStatistics.cpp:418
Definition: TableStatistics.h:47
Definition: TableStatistics.h:47
QString d_base_name
Definition: TableStatistics.h:86
Table * base() const
return the base table of which statistics are displayed
Definition: TableStatistics.h:52
void moveColumn(int, int, int)
Definition: TableStatistics.cpp:147
void closedBase()
Definition: TableStatistics.cpp:177
Definition: TableStatistics.h:47
Definition: TableStatistics.h:47
Definition: TableStatistics.h:47
Definition: TableStatistics.h:46
An interpreter for evaluating scripting code. Abstract.
Definition: ScriptingEnv.h:50
Table that computes and displays statistics on another Table.
Definition: TableStatistics.h:40
Definition: TableStatistics.h:47
void renameCol(const QString &, const QString &)
handle renaming of columns (to be connected with Table::changedColHeader)
Definition: TableStatistics.cpp:388
Definition: TableStatistics.h:47
Type type() const
return the type of statistics
Definition: TableStatistics.h:50
QList< int > d_stats_col_type
Definition: TableStatistics.h:84
void setBase(Table *t)
Definition: TableStatistics.cpp:98
Definition: Table.h:62
Definition: TableStatistics.h:46
void setBaseName(const QString &name)
Definition: TableStatistics.h:60
virtual void save(const QString &, const QString &geometry, bool=false)
Definition: TableStatistics.cpp:430
Definition: TableStatistics.h:47
Definition: TableStatistics.h:47
int d_start
Definition: TableStatistics.h:85
Definition: TableStatistics.h:47
Type d_type
Definition: TableStatistics.h:82
QString colName(int col)
Definition: Table.cpp:1055
QtiPlot's main window.
Definition: ApplicationWindow.h:133
void removeCol()
Definition: Table.cpp:1726
void changeColIndex(int, int)
Definition: TableStatistics.cpp:142
void update()
update statistics when the user triggers a recaculate action
Definition: TableStatistics.cpp:182
void setRange(int start, int end)
Definition: TableStatistics.cpp:424
QList< int > d_targets
Definition: TableStatistics.h:83
void addCol(PlotDesignation pd=Y)
Definition: TableStatistics.cpp:171
Definition: TableStatistics.h:47
Definition: TableStatistics.h:47
Definition: TableStatistics.h:47
StatisticsColType
Definition: TableStatistics.h:47
Definition: TableStatistics.h:47
Table * d_base
Definition: TableStatistics.h:81
QString baseName()
Definition: TableStatistics.h:59
PlotDesignation
Definition: Table.h:62
MDI window providing a spreadsheet table with column logic.
Definition: Table.h:57
void insertCols(int start, int count)
Definition: TableStatistics.cpp:158
TableStatistics(ScriptingEnv *env, ApplicationWindow *parent, Table *base, Type, QList< int > targets, int start=0, int end=-1)
Definition: TableStatistics.cpp:41
int d_end
Definition: TableStatistics.h:85
Type
supported statistics types
Definition: TableStatistics.h:46
QString name()
Return the window name.
Definition: MdiSubWindow.h:84
void setColumnStatsTypes(const QList< int > &colStatTypes)
Definition: TableStatistics.cpp:136
Definition: TableStatistics.h:47