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

Table Class Reference

#include <Table.h>

Inheritance diagram for Table:

TableView scripted MyWidget TableStatistics

List of all members.

Detailed Description

MDI window providing a spreadsheet table with column logic.

Definition at line 49 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, DateTime = 6
enum  Status { Hidden = -1, Normal = 0, Minimized = 1, Maximized = 2 }

Public Slots

void activateFormulaMode (bool on)
double cell (int row, int col)
 Return the value of the cell as a double.
void clearCell (int row, int col)
QString colComment (int col)
QStringList colComments ()
int colIndex (const QString &name)
QString colLabel (int col)
QString colName (int col)
QStringList colNames ()
SciDAVis::PlotDesignation colPlotDesignation (int col)
Columncolumn (const QString &name) const
 Return the column determined by the given name.
Columncolumn (int index) const
 Return column number 'index'.
int columnCount ()
QString columnFormat (int col)
QStringList columnsList ()
int columnType (int col)
QList< int > columnTypes ()
int columnWidth (int col)
int colX (int col)
int colY (int col)
bool commentsEnabled ()
void copy (Table *m)
void customEvent (QEvent *e)
void deselectAll ()
QStringList drawableColumnSelection ()
bool exportASCII (const QString &fname, const QString &separator, bool withLabels=false, bool exportSelection=false)
void exportPDF (const QString &fileName)
int firstXCol ()
void goToCell (int row, int col)
void goToNextColumn ()
void goToPreviousColumn ()
void handleChange ()
void handleColumnChange (int, int, int, int)
void handleColumnChange (int, int)
void handleColumnsAboutToBeRemoved (int, int)
void handleColumnsRemoved (int, int)
void handleHorizontalSectionResized (int logicalIndex, int oldSize, int newSize)
void handleRowChange ()
void importASCII (const QString &fname, const QString &sep, int ignoredLines, bool renameCols, bool stripSpaces, bool simplifySpaces, bool newTable)
void importV0x0001XXHeader (QStringList header)
void init ()
bool noXColumn ()
bool noYColumn ()
int numCols ()
int numRows ()
int numSelectedRows ()
QList< int > plotDesignations ()
void print (const QString &fileName)
void print ()
bool recalculate ()
 Recalculate selected cells.
bool recalculate (int col, bool only_selected_rows=true)
 Compute cells from the cell formulas.
void rereadSectionSizes ()
void restore (const QStringList &lst)
 Not implemented yet.
int rowCount ()
QString saveAsTemplate (const QString &geometryInfo)
void selectAll ()
int selectedColsNumber ()
QStringList selectedColumns ()
QStringList selectedErrColumns ()
QStringList selectedYColumns ()
QMap< int, QString > selectedYLabels ()
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)
void setColPlotDesignation (int col, SciDAVis::PlotDesignation d)
void setColumnType (int col, SciDAVis::ColumnMode mode)
void setColumnTypes (const QStringList &ctl)
void setColumnTypes (QList< 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.
void setHeader (QStringList header)
void setHeaderColor (const QColor &col)
void setHeaderFont (const QFont &fnt)
void setNumCols (int cols)
void setNumRows (int rows)
void setPlotDesignation (SciDAVis::PlotDesignation pd)
void setText (int row, int col, const QString &text)
void setTextColor (const QColor &col)
void setTextFont (const QFont &fnt)
void showControlDescriptionTab ()
void showControlFormulaTab ()
void showControlTypeTab ()
QString text (int row, int col)
void toggleComments ()
void toggleControlTabBar ()
int verticalHeaderWidth ()
QStringList YColumns ()
Column Operations
void addCol (SciDAVis::PlotDesignation pd=SciDAVis::Y)
void addColumns (int c)
void clearCol ()
void insertCol ()
void insertCols (int start, int count)
void removeCol (const QStringList &list)
void removeCol ()
void clear ()
void clearSelection ()
void copySelection ()
void cutSelection ()
 Selection Operations.
void deselect ()
void pasteSelection ()
void selectAllTable ()
Row Operations
void deleteSelectedRows ()
void insertRow ()
Saving and Restoring
QString saveColumnTypes ()
QString saveColumnWidths ()
QString saveCommands ()
QString saveComments ()
QString saveHeader ()
virtual QString saveToString (const QString &geometry)


void aboutToRemoveCol (const QString &)
void changedColHeader (const QString &, const QString &)
void closedWindow (MyWidget *)
 Emitted when the window was closed.
void hiddenWindow (MyWidget *)
 Emitted when the window was hidden.
void modifiedData (Table *, const QString &)
void modifiedWindow (QWidget *)
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

bool areCommentsShown () const
 Return whether comments are show currently.
void askOnCloseEvent (bool ask)
 Toggle the "ask on close" flag.
QString aspect ()
 Return the window status as a string.
virtual QString birthDate ()
 Return the creation date.
virtual CaptionPolicy captionPolicy ()
 Return the caption policy.
void closeEvent (QCloseEvent *)
 Close event handler.
int columnWidth (int col) const
Folderfolder ()
 Returns the pointer to the parent folder of the window.
bool formulaModeActive () const
bool isControlTabBarVisible ()
virtual QString name ()
 Return the window name.
void notifyChanges ()
 Notifies the main application that the window has been modified.
void scriptingChangeEvent (ScriptingChangeEvent *)
void scriptingChangeEvent (ScriptingChangeEvent *)
virtual void setBirthDate (const QString &s)
 Set the creation date.
void setCaptionPolicy (CaptionPolicy policy)
 Set the caption policy.
void setColumnWidth (int col, int width)
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 setMaximized ()
void setMinimized ()
virtual 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).
virtual void setWindowLabel (const QString &s)
 Set the window label.
