Logo Search packages:      
Sourcecode: qtiplot version File versions  Download package

Table Class Reference

#include <Table.h>

Inheritance diagram for Table:

MyWidget scripted TableStatistics

List of all members.


Detailed Description

MDI window providing a spreadsheet table with column logic.

Future Plans

Port to the Model/View approach used in Qt4 and get rid of the Qt3Support dependancy. [ assigned to thzs ]

Definition at line 60 of file Table.h.


Public Types

enum  CaptionPolicy { Name = 0, Label = 1, Both = 2 }
 Possible window captions. More...
enum  ColType {
  Numeric = 0, Text = 1, Date = 2, Time = 3,
  Month = 4, Day = 5
}
enum  PlotDesignation {
  All = -1, None = 0, X = 1, Y = 2,
  Z = 3, xErr = 4, yErr = 5, Label = 6
}
enum  Status { Hidden = -1, Normal = 0, Minimized = 1, Maximized = 2 }

Public Slots

bool calculate ()
 Compute selected cells from column formulae; use current cell if there's no selection.
bool calculate (int col, int startRow, int endRow)
 Compute specified cells from column formula.
double cell (int row, int col)
 Return the value of the cell as a double.
void cellEdited (int, int col)
void changeColWidth (int width, int col)
void changeColWidth (int width, bool allCols)
void clearCell (int row, int col)
QVarLengthArray< double > col (int ycol)
QString colComment (int col)
QStringList colComments ()
int colIndex (const QString &name)
QString colLabel (int col)
QString colName (int col)
QStringList colNames ()
int colPlotDesignation (int col)
QString columnFormat (int col)
void columnNumericFormat (int col, int *f, int *precision)
void columnNumericFormat (int col, char *f, int *precision)
QStringList columnsList ()
int columnType (int col)
Q3ValueList< int > columnTypes ()
int columnWidth (int col)
QStringList columnWidths ()
void colWidthModified (int, int, int)
 Notifies the main application that the width of a table column has been modified by the user.
int colX (int col)
int colY (int col)
bool commentsEnabled ()
void copy (Table *m)
QStringList drawableColumnSelection ()
bool exportASCII (const QString &fname, const QString &separator, bool withLabels=false, bool exportComments=false, bool exportSelection=false)
void exportPDF (const QString &fileName)
int firstSelectedColumn ()
int firstXCol ()
void freeMemory ()
QStringList getColumnsFormat ()
QStringList getCommands ()
void goToRow (int row)
 Scroll to row (row starts with 1).
void importASCII (const QString &fname, const QString &sep, int ignoredLines, bool renameCols, bool stripSpaces, bool simplifySpaces, bool importComments, bool newTable, const QString &commentString, bool readOnly=false)
void importMultipleASCIIFiles (const QString &fname, const QString &sep, int ignoredLines, bool renameCols, bool stripSpaces, bool simplifySpaces, bool importComments, const QString &commentString, bool readOnly, int importFileAs)
void init (int rows, int cols)
bool isColumnSelected (int col, bool full=false)
bool isEmptyColumn (int col)
bool isEmptyRow (int row)
bool isReadOnlyColumn (int col)
bool isRowSelected (int row, bool full=false)
void loadHeader (QStringList header)
void moveCurrentCell ()
int nonEmptyRows ()
void notifyChanges ()
 This slot notifies the main application that the table has been modified. Triggers the update of 2D plots.
bool noXColumn ()
bool noYColumn ()
int numCols ()
int numRows ()
int numSelectedRows ()
Q3ValueList< int > plotDesignations ()
void print (const QString &fileName)
void print ()
void resizeCols (int)
void resizeRows (int)
void restore (const QStringList &lst)
 Not implemented yet.
