SciDAVis  1.D4
Public Slots | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes
TableView Class Reference

View class for Table. More...

#include <TableView.h>

Inheritance diagram for TableView:
MyWidget Table TableStatistics

List of all members.

Public Slots

void activateFormulaMode (bool on)
void deselectAll ()
void goToCell (int row, int col)
void goToNextColumn ()
void goToPreviousColumn ()
void handleHorizontalSectionResized (int logicalIndex, int oldSize, int newSize)
void rereadSectionSizes ()
void selectAll ()
void showControlDescriptionTab ()
void showControlFormulaTab ()
void showControlTypeTab ()
void toggleComments ()
void toggleControlTabBar ()

Public Member Functions

bool areCommentsShown () const
 Return whether comments are show currently.
int columnWidth (int col) const
bool formulaModeActive () const
bool isControlTabBarVisible ()
void setColumnWidth (int col, int width)
void showComments (bool on=true)
 Show or hide (if on = false) the column comments.
 TableView (future::Table *table)
virtual ~TableView ()
selection related functions
int selectedColumnCount (bool full=false)
 Return how many columns are selected.
int selectedColumnCount (SciDAVis::PlotDesignation pd)
 Return how many columns with the given plot designation are (at least partly) selected.
bool isColumnSelected (int col, bool full=false)
 Returns true if column 'col' is selected; otherwise false.
QList< Column * > selectedColumns (bool full=false)
 Return all selected columns.
int selectedRowCount (bool full=false)
 Return how many rows are (at least partly) selected.
bool isRowSelected (int row, bool full=false)
 Returns true if row 'row' is selected; otherwise false.
int firstSelectedColumn (bool full=false)
 Return the index of the first selected column.
int lastSelectedColumn (bool full=false)
 Return the index of the last selected column.
int firstSelectedRow (bool full=false)
 Return the index of the first selected row.
int lastSelectedRow (bool full=false)
 Return the index of the last selected row.
IntervalAttribute< bool > selectedRows (bool full=false)
 Get the complete set of selected rows.
bool isCellSelected (int row, int col)
 Return whether a cell is selected.
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.
void getCurrentCell (int *row, int *col)
 Determine the current cell (-1 if no cell is designated as the current)
- Public Member Functions inherited from MyWidget
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.
virtual void exportPDF (const QString &)
Folderfolder ()
 Returns the pointer to the parent folder of the window.
 MyWidget (const QString &label=QString(), QWidget *parent=0, const QString name=0, Qt::WFlags f=0)
virtual QString name ()
 Return the window name.
void notifyChanges ()
 Notifies the main application that the window has been modified.
virtual void print ()
virtual void restore (const QStringList &)
 Not implemented yet.
virtual QString saveAsTemplate (const QString &)
virtual QString saveToString (const QString &)
virtual void setBirthDate (const QString &s)
 Set the creation date.
virtual 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 setMaximized ()
void setMinimized ()
virtual void setName (const QString &s)
 Set the window name.
void setNormal ()
void setStatus (Status s)
 Set the window status flag (hidden, normal, minimized or maximized)
virtual void setWindowLabel (const QString &s)
 Set the window label.
Status status ()
 Return the window status flag (hidden, normal, minimized or maximized)
virtual QString windowLabel ()
 Return the window label.

Protected Slots

void advanceCell ()
 Advance current cell after [Return] or [Enter] was pressed.
void applyDescription ()
void applyType ()
void currentColumnChanged (const QModelIndex &current, const QModelIndex &previous)
void handleAspectAboutToBeRemoved (const AbstractAspect *aspect, int index)
void handleAspectAdded (const AbstractAspect *aspect)
void handleAspectDescriptionChanged (const AbstractAspect *aspect)
void handleFormatLineEditChange ()
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 updateFormatBox ()
void updateTypeInfo ()
- Protected Slots inherited from MyWidget
void updateCaption ()
 Set caption according to current CaptionPolicy, name and label.

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 init ()
void retranslateStrings ()
void setColumnForControlTabs (int col)

Protected Attributes

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)
Ui::ControlTabs ui
 UI with options tabs (description, format, formula etc.)
- Protected Attributes inherited from MyWidget
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.
 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.
QString w_label
 The window label.
Status w_status
 The window status.

Additional Inherited Members

- Public Types inherited from MyWidget
enum  CaptionPolicy { Name = 0, Label = 1, Both = 2 }
 Possible window captions. More...
enum  Status { Hidden = -1, Normal = 0, Minimized = 1, Maximized = 2 }
- Signals inherited from MyWidget
void closedWindow (MyWidget *)
 Emitted when the window was closed.
void hiddenWindow (MyWidget *)
 Emitted when the window was hidden.
void modifiedWindow (QWidget *)
void resizedWindow (QWidget *)
void showTitleBarMenu ()
 Emitted when the title bar recieves a QContextMenuEvent.
void statusChanged (MyWidget *)
 Emitted when the window status changed.

Detailed Description

View class for Table.

Constructor & Destructor Documentation

TableView::TableView ( future::Table table)


References d_model, and init().

TableView::~TableView ( )


References d_model.

Member Function Documentation

void TableView::activateFormulaMode ( bool  on)
void TableView::advanceCell ( )

Advance current cell after [Return] or [Enter] was pressed.

References d_table, d_view_widget, future::Table::rowCount(), and future::Table::setRowCount().

Referenced by init().

void TableView::applyDescription ( )
void TableView::applyType ( )
bool TableView::areCommentsShown ( ) const
void TableView::changeEvent ( QEvent *  event)

Catches parent changes (in order to gain access to the title bar)

Reimplemented from MyWidget.

References retranslateStrings().

int TableView::columnWidth ( int  col) const