void showComments (bool on=true)
 Show or hide (if on = false) the column comments.
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 char *name=0, Qt::WFlags f=0)
 Table (ScriptingEnv *env, const QString &fname, const QString &sep, int ignoredLines, bool renameCols, bool stripSpaces, bool simplifySpaces, bool convertToNumeric, QLocale numericFormat, const QString &label, QWidget *parent=0, const char *name=0, Qt::WFlags f=0)
virtual QString windowLabel ()
 Return the window label.
selection related functions
int firstSelectedColumn (bool full=false)
 Return the index of the first selected column.
int firstSelectedRow (bool full=false)
 Return the index of the first selected row.
void getCurrentCell (int *row, int *col)
 Determine the current cell (-1 if no cell is designated as the current).
bool isCellSelected (int row, int col)
 Return whether a cell is selected.
bool isColumnSelected (int col, bool full=false)
 Returns true if column 'col' is selected; otherwise false.
bool isRowSelected (int row, bool full=false)
 Returns true if row 'row' is selected; otherwise false.
int lastSelectedColumn (bool full=false)
 Return the index of the last selected column.
int lastSelectedRow (bool full=false)
 Return the index of the last selected row.
int selectedColumnCount (SciDAVis::PlotDesignation pd)
 Return how many columns with the given plot designation are (at least partly) selected.
int selectedColumnCount (bool full=false)
 Return how many columns are selected.
QList< Column * > selectedColumns (bool full=false)
 Return all selected columns.
int selectedRowCount (bool full=false)
 Return how many rows are (at least partly) selected.
IntervalAttribute< bool > selectedRows (bool full=false)
 Get the complete set of selected rows.
void setCellSelected (int row, int col, bool select=true)
 Select/Deselect a cell.
void setCellsSelected (int first_row, int first_col, int last_row, int last_col, bool select=true)
 Select/Deselect a range of cells.

Public Attributes


Protected Slots

void addFunction ()
void addReference ()
void advanceCell ()
 Advance current cell after [Return] or [Enter] was pressed.
void applyDescription ()
void applyFormula ()
void applyType ()
void currentColumnChanged (const QModelIndex &current, const QModelIndex &previous)
void handleAspectAboutToBeRemoved (const AbstractAspect *aspect, int index)
void handleAspectAdded (const AbstractAspect *aspect)
void handleAspectDescriptionAboutToChange (const AbstractAspect *aspect)
void handleAspectDescriptionChange (const AbstractAspect *aspect)
void handleAspectDescriptionChanged (const AbstractAspect *aspect)
void handleHeaderDataChanged (Qt::Orientation orientation, int first, int last)
void handleHorizontalHeaderDoubleClicked (int index)
void handleHorizontalSectionMoved (int index, int from, int to)
void selectionChanged (const QItemSelection &selected, const QItemSelection &deselected)
void updateCaption ()
 Set caption according to current CaptionPolicy, name and label.
void updateFormatBox ()
void updateFunctionDoc ()
void updateTypeInfo ()

Protected Member Functions

virtual void changeEvent (QEvent *event)
 Catches parent changes (in order to gain access to the title bar).
bool eventFilter (QObject *watched, QEvent *event)
 Filters other object's events (customizes title bar's context menu).
void retranslateStrings ()
void setColumnForControlTabs (int col)

Protected Attributes

bool askOnClose
 Toggle on/off: Ask the user "delete, hide, or cancel?" on a close event.
QString birthdate
 The creation date.
CaptionPolicy caption_policy
 The caption policy.
QWidget * d_control_tabs
 Widget that contains the control tabs UI from ui.
 Pointer to the item delegate.
QToolButton * d_hide_button
 Button to toogle the visibility of d_tool_box.
QHBoxLayout * d_main_layout
 Pointer to the current underlying model.
 The table view (first part of the UI).
 Pointer to the parent folder of the window.
QWidget * titleBar
 Title bar of this MDI window if it currently belongs to a QWorkspace, NULL else.
Ui::ControlTabs ui
 UI with options tabs (description, format, formula etc.).
QString w_label
 The window label.
Status w_status
 The window status.

Private Attributes

QHash< const AbstractAspect
*, QString > 

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

Generated by  Doxygen 1.6.0   Back to index