QString saveAsTemplate (const QString &geometryInfo)
QString saveText ()
void saveToMemory ()
void saveToMemory (double **cells)
int selectedColsNumber ()
int selectedColumn ()
QStringList selectedColumns ()
QStringList selectedErrColumns ()
QStringList selectedYColumns ()
QStringList selectedYLabels ()
void setAscValues ()
void setBackgroundColor (const QColor &col)
void setCell (int row, int col, double val)
void setColComment (int col, const QString &s)
void setColComments (const QStringList &lst)
void setColName (int col, const QString &text, bool enumerateRight=false)
void setColNumericFormat (int f, int prec, int col, bool updateCells=true)
void setColPlotDesignation (int col, PlotDesignation pd)
void setColumnsFormat (const QStringList &lst)
void setColumnType (int col, ColType val)
void setColumnTypes (const QStringList &ctl)
void setColumnTypes (Q3ValueList< int > ctl)
void setColWidths (const QStringList &widths)
void setCommand (int col, const QString &com)
 Set formula for column col.
void setCommands (const QString &com)
 Set all column formulae.
void setCommands (const QStringList &com)
 Set all column formulae.
bool setDateFormat (const QString &format, int col, bool updateCells=true)
void setDayFormat (const QString &format, int col, bool updateCells=true)
void setHeader (QStringList header)
void setHeaderColor (const QColor &col)
void setHeaderColType ()
void setHeaderFont (const QFont &fnt)
void setMonthFormat (const QString &format, int col, bool updateCells=true)
void setNumCols (int cols)
void setNumRows (int rows)
void setPlotDesignation (PlotDesignation pd, bool rightColumns=false)
void setRandomValues ()
void setReadOnlyColumn (int col, bool on=true)
void setSelectedCol (int col)
void setText (int row, int col, const QString &text)
void setTextColor (const QColor &col)
void setTextFont (const QFont &fnt)
void setTextFormat (int col)
bool setTimeFormat (const QString &format, int col, bool updateCells=true)
void showComments (bool on=true)
MyTable * table ()
QString text (int row, int col)
int verticalHeaderWidth ()
QStringList YColumns ()
Column Operations
void addCol (PlotDesignation pd=Y)
void addColumns (int c, bool readOnly=false)
void clearCol ()
void insertCol ()
void insertCols (int start, int count)
void moveColumn (int, int, int)
void moveColumnBy (int cols)
void removeCol (const QStringList &list)
void removeCol ()
void swapColumns (int, int)
void clear ()
void clearSelection ()
void copySelection ()
void cutSelection ()
 Selection Operations.
void deselect ()
void pasteSelection ()
void selectAllTable ()
Event Handlers
void contextMenuEvent (QContextMenuEvent *e)
void customEvent (QEvent *e)
bool eventFilter (QObject *object, QEvent *e)
 Filters other object's events (customizes title bar's context menu).
Row Operations
void deleteRows (int startRow, int endRow)
void deleteSelectedRows ()
void insertRow ()
Saving and Restoring
QString & getNewSpecifications ()
QString & getSpecifications ()
QString newCaption ()
QString oldCaption ()
void restore (QString &spec)
QString saveColumnTypes ()
QString saveColumnWidths ()
QString saveCommands ()
QString saveComments ()
QString saveHeader ()
QString saveReadOnlyInfo ()
virtual QString saveToString (const QString &geometry, bool=false)
void setNewSpecifications ()
void setSpecifications (const QString &s)
Normalization
void normalize ()
void normalizeCol (int col=-1)
void normalizeSelection ()
Sorting
void sort (int type=0, int order=0, const QString &leadCol=QString())
 Sort all columns as in sortColumns(const QStringList&,int,int,const QString&).
void sortColAsc ()
 Sort the current column in ascending order.
void sortColDesc ()
 Sort the current column in descending order.
void sortColumn (int col=-1, int order=0)
 Sort the specified column.
void sortColumns (const QStringList &cols, int type=0, int order=0, const QString &leadCol=QString())
 Sort the specified columns.