References d_horizontal_header.

void TableView::currentColumnChanged ( const QModelIndex &  current,
const QModelIndex &  previous 
void TableView::deselectAll ( )

References d_view_widget.

Referenced by ApplicationWindow::showTable().

bool TableView::eventFilter ( QObject *  object,
QEvent *  e 
int TableView::firstSelectedColumn ( bool  full = false)
int TableView::firstSelectedRow ( bool  full = false)
bool TableView::formulaModeActive ( ) const
void TableView::getCurrentCell ( int *  row,
int *  col 

Determine the current cell (-1 if no cell is designated as the current)

References d_view_widget.

Referenced by future::Table::pasteIntoSelection().

void TableView::goToCell ( int  row,
int  col 
void TableView::goToNextColumn ( )

References future::Table::columnCount(), d_table, and d_view_widget.

Referenced by init().

void TableView::goToPreviousColumn ( )

References future::Table::columnCount(), d_table, and d_view_widget.

Referenced by init().

void TableView::handleAspectAboutToBeRemoved ( const AbstractAspect aspect,
int  index 

References d_table, and ui.

Referenced by init().

void TableView::handleAspectAdded ( const AbstractAspect aspect)
void TableView::handleAspectDescriptionChanged ( const AbstractAspect aspect)
void TableView::handleFormatLineEditChange ( )

References SciDAVis::DateTime, and ui.

Referenced by init().

void TableView::handleHeaderDataChanged ( Qt::Orientation  orientation,
int  first,
int  last 

References d_view_widget, and setColumnForControlTabs().

Referenced by init().

void TableView::handleHorizontalHeaderDoubleClicked ( int  index)

References showControlDescriptionTab().

Referenced by init().

void TableView::handleHorizontalSectionMoved ( int  index,
int  from,
int  to 

References d_table, d_view_widget, and future::Table::moveColumn().

Referenced by init().

void TableView::handleHorizontalSectionResized ( int  logicalIndex,
int  oldSize,
int  newSize 
void TableView::init ( )
bool TableView::isCellSelected ( int  row,
int  col 
bool TableView::isColumnSelected ( int  col,
bool  full = false 
bool TableView::isControlTabBarVisible ( )
bool TableView::isRowSelected ( int  row,
bool  full = false 

Returns true if row 'row' is selected; otherwise false.

If full is true, this function only returns true if the whole row is selected.

References d_view_widget.

Referenced by firstSelectedRow(), lastSelectedRow(), selectedRowCount(), selectedRows(), and ApplicationWindow::showRowStatistics().

int TableView::lastSelectedColumn ( bool  full = false)

Return the index of the last selected column.

If full is true, this function only looks for fully selected columns.

References future::Table::columnCount(), d_table, and isColumnSelected().

Referenced by Table::applyFormula(), future::Table::copySelection(), future::Table::insertEmptyColumns(), future::Table::pasteIntoSelection(), and Table::recalculate().

int TableView::lastSelectedRow ( bool  full = false)
void TableView::rereadSectionSizes ( )
void TableView::retranslateStrings ( )
void TableView::selectAll ( )
int TableView::selectedColumnCount ( bool  full = false)
int TableView::selectedColumnCount ( SciDAVis::PlotDesignation  pd)

Return how many columns with the given plot designation are (at least partly) selected.

References future::Table::column(), future::Table::columnCount(), d_table, isColumnSelected(), and Column::plotDesignation().

QList< Column * > TableView::selectedColumns ( bool  full = false)
int TableView::selectedRowCount ( bool  full = false)

Return how many rows are (at least partly) selected.

If full is true, this function only returns the number of fully selected rows.

References d_table, isRowSelected(), and future::Table::rowCount().

Referenced by future::Table::addRows(), and Table::numSelectedRows().

IntervalAttribute< bool > TableView::selectedRows ( bool  full = false)
void TableView::selectionChanged ( const QItemSelection &  selected,
const QItemSelection &  deselected 

Referenced by init().

void TableView::setCellSelected ( int  row,
int  col,
bool  select = true 

Select/Deselect a cell.

References d_model, d_view_widget, and TableModel::index().

Referenced by future::Table::pasteIntoSelection().

void TableView::setCellsSelected ( int  first_row,
int  first_col,
int  last_row,
int  last_col,
bool  select = true 

Select/Deselect a range of cells.

References d_model, d_view_widget, and TableModel::index().

Referenced by future::Table::pasteIntoSelection(), and ApplicationWindow::showTable().

void TableView::setColumnForControlTabs ( int  col)
void TableView::setColumnWidth ( int  col,
int  width 
void TableView::showComments ( bool  on = true)

Show or hide (if on = false) the column comments.

References d_horizontal_header, and TableDoubleHeaderView::showComments().

Referenced by ApplicationWindow::customTable(), toggleComments(), and future::Table::view().

void TableView::showControlDescriptionTab ( )
void TableView::showControlFormulaTab ( )
void TableView::showControlTypeTab ( )
void TableView::toggleComments ( )
void TableView::toggleControlTabBar ( )

References d_control_tabs, and d_hide_button.

Referenced by init().

void TableView::updateFormatBox ( )
void TableView::updateTypeInfo ( )

Member Data Documentation

QWidget* TableView::d_control_tabs
TableItemDelegate* TableView::d_delegate

Pointer to the item delegate.

Referenced by init().

QToolButton* TableView::d_hide_button
TableDoubleHeaderView* TableView::d_horizontal_header
QHBoxLayout* TableView::d_main_layout

Referenced by init().

TableModel* TableView::d_model
future::Table* TableView::d_table
TableViewWidget* TableView::d_view_widget
Ui::ControlTabs TableView::ui

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