void sortColumns (int type=0, int order=0, const QString &leadCol=QString())
 Sort selected columns as in sortColumns(const QStringList&,int,int,const QString&).
void sortColumnsDialog ()
 Display a dialog with some options for sorting the selected columns.
void sortTableDialog ()
 Display a dialog with some options for sorting all columns.

Signals

void changedColHeader (const QString &, const QString &)
void closedWindow (MyWidget *)
 Emitted when the window was closed.
void colValuesDialog ()
void createTable (const QString &, int, int, const QString &)
void hiddenWindow (MyWidget *)
 Emitted when the window was hidden.
void modifiedData (Table *, const QString &)
void modifiedWindow (QWidget *)
void moved ()
void optionsDialog ()
void removedCol (const QString &)
void resizedTable (QWidget *)
void resizedWindow (QWidget *)
void showContextMenu (bool selection)
void showTitleBarMenu ()
 Emitted when the title bar recieves a QContextMenuEvent.
void statusChanged (MyWidget *)
 Emitted when the window status changed.

Public Member Functions

void askOnCloseEvent (bool ask)
 Toggle the "ask on close" flag.
QString aspect ()
 Return the window status as a string.
QString birthDate ()
 Return the creation date.
CaptionPolicy captionPolicy ()
 Return the caption policy.
void closeEvent (QCloseEvent *)
 Close event handler.
Folderfolder ()
 Returns the pointer to the parent folder of the window.
Q3TableSelection getSelection ()
QLocale locale ()
QString name ()
 Return the window name.
void resetHeader ()
void resizeEvent (QResizeEvent *)
void scriptingChangeEvent (ScriptingChangeEvent *)
void setBirthDate (const QString &s)
 Set the creation date.
void setCaptionPolicy (CaptionPolicy policy)
 Set the caption policy.
void setFolder (Folder *f)
 Initializes the pointer to the parent folder of the window.
virtual void setHidden ()
 Notifies that a window was hidden by a direct user action.
void setLocale (const QLocale &l)
void setMaximized ()
void setMinimized ()
void setName (const QString &s)
 Set the window name.
void setNormal ()
void setNumericPrecision (int prec)
 Sets the number of significant digits.
void setStatus (Status s)
 Set the window status flag (hidden, normal, minimized or maximized).
void setWindowLabel (const QString &s)
 Set the window label.
virtual QString sizeToString ()
 Size of the widget as a string.
Status status ()
 Return the window status flag (hidden, normal, minimized or maximized).
 Table (ScriptingEnv *env, int r, int c, const QString &label, QWidget *parent=0, const QString &name=QString(), Qt::WFlags f=0)
 Table (ScriptingEnv *env, const QString &fname, const QString &sep, int ignoredLines, bool renameCols, bool stripSpaces, bool simplifySpaces, bool importComments, const QString &commentString, bool readOnly, const QString &label, QWidget *parent=0, const QString &name=QString(), Qt::WFlags f=0)
void updateDecimalSeparators (const QLocale &oldSeparators)
 Updates the decimal separators when importing ASCII files on user request.
void updateDecimalSeparators ()
 Updates the decimal separators in the numerical columns on user request.
QString windowLabel ()
 Return the window label.

Protected Member Functions

virtual void changeEvent (QEvent *event)
 Catches parent changes (in order to gain access to the title bar).

Protected Attributes

MyTable * d_table
ScriptingEnvscriptEnv
QWidget * titleBar
 Title bar of this MDI window if it currently belongs to a QWorkspace, NULL else.

Private Member Functions

void setColumnHeader (int index, const QString &label)
 Internal function to change the column header.

Private Attributes

QStringList col_format
QStringList col_label
QList< int > col_plot_type
QList< int > colTypes
QStringList commands
QStringList comments
int d_numeric_precision
QList< bool > d_read_only
double ** d_saved_cells
bool d_show_comments
QString newSpecifications
int selectedCol
QString specifications

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index