scidavis  2.3.0
About: SciDAVis is a free application for Scientific Data Analysis and Visualization (a fork off of QtiPlot).
  Fossies Dox: scidavis-2.3.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

Table Class Reference

MDI window providing a spreadsheet table with column logic. More...

#include <Table.h>

Inheritance diagram for Table:
[legend]
Collaboration diagram for Table:
[legend]

Public Types

enum  ColType {
  Numeric = 0, Text = 1, Date = 2, Time = 3,
  Month = 4, Day = 5, DateTime = 6
}
 
enum  CaptionPolicy { Name = 0, Label = 1, Both = 2 }
 Possible window captions. More...
 
enum  Status { Hidden = -1, Normal = 0, Minimized = 1, Maximized = 2 }
 

Public Slots

void copy (Table *m)
 
int numRows ()
 
int numCols ()
 
int rowCount ()
 
int columnCount ()
 
void setNumRows (int rows)
 
void setNumCols (int cols)
 
void handleChange ()
 
void handleRowChange ()
 
void handleColumnChange (int, int)
 
void handleColumnChange (int, int, int, int)
 
void handleColumnsAboutToBeRemoved (int, int)
 
void handleColumnsRemoved (int, int)
 
Columncolumn (int index) const
 Return column number 'index'. More...
 
Columncolumn (const QString &name) const
 Return the column determined by the given name. More...
 
double cell (int row, int col)
 Return the value of the cell as a double. More...
 
void setCell (int row, int col, double val)
 
QString text (int row, int col)
 
QStringList columnsList ()
 
QStringList colNames ()
 
QString colName (int col)
 
QString colLabel (int col)
 
int colIndex (const QString &name)
 
SciDAVis::PlotDesignation colPlotDesignation (int col)
 
void setColPlotDesignation (int col, SciDAVis::PlotDesignation d)
 
void setPlotDesignation (SciDAVis::PlotDesignation pd)
 
QList< int > plotDesignations ()
 
void setColName (int col, const QString &text)
 
void setHeader (QStringList header)
 
void importV0x0001XXHeader (QStringList header)
 
void setText (int row, int col, const QString &text)
 
void clearCell (int row, int col)
 
void print ()
 
void print (const QString &fileName)
 
void exportPDF (const QString &fileName)
 
void customEvent (QEvent *e)
 

Signals

void closedWindow (MyWidget *)
 Emitted when the window was closed. More...
 
void hiddenWindow (MyWidget *)
 Emitted when the window was hidden. More...
 
void modifiedWindow (MyWidget *)
 
void resizedWindow (MyWidget *)
 
void statusChanged (MyWidget *)
 Emitted when the window status changed. More...
 
void showTitleBarMenu ()
 Emitted when the title bar recieves a QContextMenuEvent. More...
 

Public Member Functions

 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::WindowFlags f=0)
 
 Table (ScriptingEnv *env, int r, int c, const QString &label, QWidget *parent=0, const char *name=0, Qt::WindowFlags f=0)
 
void setNumericPrecision (int prec)
 Sets the number of significant digits. More...
 
virtual QString name ()
 Return the window name. More...
 
virtual void setName (const QString &s)
 Set the window name. More...
 
virtual QString windowLabel ()
 Return the window label. More...
 
virtual void setWindowLabel (const QString &s)
 Set the window label. More...
 
void setCaptionPolicy (CaptionPolicy policy)
 Set the caption policy. More...
 
virtual void setBirthDate (const QString &s)
 Set the creation date. More...
 
void closeEvent (QCloseEvent *)
 
bool isControlTabBarVisible ()
 
void showComments (bool on=true)
 Show or hide (if on = false) the column comments. More...
 
bool areCommentsShown () const
 Return whether comments are show currently. More...
 
virtual CaptionPolicy captionPolicy ()
 Return the caption policy. More...
 
virtual QString birthDate ()
 Return the creation date. More...
 
QString aspect ()
 Return the window status as a string. More...
 
Status status ()
 Return the window status flag (hidden, normal, minimized or maximized) More...
 
void setStatus (Status s)
 Set the window status flag (hidden, normal, minimized or maximized) More...
 
virtual void setHidden ()
 Notifies that a window was hidden by a direct user action. More...
 
void askOnCloseEvent (bool ask)
 Toggle the "ask on close" flag. More...
 
void contextMenuEvent (QContextMenuEvent *e)
 Customizes title bar's context menu) More...
 
Folderfolder ()
 Returns the pointer to the parent folder of the window. More...
 
void setFolder (Folder *f)
 Initializes the pointer to the parent folder of the window. More...
 
void notifyChanges ()
 Notifies the main application that the window has been modified. More...
 
void setNormal ()
 
void setMinimized ()
 
void setMaximized ()
 
void scriptingChangeEvent (ScriptingChangeEvent *)
 

Public Attributes

QPointer< future::Tabled_future_table
 

Protected Slots

void updateCaption ()
 Set caption according to current CaptionPolicy, name and label. More...
 

Protected Attributes

FolderparentFolder
 Pointer to the parent folder of the window. More...
 
QString w_label
 The window label. More...
 
QString birthdate
 The creation date. More...
 
Status w_status
 The window status. More...
 
CaptionPolicy caption_policy
 The caption policy. More...
 
bool askOnClose
 Toggle on/off: Ask the user "delete, hide, or cancel?" on a close event. More...
 
ScriptingEnvscriptEnv
 

selection related functions

int selectedColumnCount (bool full=false)
 Return how many columns are selected. More...
 
int selectedColumnCount (SciDAVis::PlotDesignation pd)
 Return how many columns with the given plot designation are (at least partly) selected. More...
 
bool isColumnSelected (int col, bool full=false)
 Returns true if column 'col' is selected; otherwise false. More...
 
QList< Column * > selectedColumns (bool full=false)
 Return all selected columns. More...
 
int selectedRowCount (bool full=false)
 Return how many rows are (at least partly) selected. More...
 
bool isRowSelected (int row, bool full=false)
 Returns true if row 'row' is selected; otherwise false. More...
 
int firstSelectedColumn (bool full=false)
 Return the index of the first selected column. More...
 
int lastSelectedColumn (bool full=false)
 Return the index of the last selected column. More...
 
int firstSelectedRow (bool full=false)
 Return the index of the first selected row. More...
 
int lastSelectedRow (bool full=false)
 Return the index of the last selected row. More...
 
IntervalAttribute< bool > selectedRows (bool full=false)
 Get the complete set of selected rows. More...
 
bool hasMultiSelection ()
 Return whether multiple regions are selected. More...
 
bool isCellSelected (int row, int col)
 Return whether a cell is selected. More...
 
void setCellSelected (int row, int col, bool select=true)
 Select/Deselect a cell. More...
 
void setCellsSelected (int first_row, int first_col, int last_row, int last_col, bool select=true)
 Select/Deselect a range of cells. More...
 
void getCurrentCell (int *row, int *col)
 Determine the current cell (-1 if no cell is designated as the current) More...
 
void setColumnWidth (int col, int width)
 
int columnWidth (int col) const
 
bool formulaModeActive () const
 
void activateFormulaMode (bool on)
 
void goToCell (int row, int col)
 
void rereadSectionSizes ()
 
void selectAll ()
 
void deselectAll ()
 
void toggleControlTabBar ()
 
void toggleComments ()
 
void showControlDescriptionTab ()
 
void showControlTypeTab ()
 
void showControlFormulaTab ()
 
void handleHorizontalSectionResized (int logicalIndex, int oldSize, int newSize)
 
void goToNextColumn ()
 
void goToPreviousColumn ()
 
void advanceCell ()
 Advance current cell after [Return] or [Enter] was pressed. More...
 
void handleHorizontalSectionMoved (int index, int from, int to)
 
void handleHorizontalHeaderDoubleClicked (int index)
 
void handleFormatLineEditChange ()
 
void handleAspectDescriptionChanged (const AbstractAspect *aspect)
 
void handleAspectAdded (const AbstractAspect *aspect)
 
void handleAspectAboutToBeRemoved (const AbstractAspect *aspect, int index)
 
void updateTypeInfo ()
 
void updateFormatBox ()
 
void handleHeaderDataChanged (Qt::Orientation orientation, int first, int last)
 
void currentColumnChanged (const QModelIndex &current, const QModelIndex &previous)
 
void selectionChanged (const QItemSelection &selected, const QItemSelection &deselected)
 
void applyDescription ()
 
void applyType ()
 
TableItemDelegated_delegate
 Pointer to the item delegate. More...
 
TableModeld_model
 Pointer to the current underlying model. More...
 
Ui::ControlTabs ui
 UI with options tabs (description, format, formula etc.) More...
 
TableViewWidgetd_view_widget
 The table view (first part of the UI) More...
 
QWidget * d_control_tabs
 Widget that contains the control tabs UI from ui. More...
 
QToolButton * d_hide_button
 Button to toogle the visibility of #d_tool_box. More...
 
QHBoxLayout * d_main_layout
 
TableDoubleHeaderViewd_horizontal_header
 
QPointer< future::Tabled_table
 
virtual void changeEvent (QEvent *event)
 
void retranslateStrings ()
 
void setColumnForControlTabs (int col)
 
bool eventFilter (QObject *watched, QEvent *event)
 

Saving and Restoring

QHash< const AbstractAspect *, QString > d_stored_column_labels
 
virtual QString saveToString (const QString &geometry)
 
void saveToDevice (QIODevice *device, const QString &geometry)
 
QString saveHeader ()
 
QString saveComments ()
 
QString saveCommands ()
 
QString saveColumnWidths ()
 
QString saveColumnTypes ()
 
void setBackgroundColor (const QColor &col)
 
void setTextColor (const QColor &col)
 
void setHeaderColor (const QColor &col)
 
void setTextFont (const QFont &fnt)
 
void setHeaderFont (const QFont &fnt)
 
int verticalHeaderWidth ()
 
QString colComment (int col)
 
void setColComment (int col, const QString &s)
 
QStringList colComments ()
 
void setColComments (const QStringList &lst)
 
bool commentsEnabled ()
 
QString saveAsTemplate (const QString &geometryInfo)
 
void restore (const QStringList &lst)
 
void changedColHeader (const QString &, const QString &)
 
void aboutToRemoveCol (const QString &)
 
void removedCol (const QString &)
 
void modifiedData (Table *, const QString &)
 
void resizedTable (QWidget *)
 
void showContextMenu (bool selection)
 
void applyFormula ()
 
void addFunction ()
 
void addReference ()
 
void updateFunctionDoc ()
 
void handleAspectDescriptionChange (const AbstractAspect *aspect)
 
void handleAspectDescriptionAboutToChange (const AbstractAspect *aspect)
 

Detailed Description

MDI window providing a spreadsheet table with column logic.

File : Table.h Project : SciDAVis

Description : Table worksheet class

Copyright : (C) 2006-2009 Tilman Benkert (thzs*gmx.net) Copyright : (C) 2006-2009 Knut Franke (knut.franke*gmx.de) Copyright : (C) 2006-2007 Ion Vasilief (ion_vasilief*yahoo.fr) (replace * with @ in the email addresses)

  • This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. *
    • This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. *
    • You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA *

Definition at line 50 of file Table.h.

Member Enumeration Documentation

◆ CaptionPolicy

enum MyWidget::CaptionPolicy
inherited

Possible window captions.

Enumerator
Name 

caption determined by the window name

Label 

caption detemined by the window label

Both 

caption = "name - label"

Definition at line 68 of file MyWidget.h.

68  {
69  Name = 0,
70  Label = 1,
71  Both = 2
72  };

◆ ColType

Enumerator
Numeric 
Text 
Date 
Time 
Month 
Day 
DateTime 

Definition at line 57 of file Table.h.

57 {Numeric = 0, Text = 1, Date = 2, Time = 3, Month = 4, Day = 5, DateTime = 6}; // TODO: remove this in favor of SciDAVis::columnMode

◆ Status

enum MyWidget::Status
inherited
Enumerator
Hidden 
Normal 
Minimized 
Maximized 

Definition at line 73 of file MyWidget.h.

73 {Hidden = -1, Normal = 0, Minimized = 1, Maximized = 2};

Constructor & Destructor Documentation

◆ Table() [1/2]

Table::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::WindowFlags  f = 0 
)

Definition at line 61 of file Table.cpp.

64  : TableView(label, parent, name,f), scripted(env)
65 {
66 
68  filter.set_ignored_lines(ignoredLines);
69  filter.set_separator(sep);
70  filter.set_first_row_names_columns(renameCols);
71  filter.set_trim_whitespace(stripSpaces);
72  filter.set_simplify_whitespace(simplifySpaces);
73  filter.set_convert_to_numeric(convertToNumeric);
74  filter.set_numeric_locale(numericLocale);
75 
76  QFile file(fname);
77  if ( file.open(QIODevice::ReadOnly) )
78  {
79  d_future_table = static_cast<future::Table *>(filter.importAspect(file));
80  if (!d_future_table)
81  d_future_table = new future::Table(0, 0, label);
82  else
83  d_future_table->setName(label);
84  }
85  setWindowLabel(fname);
86  init();
87 }

References d_future_table, AsciiTableImportFilter::importAspect(), init(), AsciiTableImportFilter::set_separator(), and setWindowLabel().

Here is the call graph for this function:

◆ Table() [2/2]

Table::Table ( ScriptingEnv env,
int  r,
int  c,
const QString &  label,
QWidget *  parent = 0,
const char *  name = 0,
Qt::WindowFlags  f = 0 
)

Definition at line 89 of file Table.cpp.

90  : TableView(label, parent, name,f), scripted(env)
91 {
92  d_future_table = new future::Table(r, c, label);
93  init();
94 }

References d_future_table, and init().

Here is the call graph for this function:

Member Function Documentation

◆ aboutToRemoveCol

void Table::aboutToRemoveCol ( const QString &  )
signal

Referenced by handleColumnsAboutToBeRemoved().

Here is the caller graph for this function:

◆ activateFormulaMode

void TableView::activateFormulaMode ( bool  on)
slotinherited

Definition at line 958 of file TableView.cpp.

959 {
961 }

References TableModel::activateFormulaMode(), and TableView::d_model.

Here is the call graph for this function:

◆ addCol

void Table::addCol ( SciDAVis::PlotDesignation  pd = SciDAVis::Y)
slot

Definition at line 799 of file Table.cpp.

800 {
801  if (d_future_table)
802  {
803  d_future_table->addColumn();
804  column(d_future_table->columnCount()-1)->setColumnMode(SciDAVis::Numeric); // in case we ever change the default
805  column(d_future_table->columnCount()-1)->setPlotDesignation(pd);
806  }
807 }

References column(), d_future_table, SciDAVis::Numeric, Column::setColumnMode(), and Column::setPlotDesignation().

Referenced by ApplicationWindow::addColToTable(), Convolution::addResultCurve(), and Correlation::addResultCurve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addColumns

void Table::addColumns ( int  c)
slot

Definition at line 809 of file Table.cpp.

810 {
811  if (d_future_table)
812  {
813  QList<Column*> cols;
814  for(int i=0; i<c; i++)
815  cols << new Column(QString::number(i+1), SciDAVis::Numeric);
816  d_future_table->appendColumns(cols);
817  }
818 }

References d_future_table, and SciDAVis::Numeric.

◆ addFunction

void Table::addFunction ( )
protectedslot

Definition at line 1410 of file Table.cpp.

1411 {
1412  static_cast<ScriptEdit *>(ui.formula_box)->insertFunction(ui.add_function_combobox->currentText());
1413 }

References TableView::ui.

Referenced by init().

Here is the caller graph for this function:

◆ addReference

void Table::addReference ( )
protectedslot

Definition at line 1415 of file Table.cpp.

1416 {
1417  ui.formula_box->insertPlainText(ui.add_reference_combobox->currentText());
1418 }

References TableView::ui.

Referenced by init().

Here is the caller graph for this function:

◆ advanceCell

void TableView::advanceCell ( )
protectedslotinherited

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

Definition at line 287 of file TableView.cpp.

288 {
289  if (d_table)
290  {
291  QModelIndex idx = d_view_widget->currentIndex();
292  if(idx.row()+1 >= d_table->rowCount())
293  {
294  int new_size = d_table->rowCount()+1;
295  d_table->setRowCount(new_size);
296  }
297  d_view_widget->setCurrentIndex(idx.sibling(idx.row()+1, idx.column()));
298  }
299 }

References TableView::d_table, and TableView::d_view_widget.

Referenced by TableView::init().

Here is the caller graph for this function:

◆ applyDescription

void TableView::applyDescription ( )
protectedslotinherited

Definition at line 651 of file TableView.cpp.

652 {
653  QItemSelectionModel * sel_model = d_view_widget->selectionModel();
654  int index = sel_model->currentIndex().column();
655  if(d_table && index >= 0)
656  {
657  // changing the name triggers an update of the UI, which also resets the content of the
658  // comment box => need to cache it so name and comment can be changed simultaneously
659  QString comment = ui.comment_box->document()->toPlainText();
660  d_table->column(index)->setName(ui.name_edit->text());
661  d_table->column(index)->setComment(comment);
662  }
663 }

References TableView::d_table, TableView::d_view_widget, and TableView::ui.

Referenced by TableView::init().

Here is the caller graph for this function:

◆ applyFormula

void Table::applyFormula ( )
protectedslot

Definition at line 1389 of file Table.cpp.

1390 {
1391  if (!d_future_table) return;
1392 
1393  QApplication::setOverrideCursor(Qt::WaitCursor);
1394  d_future_table->beginMacro(tr("%1: apply formula to column").arg(name()));
1395 
1396  QString formula = ui.formula_box->toPlainText();
1397  for (int col=firstSelectedColumn(); col<=lastSelectedColumn(); col++)
1398  {
1399  Column *col_ptr = column(col);
1400  col_ptr->insertRows(col_ptr->rowCount(), rowCount()-col_ptr->rowCount());
1401  col_ptr->setFormula(Interval<int>(0,rowCount()-1), formula);
1402  if (!recalculate(col, false))
1403  break;
1404  }
1405 
1406  d_future_table->endMacro();
1407  QApplication::restoreOverrideCursor();
1408 }

References column(), d_future_table, TableView::firstSelectedColumn(), Column::insertRows(), TableView::lastSelectedColumn(), name(), recalculate(), rowCount(), Column::rowCount(), Column::setFormula(), and TableView::ui.

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyType

void TableView::applyType ( )
protectedslotinherited

Definition at line 665 of file TableView.cpp.

666 {
667  int format_index = ui.format_box->currentIndex();
668  int type_index = ui.type_box->currentIndex();
669  if(format_index < 0 && type_index < 0) return;
670 
671  SciDAVis::ColumnMode new_mode = (SciDAVis::ColumnMode)ui.type_box->itemData(type_index).toInt();
672  QList<Column*> list = selectedColumns();
673  switch(new_mode) {
674  case SciDAVis::Numeric:
675  foreach(Column* col, list) {
676  col->beginMacro(QObject::tr("%1: change column type").arg(col->name()));
677  col->setColumnMode(new_mode);
678  Double2StringFilter * filter = static_cast<Double2StringFilter*>(col->outputFilter());
679  int digits = ui.digits_box->value(); // setNumericFormat causes digits_box to be modified...
680  filter->setNumericFormat(ui.format_box->itemData(format_index).toChar().toLatin1());
681  filter->setNumDigits(digits);
682  col->endMacro();
683  }
684  break;
685  case SciDAVis::Text:
686  foreach(Column* col, list)
687  col->setColumnMode(new_mode);
688  break;
689  case SciDAVis::Month:
690  case SciDAVis::Day:
691  case SciDAVis::DateTime:
692  QString format;
693  if (ui.formatLineEdit->isEnabled())
694  format = ui.formatLineEdit->text();
695  else
696  format = ui.format_box->itemData(format_index).toString();
697  foreach(Column* col, list) {
698  col->beginMacro(QObject::tr("%1: change column type").arg(col->name()));
699  SciDAVis::ColumnMode old_mode = col->columnMode();
700  AbstractFilter *converter = 0;
701  switch (old_mode) {
702  case SciDAVis::Numeric:
703  if (ui.date_time_interval->isVisible()) {
705  ui.date_time_interval->itemData(ui.date_time_interval->currentIndex()).toInt();
706  QDateTime date_time_0 = ui.date_time_0->dateTime();
707  if (!date_time_0.date().isValid())
708  date_time_0.setDate(QDate(-1,12,31));
709  converter = new Double2DateTimeFilter(unit, date_time_0);
710  }
711  break;
712  case SciDAVis::Text:
713  converter = new String2DateTimeFilter(format);
714  break;
715  default:
716  break;
717  }
718  col->setColumnMode(new_mode, converter);
719  DateTime2StringFilter * filter = static_cast<DateTime2StringFilter*>(col->outputFilter());
720  filter->setFormat(format);
721  col->endMacro();
722  }
723  break;
724  }
725 }

References AbstractAspect::beginMacro(), Column::columnMode(), SciDAVis::DateTime, SciDAVis::Day, AbstractAspect::endMacro(), SciDAVis::Month, AbstractAspect::name(), SciDAVis::Numeric, Column::outputFilter(), TableView::selectedColumns(), Column::setColumnMode(), DateTime2StringFilter::setFormat(), Double2StringFilter::setNumDigits(), Double2StringFilter::setNumericFormat(), SciDAVis::Text, and TableView::ui.

Referenced by TableView::init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ areCommentsShown()

bool TableView::areCommentsShown ( ) const
inherited

Return whether comments are show currently.

Definition at line 345 of file TableView.cpp.

346 {
348 }

References TableDoubleHeaderView::areCommentsShown(), and TableView::d_horizontal_header.

Referenced by commentsEnabled(), and TableView::toggleComments().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ askOnCloseEvent()

void MyWidget::askOnCloseEvent ( bool  ask)
inlineinherited

Toggle the "ask on close" flag.

Definition at line 123 of file MyWidget.h.

123 {askOnClose = ask;};

References MyWidget::askOnClose.

Referenced by ApplicationWindow::connectMultilayerPlot(), ApplicationWindow::connectSurfacePlot(), ApplicationWindow::connectTable(), ApplicationWindow::deleteFitTables(), ApplicationWindow::initMatrix(), and ApplicationWindow::initNote().

Here is the caller graph for this function:

◆ aspect()

QString MyWidget::aspect ( )
inherited

Return the window status as a string.

Definition at line 106 of file MyWidget.cpp.

107 {
108  QString s = tr("Normal");
109  switch (w_status)
110  {
111  case Hidden:
112  return tr("Hidden");
113  break;
114 
115  case Normal:
116  break;
117 
118  case Minimized:
119  return tr("Minimized");
120  break;
121 
122  case Maximized:
123  return tr("Maximized");
124  break;
125  }
126  return s;
127 }

References MyWidget::Hidden, MyWidget::Maximized, MyWidget::Minimized, MyWidget::Normal, and MyWidget::w_status.

Referenced by ApplicationWindow::addListViewItem(), TableView::handleAspectAdded(), handleAspectDescriptionAboutToChange(), Matrix::handleAspectDescriptionChange(), handleAspectDescriptionChange(), TableView::handleAspectDescriptionChanged(), MultiLayer::print(), and ApplicationWindow::updateWindowStatus().

Here is the caller graph for this function:

◆ birthDate()

virtual QString MyWidget::birthDate ( )
inlinevirtualinherited

Return the creation date.

Reimplemented in Matrix.

Definition at line 91 of file MyWidget.h.

91 {return birthdate;};

References MyWidget::birthdate.

Referenced by ApplicationWindow::addListViewItem(), Graph3D::saveToString(), MultiLayer::saveToString(), TableStatistics::saveToString(), Note::saveToString(), and ApplicationWindow::windowProperties().

Here is the caller graph for this function:

◆ captionPolicy()

virtual CaptionPolicy MyWidget::captionPolicy ( )
inlinevirtualinherited

Return the caption policy.

Definition at line 86 of file MyWidget.h.

86 {return caption_policy;};

References MyWidget::caption_policy.

Referenced by RenameWindowDialog::accept(), ApplicationWindow::clone(), ApplicationWindow::convertMatrixToTable(), ApplicationWindow::convertTableToMatrix(), ApplicationWindow::renameWindow(), Graph3D::saveToString(), MultiLayer::saveToString(), TableStatistics::saveToString(), Matrix::saveToString(), Note::saveToString(), and RenameWindowDialog::setWidget().

Here is the caller graph for this function:

◆ cell

double Table::cell ( int  row,
int  col 
)
slot

Return the value of the cell as a double.

If one of the indices or the cell content is invalid, return 0.0. For the next non-bugfix SciDAVis release, indication of failure should be done by returning NaN (wherever applicable). TODO: Make sure we don't rely on zero-on-failure, and document the resulting change in the Python API.

Definition at line 907 of file Table.cpp.

908 {
909  Column *colPtr = column(col);
910  if (!colPtr) return 0.0;
911  if (!colPtr->isInvalid(row)) {
912  if (colPtr->columnMode() == SciDAVis::Text) {
913  QString yval = colPtr->textAt(row);
914  bool valid_data = true;
915  double dbval = QLocale().toDouble(yval, &valid_data);
916  if (!valid_data)
917  return 0.0;
918  return dbval;
919  }
920  return colPtr->valueAt(row);
921  }
922  else
923  return 0.0;
924 }

References column(), Column::columnMode(), Column::isInvalid(), SciDAVis::Text, Column::textAt(), and Column::valueAt().

Referenced by Graph3D::addData(), Correlation::setDataFromTable(), FFT::setDataFromTable(), Convolution::setDataFromTable(), Fit::setYErrorSource(), Graph3D::updateDataXY(), Graph3D::updateDataXYZ(), and Graph3D::updateScales().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ changedColHeader

void Table::changedColHeader ( const QString &  ,
const QString &   
)
signal

Referenced by handleAspectDescriptionChange().

Here is the caller graph for this function:

◆ changeEvent()

void TableView::changeEvent ( QEvent *  event)
protectedvirtualinherited

Reimplemented from MyWidget.

Definition at line 253 of file TableView.cpp.

254 {
255  if (event->type() == QEvent::LanguageChange)
257  MyWidget::changeEvent(event);
258 }

References MyWidget::changeEvent(), and TableView::retranslateStrings().

Here is the call graph for this function:

◆ clear

void Table::clear ( )
slot

Definition at line 1257 of file Table.cpp.

1258 {
1259  if (d_future_table)
1260  d_future_table->clear();
1261 }

References d_future_table.

Referenced by ApplicationWindow::clearTable().

Here is the caller graph for this function:

◆ clearCell

void Table::clearCell ( int  row,
int  col 
)
slot

Definition at line 826 of file Table.cpp.

827 {
828  column(col)->setTextAt(row, QString());
829  column(col)->setValueAt(row, 0.0);
830  column(col)->setDateTimeAt(row, QDateTime());
831  column(col)->setInvalid(row, true);
832 }

References column(), Column::setDateTimeAt(), Column::setInvalid(), Column::setTextAt(), and Column::setValueAt().

Here is the call graph for this function:

◆ clearCol

void Table::clearCol ( )
slot

Definition at line 820 of file Table.cpp.

821 {
822  if (d_future_table)
823  d_future_table->clearSelectedColumns();
824 }

References d_future_table.

◆ clearSelection

void Table::clearSelection ( )
slot

Definition at line 856 of file Table.cpp.

857 {
858  if (d_future_table)
859  d_future_table->clearSelectedCells();
860 }

References d_future_table.

◆ closedWindow

void MyWidget::closedWindow ( MyWidget )
signalinherited

Emitted when the window was closed.

Referenced by MyWidget::closeEvent().

Here is the caller graph for this function:

◆ closeEvent()

void Table::closeEvent ( QCloseEvent *  e)

Definition at line 1143 of file Table.cpp.

1144 {
1145  if (askOnClose)
1146  {
1147  switch( QMessageBox::information(this,tr("SciDAVis"),
1148  tr("Do you want to hide or delete") + "<p><b>'" + objectName() + "'</b> ?",
1149  tr("Delete"), tr("Hide"), tr("Cancel"), 0,2))
1150  {
1151  case 0:
1152  e->accept();
1153  if (d_future_table)
1154  d_future_table->remove();
1155  return;
1156 
1157  case 1:
1158  e->ignore();
1159  emit hiddenWindow(this);
1160  break;
1161 
1162  case 2:
1163  e->ignore();
1164  break;
1165  }
1166  }
1167  else
1168  {
1169  e->accept();
1170  if (d_future_table)
1171  d_future_table->remove();
1172  return;
1173  }
1174 }

References MyWidget::askOnClose, d_future_table, and MyWidget::hiddenWindow().

◆ colComment

QString Table::colComment ( int  col)
slot

Definition at line 1363 of file Table.cpp.

1364 {
1365  return column(col)->comment();
1366 }

References column(), and AbstractAspect::comment().

Here is the call graph for this function:

◆ colComments

QStringList Table::colComments ( )
slot

Definition at line 1368 of file Table.cpp.

1369 {
1370  QStringList list;
1371  if (d_future_table)
1372  for (int i=0; i<d_future_table->columnCount(); i++)
1373  list << column(i)->comment();
1374  return list;
1375 }

References column(), AbstractAspect::comment(), and d_future_table.

Here is the call graph for this function:

◆ colIndex

◆ colLabel

QString Table::colLabel ( int  col)
slot

Definition at line 1272 of file Table.cpp.

1273 {
1274  return column(col)->name();
1275 }

References column(), and AbstractAspect::name().

Referenced by ApplicationWindow::columnsList(), saveHeader(), Graph::setLabelsColHeaderFormat(), CurvesDialog::showCurrentFolder(), and TableStatistics::update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ colName

QString Table::colName ( int  col)
slot

Definition at line 765 of file Table.cpp.

766 {//returns the table name + horizontal header text
767  if (col<0 || col >= numCols())
768  return QString();
769 
770  return QString(name() + "_" + column(col)->name());
771 }

References column(), name(), and numCols().

Referenced by Graph3D::addData(), Convolution::addResultCurve(), Correlation::addResultCurve(), Graph3D::changeDataColumn(), handleColumnChange(), handleColumnsAboutToBeRemoved(), handleColumnsRemoved(), handleRowChange(), Graph::insertCurve(), Graph::insertCurvesList(), ApplicationWindow::openGraph(), ApplicationWindow::plot3DBars(), ApplicationWindow::plot3DRibbon(), ApplicationWindow::plot3DScatter(), ApplicationWindow::plot3DTrajectory(), recalculate(), ApplicationWindow::removeWindowFromLists(), TableStatistics::TableStatistics(), and TableStatistics::update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ colNames

QStringList Table::colNames ( )
slot

Definition at line 1263 of file Table.cpp.

1264 {
1265  QStringList list;
1266  if (d_future_table)
1267  for (int i=0; i<d_future_table->columnCount(); i++)
1268  list << column(i)->name();
1269  return list;
1270 }

References column(), d_future_table, and AbstractAspect::name().

Referenced by Convolution::addResultCurve(), Correlation::addResultCurve(), exportASCII(), FitDialog::selectSrcTable(), and AssociationsDialog::updateTable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ colPlotDesignation

SciDAVis::PlotDesignation Table::colPlotDesignation ( int  col)
slot

Definition at line 1277 of file Table.cpp.

1278 {
1279  return column(col)->plotDesignation();
1280 }

References column(), and Column::plotDesignation().

Referenced by ApplicationWindow::columnsList(), Graph::insertCurvesList(), Graph::setLabelsColHeaderFormat(), CurvesDialog::showCurrentFolder(), and ApplicationWindow::validFor3DPlot().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ column [1/2]

Column* Table::column ( const QString &  name) const
inlineslot

Return the column determined by the given name.

This method should not be used unless absolutely necessary. Columns should be addressed by their index. This method is mainly meant to be used in scripts.

Definition at line 128 of file Table.h.

128 { return d_future_table? d_future_table->column(name): nullptr; }

References d_future_table, and name().

Here is the call graph for this function:

◆ column [2/2]

Column* Table::column ( int  index) const
inlineslot

Return column number 'index'.

Definition at line 121 of file Table.h.

121 { return d_future_table? d_future_table->column(index): nullptr; }

References d_future_table.

Referenced by addCol(), Graph3D::addData(), Convolution::addResultCurve(), Correlation::addResultCurve(), applyFormula(), cell(), clearCell(), colComment(), colComments(), colIndex(), colLabel(), colName(), colNames(), colPlotDesignation(), columnFormat(), columnsList(), columnType(), columnTypes(), drawableColumnSelection(), DataPickerTool::end(), exportASCII(), firstXCol(), handleAspectDescriptionChange(), importASCII(), ApplicationWindow::importASCII(), ImportOPJ::importSpreadsheet(), importV0x0001XXHeader(), init(), BoxCurve::loadData(), DataCurve::loadData(), QwtErrorPlotCurve::loadData(), QwtHistogram::loadData(), QwtPieCurve::loadData(), Fit::parametersTable(), plotDesignations(), Graph::plotHistogram(), Graph::plotPie(), recalculate(), DataPickerTool::removePoint(), TableStatistics::renameCol(), saveColumnTypes(), saveCommands(), saveComments(), saveHeader(), TranslateCurveTool::selectDestination(), selectedColumns(), selectedErrColumns(), selectedYColumns(), selectedYLabels(), setCell(), setColComment(), setColComments(), setColName(), setColPlotDesignation(), setColumnType(), setColumnTypes(), setCommand(), setCommands(), setHeader(), Graph::setLabelsTextFormat(), setText(), PlotDialog::showStatistics(), TableStatistics::TableStatistics(), text(), TableStatistics::update(), Graph::updateCurvesData(), Graph3D::updateDataXY(), Graph3D::updateDataXYZ(), Graph3D::updateScales(), and YColumns().

Here is the caller graph for this function:

◆ columnCount

int Table::columnCount ( )
slot

Definition at line 902 of file Table.cpp.

903 {
904  return d_future_table? d_future_table->columnCount():0;
905 }

References d_future_table.

Referenced by importASCII(), ApplicationWindow::importASCII(), importV0x0001XXHeader(), init(), setHeader(), and Graph::setLabelsColHeaderFormat().

Here is the caller graph for this function:

◆ columnFormat

QString Table::columnFormat ( int  col)
slot

Definition at line 1345 of file Table.cpp.

1346 {
1347  // TODO: obsolete, remove in 0.3.0
1348  Column * col_ptr = column(col);
1349  if (col_ptr->columnMode() != SciDAVis::DateTime &&
1350  col_ptr->columnMode() != SciDAVis::Month &&
1351  col_ptr->columnMode() != SciDAVis::Day)
1352  return QString();
1353 
1354  DateTime2StringFilter *filter = static_cast<DateTime2StringFilter *>(col_ptr->outputFilter());
1355  return filter->format();
1356 }

References column(), Column::columnMode(), SciDAVis::DateTime, SciDAVis::Day, DateTime2StringFilter::format(), SciDAVis::Month, and Column::outputFilter().

Here is the call graph for this function:

◆ columnsList

QStringList Table::columnsList ( )
slot

Definition at line 745 of file Table.cpp.

746 {
747 // TODO for 0.3.0: Column * list
748  QStringList names;
749  for (int i=0; i<numCols(); i++)
750  names << name() +"_" + column(i)->name();
751 
752  return names;
753 }

References column(), name(), AbstractAspect::name(), and numCols().

Referenced by FFTDialog::setTable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ columnType

int Table::columnType ( int  col)
slot

Definition at line 1305 of file Table.cpp.

1306 {
1307  return column(col)->columnMode();
1308 }

References column(), and Column::columnMode().

Referenced by DataPickerTool::end(), BoxCurve::loadData(), QwtHistogram::loadData(), QwtPieCurve::loadData(), ApplicationWindow::openTable(), Graph::plotPie(), DataPickerTool::removePoint(), and TranslateCurveTool::selectDestination().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ columnTypes

QList< int > Table::columnTypes ( )
slot

Definition at line 1296 of file Table.cpp.

1297 {
1298  QList<int> list;
1299  if (d_future_table)
1300  for (int i=0; i<d_future_table->columnCount(); i++)
1301  list << column(i)->columnMode();
1302  return list;
1303 }

References column(), Column::columnMode(), and d_future_table.

Here is the call graph for this function:

◆ columnWidth [1/2]

int Table::columnWidth ( int  col)
slot

Definition at line 348 of file Table.cpp.

349 {
350  return d_future_table? d_view_widget->columnWidth(col): 0;
351 }

References d_future_table, and TableView::d_view_widget.

Referenced by print(), and saveColumnWidths().

Here is the caller graph for this function:

◆ columnWidth() [2/2]

int TableView::columnWidth ( int  col) const
inherited

Definition at line 230 of file TableView.cpp.

231 {
232  return d_horizontal_header->sectionSize(col);
233 }

References TableView::d_horizontal_header.

◆ colX

int Table::colX ( int  col)
slot

Definition at line 332 of file Table.cpp.

333 {
334  return d_future_table? d_future_table->colX(col): 0;
335 }

References d_future_table.

Referenced by Graph3D::addData(), Graph3D::changeDataColumn(), ApplicationWindow::dataPlotXYZ(), Graph::insertCurve(), and Graph3D::insertNewData().

Here is the caller graph for this function:

◆ colY

int Table::colY ( int  col)
slot

Definition at line 337 of file Table.cpp.

338 {
339  return d_future_table? d_future_table->colY(col): 0;
340 }

References d_future_table.

Referenced by Graph3D::changeDataColumn(), ApplicationWindow::dataPlotXYZ(), Graph::insertCurvesList(), and Graph3D::insertNewData().

Here is the caller graph for this function:

◆ commentsEnabled

bool Table::commentsEnabled ( )
slot

Definition at line 1384 of file Table.cpp.

1385 {
1386  return areCommentsShown();
1387 }

References TableView::areCommentsShown().

Here is the call graph for this function:

◆ contextMenuEvent()

void MyWidget::contextMenuEvent ( QContextMenuEvent *  e)
inherited

Customizes title bar's context menu)

Definition at line 145 of file MyWidget.cpp.

146 {
147  if (!this->widget()->geometry().contains(e->pos())) {
148  emit showTitleBarMenu();
149  e->accept();
150  }
151 }

References MyWidget::showTitleBarMenu().

◆ copy

void Table::copy ( Table m)
slot

Definition at line 1189 of file Table.cpp.

1190 {
1191  if (!m || !d_future_table)
1192  return;
1193 
1194  d_future_table->copy(m->d_future_table);
1195 }

References d_future_table.

◆ copySelection

void Table::copySelection ( )
slot

Definition at line 862 of file Table.cpp.

863 {
864  if (d_future_table)
865  d_future_table->copySelection();
866 }

References d_future_table.

◆ currentColumnChanged

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

Definition at line 361 of file TableView.cpp.

362 {
363  Q_UNUSED(previous);
364  int col = current.column();
365  if(col < 0 || (d_table && col >= d_table->columnCount())) return;
367 }

References TableView::d_table, and TableView::setColumnForControlTabs().

Referenced by TableView::init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ customEvent

void Table::customEvent ( QEvent *  e)
slot

Definition at line 1137 of file Table.cpp.

1138 {
1139  if (e->type() == SCRIPTING_CHANGE_EVENT)
1141 }

References SCRIPTING_CHANGE_EVENT, and scripted::scriptingChangeEvent().

Here is the call graph for this function:

◆ cutSelection

void Table::cutSelection ( )
slot

Selection Operations.

Definition at line 840 of file Table.cpp.

841 {
842  if (d_future_table)
843  d_future_table->cutSelection();
844 }

References d_future_table.

◆ deleteSelectedRows

void Table::deleteSelectedRows ( )
slot

Definition at line 834 of file Table.cpp.

835 {
836  if (d_future_table)
837  d_future_table->removeSelectedRows();
838 }

References d_future_table.

◆ deselect

void Table::deselect ( )
slot

Definition at line 851 of file Table.cpp.

852 {
853  d_view_widget->clearSelection();
854 }

References TableView::d_view_widget.

◆ deselectAll

void TableView::deselectAll ( )
slotinherited

Definition at line 313 of file TableView.cpp.

314 {
315  d_view_widget->clearSelection();
316 }

References TableView::d_view_widget.

Referenced by ApplicationWindow::showTable().

Here is the caller graph for this function:

◆ drawableColumnSelection

QStringList Table::drawableColumnSelection ( )
slot

Definition at line 713 of file Table.cpp.

714 {
715 // TODO for 0.3.0: Column * list
716  QStringList names;
717  for (int i=0; i<numCols(); i++)
718  {
720  names << name() + "_" + column(i)->name();
721  }
722 
723  for (int i=0; i<numCols(); i++)
724  {
725  if (isColumnSelected(i) &&
728  names << name() + "_" + column(i)->name();
729  }
730  return names;
731 }

References column(), TableView::isColumnSelected(), name(), AbstractAspect::name(), numCols(), Column::plotDesignation(), SciDAVis::xErr, SciDAVis::Y, and SciDAVis::yErr.

Referenced by ApplicationWindow::selectPlotType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ eventFilter()

bool TableView::eventFilter ( QObject *  watched,
QEvent *  event 
)
protectedinherited

Definition at line 922 of file TableView.cpp.

923 {
924  QHeaderView * v_header = d_view_widget->verticalHeader();
925 
926  if (d_table && event->type() == QEvent::ContextMenu)
927  {
928  QContextMenuEvent *cm_event = static_cast<QContextMenuEvent *>(event);
929  QPoint global_pos = cm_event->globalPos();
930  if(watched == v_header)
931  d_table->showTableViewRowContextMenu(global_pos);
932  else if(watched == d_horizontal_header) {
933  int col = d_horizontal_header->logicalIndexAt(cm_event->pos());
934  if (!isColumnSelected(col, true)) {
935  QItemSelectionModel * sel_model = d_view_widget->selectionModel();
936  sel_model->clearSelection();
937  sel_model->select(QItemSelection(d_model->index(0, col, QModelIndex()),
938  d_model->index(d_model->rowCount()-1, col, QModelIndex())),
939  QItemSelectionModel::Select);
940  }
941  d_table->showTableViewColumnContextMenu(global_pos);
942  } else if(watched == d_view_widget)
943  d_table->showTableViewContextMenu(global_pos);
944  else
945  return MyWidget::eventFilter(watched, event);
946 
947  return true;
948  }
949  else
950  return MyWidget::eventFilter(watched, event);
951 }

References TableView::d_horizontal_header, TableView::d_model, TableView::d_table, TableView::d_view_widget, TableModel::index(), TableView::isColumnSelected(), and TableModel::rowCount().

Here is the call graph for this function:

◆ exportASCII

bool Table::exportASCII ( const QString &  fname,
const QString &  separator,
bool  withLabels = false,
bool  exportSelection = false 
)
slot

Definition at line 1032 of file Table.cpp.

1034 {
1035  QFile file(fname);
1036  if ( !file.open( QIODevice::WriteOnly ) )
1037  {
1038  QApplication::restoreOverrideCursor();
1039  QMessageBox::critical(0, tr("ASCII Export Error"),
1040  tr("Could not write to file: <br><h4>")+fname+tr("</h4><p>Please verify that you have the right to write to this location!"));
1041  return false;
1042  }
1043 
1044  QTextStream out( &file );
1045  int i,j;
1046  int rows = numRows();
1047  int cols = numCols();
1048  int selectedCols = 0;
1049  int topRow = 0, bottomRow = 0;
1050  vector<int> sCols;
1051  if (exportSelection)
1052  {
1053  for (i=0; i<cols; i++)
1054  {
1055  if (isColumnSelected(i))
1056  selectedCols++;
1057  }
1058 
1059  sCols.resize(selectedCols+1);
1060  int temp = 1;
1061  for (i=0; i<cols; i++)
1062  {
1063  if (isColumnSelected(i))
1064  {
1065  sCols[temp] = i;
1066  temp++;
1067  }
1068  }
1069 
1070  topRow = firstSelectedRow();
1071  bottomRow = lastSelectedRow();
1072  }
1073 
1074  if (withLabels)
1075  {
1076  QStringList header = colNames();
1077  QStringList ls = header.filter(QRegExp ("\\D"));
1078  if (exportSelection)
1079  {
1080  for (i=1; i<selectedCols; i++)
1081  {
1082  if (ls.count()>0)
1083  out << header[sCols[i]] + separator;
1084  else
1085  out << "C"+header[sCols[i]] + separator;
1086  }
1087 
1088  if (ls.count()>0)
1089  out << header[sCols[selectedCols]] + "\n";
1090  else
1091  out << "C" + header[sCols[selectedCols]] + "\n";
1092  }
1093  else
1094  {
1095  if (ls.count()>0)
1096  {
1097  for (j=0; j<cols-1; j++)
1098  out << header[j]+separator;
1099  out << header[cols-1]+"\n";
1100  }
1101  else
1102  {
1103  for (j=0; j<cols-1; j++)
1104  out << "C" + header[j] + separator;
1105  out << "C" + header[cols-1] + "\n";
1106  }
1107  }
1108  }// finished writting labels
1109 
1110  QList<Column*> col_ptrs;
1111  if (exportSelection) {
1112  for (j=1; j<=selectedCols; j++)
1113  col_ptrs << column(sCols[j]);
1114  } else {
1115  for (j=0;j<cols;j++)
1116  col_ptrs << column(j);
1117  topRow = 0;
1118  bottomRow = rows-1;
1119  }
1120 
1121  for (i=topRow; i<=bottomRow; i++) {
1122  bool first = true;
1123  foreach(Column *col, col_ptrs) {
1124  if (first)
1125  first = false;
1126  else
1127  out << separator;
1128  out << col->asStringColumn()->textAt(i);
1129  }
1130  out << "\n";
1131  }
1132 
1133  file.close();
1134  return true;
1135 }

References Column::asStringColumn(), colNames(), column(), TableView::firstSelectedRow(), TableView::isColumnSelected(), TableView::lastSelectedRow(), numCols(), numRows(), and ColumnStringIO::textAt().

Referenced by ApplicationWindow::exportAllTables(), and ApplicationWindow::exportASCII().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportPDF

void Table::exportPDF ( const QString &  fileName)
slot

Definition at line 220 of file Table.cpp.

221 {
222  print(fileName);
223 }

References print().

Here is the call graph for this function:

◆ firstSelectedColumn()

int TableView::firstSelectedColumn ( bool  full = false)
inherited

Return the index of the first selected column.

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

Definition at line 802 of file TableView.cpp.

803 {
804  if (d_table)
805  {
806  int cols = d_table->columnCount();
807  for (int i=0; i<cols; i++)
808  {
809  if(isColumnSelected(i, full))
810  return i;
811  }
812  }
813  return -1;
814 }

References TableView::d_table, and TableView::isColumnSelected().

Referenced by applyFormula(), ApplicationWindow::plot3DBars(), ApplicationWindow::plot3DRibbon(), ApplicationWindow::plot3DScatter(), ApplicationWindow::plot3DTrajectory(), recalculate(), and ApplicationWindow::validFor3DPlot().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ firstSelectedRow()

int TableView::firstSelectedRow ( bool  full = false)
inherited

Return the index of the first selected row.

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

Definition at line 827 of file TableView.cpp.

828 {
829  if (d_table)
830  {
831  int rows = d_table->rowCount();
832  for (int i=0; i<rows; i++)
833  {
834  if(isRowSelected(i, full))
835  return i;
836  }
837  }
838  return -1;
839 }

References TableView::d_table, and TableView::isRowSelected().

Referenced by exportASCII(), ApplicationWindow::plotPie(), ApplicationWindow::plotVectXYAM(), ApplicationWindow::plotVectXYXY(), and ApplicationWindow::selectPlotType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ firstXCol

int Table::firstXCol ( )
slot

Definition at line 640 of file Table.cpp.

641 {
642  for (int j=0; j<numCols(); j++)
643  {
644  if (column(j)->plotDesignation() == SciDAVis::X)
645  return j;
646  }
647  return -1;
648 }

References column(), numCols(), Column::plotDesignation(), and SciDAVis::X.

Referenced by FFTDialog::setTable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ folder()

Folder* MyWidget::folder ( )
inlineinherited

Returns the pointer to the parent folder of the window.

Definition at line 128 of file MyWidget.h.

128 {return parentFolder;};

References MyWidget::parentFolder.

Referenced by ApplicationWindow::closeWindow(), MuParserScript::resolveColumnPath(), ApplicationWindow::restoreWindowGeometry(), MuParserScript::tableColumn__Function(), and ApplicationWindow::windowGeometryInfo().

Here is the caller graph for this function:

◆ formulaModeActive()

bool TableView::formulaModeActive ( ) const
inherited

Definition at line 953 of file TableView.cpp.

954 {
955  return d_model->formulaModeActive();
956 }

References TableView::d_model, and TableModel::formulaModeActive().

Here is the call graph for this function:

◆ getCurrentCell()

void TableView::getCurrentCell ( int *  row,
int *  col 
)
inherited

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

Definition at line 907 of file TableView.cpp.

908 {
909  QModelIndex index = d_view_widget->selectionModel()->currentIndex();
910  if(index.isValid())
911  {
912  *row = index.row();
913  *col = index.column();
914  }
915  else
916  {
917  *row = -1;
918  *col = -1;
919  }
920 }

References TableView::d_view_widget.

◆ goToCell

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

Definition at line 301 of file TableView.cpp.

302 {
303  QModelIndex index = d_model->index(row, col);
304  d_view_widget->scrollTo(index);
305  d_view_widget->setCurrentIndex(index);
306 }

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

Here is the call graph for this function:

◆ goToNextColumn

void TableView::goToNextColumn ( )
slotinherited

Definition at line 963 of file TableView.cpp.

964 {
965  if (!d_table || d_table->columnCount() == 0) return;
966 
967  QModelIndex idx = d_view_widget->currentIndex();
968  int col = idx.column()+1;
969  if (col >= d_table->columnCount())
970  col = 0;
971  d_view_widget->setCurrentIndex(idx.sibling(idx.row(), col));
972 }

References TableView::d_table, and TableView::d_view_widget.

Referenced by TableView::init().

Here is the caller graph for this function:

◆ goToPreviousColumn

void TableView::goToPreviousColumn ( )
slotinherited

Definition at line 974 of file TableView.cpp.

975 {
976  if (!d_table || d_table->columnCount() == 0) return;
977 
978  QModelIndex idx = d_view_widget->currentIndex();
979  int col = idx.column()-1;
980  if (col < 0)
981  col = d_table->columnCount()-1;
982  d_view_widget->setCurrentIndex(idx.sibling(idx.row(), col));
983 }

References TableView::d_table, and TableView::d_view_widget.

Referenced by TableView::init().

Here is the caller graph for this function:

◆ handleAspectAboutToBeRemoved

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

Definition at line 436 of file TableView.cpp.

436  {
437  if (parent != d_table)
438  return;
439  ui.add_reference_combobox->removeItem(index);
440 }

References TableView::d_table, and TableView::ui.

Referenced by TableView::init().

Here is the caller graph for this function:

◆ handleAspectAdded

void TableView::handleAspectAdded ( const AbstractAspect aspect)
protectedslotinherited

Definition at line 426 of file TableView.cpp.

426  {
427  if (d_table)
428  {
429  const Column * col = qobject_cast<const Column*>(aspect);
430  if (!col || col->parentAspect() != static_cast<AbstractAspect*>(d_table))
431  return;
432  ui.add_reference_combobox->insertItem(d_table->indexOfChild(aspect), "col(\"" + col->name() + "\")");
433  }
434 }

References MyWidget::aspect(), TableView::d_table, AbstractAspect::name(), AbstractAspect::parentAspect(), and TableView::ui.

Referenced by TableView::init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleAspectDescriptionAboutToChange

void Table::handleAspectDescriptionAboutToChange ( const AbstractAspect aspect)
protectedslot

Definition at line 1425 of file Table.cpp.

1426 {
1427  const Column * col = qobject_cast<const Column *>(aspect);
1428  if (col && d_future_table && d_future_table->columnIndex(col) != -1)
1429  {
1430  d_stored_column_labels[col] = aspect->name();
1431  }
1432 }

References MyWidget::aspect(), d_future_table, and d_stored_column_labels.

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleAspectDescriptionChange

void Table::handleAspectDescriptionChange ( const AbstractAspect aspect)
protectedslot

Definition at line 1434 of file Table.cpp.

1435 {
1436  if (aspect == d_future_table)
1437  {
1438  setObjectName(d_future_table->name());
1439  updateCaption();
1440  return;
1441  }
1442  const Column * col = qobject_cast<const Column *>(aspect);
1443  if (col && d_future_table && d_future_table->columnIndex(col) != -1 && d_stored_column_labels.contains(col))
1444  {
1445  QString old_name = d_stored_column_labels.value(col);
1446  QString new_name = col->name();
1447  emit changedColHeader(name() + "_" + old_name,
1448  name() + "_" + new_name);
1449 
1450  for (int i=0; i<d_future_table->columnCount(); i++)
1451  {
1452  QList< Interval<int> > formula_intervals = column(i)->formulaIntervals();
1453  foreach(Interval<int> interval, formula_intervals)
1454  {
1455  QString formula = column(i)->formula(interval.start());
1456  if (formula.contains("\"" + old_name + "\""))
1457  {
1458  formula.replace("\"" + old_name + "\"", "\"" + new_name + "\"");
1459  column(i)->setFormula(interval, formula);
1460  }
1461  }
1462  }
1463  }
1464 }

References MyWidget::aspect(), changedColHeader(), column(), d_future_table, d_stored_column_labels, Column::formula(), Column::formulaIntervals(), name(), AbstractAspect::name(), Column::setFormula(), and MyWidget::updateCaption().

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleAspectDescriptionChanged

void TableView::handleAspectDescriptionChanged ( const AbstractAspect aspect)
protectedslotinherited

Definition at line 415 of file TableView.cpp.

416 {
417  if (d_table)
418  {
419  const Column * col = qobject_cast<const Column*>(aspect);
420  if (!col || col->parentAspect() != static_cast<AbstractAspect*>(d_table))
421  return;
422  ui.add_reference_combobox->setItemText(d_table->columnIndex(col), "col(\"" + col->name() + "\")");
423  }
424 }

References MyWidget::aspect(), TableView::d_table, AbstractAspect::name(), AbstractAspect::parentAspect(), and TableView::ui.

Referenced by TableView::init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleChange

void Table::handleChange ( )
slot

Definition at line 153 of file Table.cpp.

154 {
155  emit modifiedWindow(this);
156 }

References MyWidget::modifiedWindow().

Referenced by init().

Here is the caller graph for this function:

◆ handleColumnChange [1/2]

void Table::handleColumnChange ( int  first,
int  count 
)
slot

Definition at line 158 of file Table.cpp.

159 {
160  for (int i=first; i<first+count; i++)
161  emit modifiedData(this, colName(i));
162 }

References colName(), and modifiedData().

Referenced by handleColumnChange(), and init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleColumnChange [2/2]

void Table::handleColumnChange ( int  top,
int  left,
int  bottom,
int  right 
)
slot

Definition at line 164 of file Table.cpp.

165 {
166  Q_UNUSED(top);
167  Q_UNUSED(bottom);
168  handleColumnChange(left, right-left+1);
169 }

References handleColumnChange().

Here is the call graph for this function:

◆ handleColumnsAboutToBeRemoved

void Table::handleColumnsAboutToBeRemoved ( int  first,
int  count 
)
slot

Definition at line 171 of file Table.cpp.

172 {
173  for (int i=first; i<first+count; i++)
174  emit aboutToRemoveCol(colName(i));
175 }

References aboutToRemoveCol(), and colName().

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleColumnsRemoved

void Table::handleColumnsRemoved ( int  first,
int  count 
)
slot

Definition at line 177 of file Table.cpp.

178 {
179  for (int i=first; i<first+count; i++)
180  emit removedCol(colName(i));
181 }

References colName(), and removedCol().

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleFormatLineEditChange

void TableView::handleFormatLineEditChange ( )
protectedslotinherited

Definition at line 611 of file TableView.cpp.

611  {
612  int type_index = ui.type_box->currentIndex();
613 
614  if (type_index >= 0) {
615  int type = ui.type_box->itemData(type_index).toInt();
616  if (type == SciDAVis::DateTime) {
617  QString str = tr("Selected column type:\n");
618  str += tr("Dates and/or times\n");
619  str += tr("Example: ");
620  str += QDateTime(QDate(1900,1,1), QTime(23,59,59,999)).toString(ui.formatLineEdit->text());
621  ui.type_info->setText(str);
622  ui.date_time_0->setDisplayFormat(ui.formatLineEdit->text());
623  }
624  }
625 }

References SciDAVis::DateTime, str, and TableView::ui.

Referenced by TableView::init().

Here is the caller graph for this function:

◆ handleHeaderDataChanged

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

Definition at line 727 of file TableView.cpp.

728 {
729  if(orientation != Qt::Horizontal) return;
730 
731  QItemSelectionModel * sel_model = d_view_widget->selectionModel();
732 
733  int col = sel_model->currentIndex().column();
734  if(col < first || col > last) return;
736 }

References TableView::d_view_widget, and TableView::setColumnForControlTabs().

Referenced by TableView::init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleHorizontalHeaderDoubleClicked

void TableView::handleHorizontalHeaderDoubleClicked ( int  index)
protectedslotinherited

Definition at line 339 of file TableView.cpp.

340 {
341  Q_UNUSED(index);
343 }

References TableView::showControlDescriptionTab().

Referenced by TableView::init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleHorizontalSectionMoved

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

Definition at line 327 of file TableView.cpp.

328 {
329  static bool inside = false;
330  if(inside) return;
331 
332  inside = true;
333  d_view_widget->horizontalHeader()->moveSection(to, from);
334  inside = false;
335  if (d_table)
336  d_table->moveColumn(from, to);
337 }

References TableView::d_table, and TableView::d_view_widget.

Referenced by TableView::init().

Here is the caller graph for this function:

◆ handleHorizontalSectionResized

void TableView::handleHorizontalSectionResized ( int  logicalIndex,
int  oldSize,
int  newSize 
)
slotinherited

Definition at line 235 of file TableView.cpp.

236 {
237  static bool inside = false;
238  if (d_table)
239  {
240  d_table->setColumnWidth(logicalIndex, newSize);
241  if (inside) return;
242  inside = true;
243 
244  int cols = d_table->columnCount();
245  for (int i=0; i<cols; i++)
246  if(isColumnSelected(i, true))
247  d_horizontal_header->resizeSection(i, newSize);
248  }
249 
250  inside = false;
251 }

References TableView::d_horizontal_header, TableView::d_table, and TableView::isColumnSelected().

Referenced by TableView::rereadSectionSizes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleRowChange

void Table::handleRowChange ( )
slot

Definition at line 183 of file Table.cpp.

184 {
185  for (int i=0; i<numCols(); i++)
186  emit modifiedData(this, colName(i));
187 }

References colName(), modifiedData(), and numCols().

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasMultiSelection()

bool TableView::hasMultiSelection ( )
inherited

Return whether multiple regions are selected.

Definition at line 864 of file TableView.cpp.

865 {
866  QModelIndexList indexes = d_view_widget->selectionModel()->selectedIndexes();
867  if (indexes.size() < 2)
868  return false;
869 
870  QModelIndex index;
871  int minrow = indexes.at(0).row();
872  int maxrow = minrow;
873  int mincol = indexes.at(0).column();
874  int maxcol = mincol;
875  foreach (index, indexes)
876  {
877  minrow = std::min(minrow, index.row());
878  maxrow = std::max(maxrow, index.row());
879  mincol = std::min(mincol, index.column());
880  maxcol = std::max(maxcol, index.column());
881  }
882  int spanned = (maxrow-minrow+1)*(maxcol-mincol+1);
883  return (spanned > d_view_widget->selectionModel()->selectedIndexes().size());
884 }

References TableView::d_view_widget.

◆ hiddenWindow

void MyWidget::hiddenWindow ( MyWidget )
signalinherited

Emitted when the window was hidden.

Referenced by Matrix::closeEvent(), MyWidget::closeEvent(), and closeEvent().

Here is the caller graph for this function:

◆ importASCII

void Table::importASCII ( const QString &  fname,
const QString &  sep,
int  ignoredLines,
bool  renameCols,
bool  stripSpaces,
bool  simplifySpaces,
bool  newTable 
)
slot

Definition at line 1467 of file Table.cpp.

1468  {
1469  Q_UNUSED(newTable)
1470 
1471  AsciiTableImportFilter filter;
1472  filter.set_ignored_lines(ignoredLines);
1473  filter.set_separator(sep);
1474  filter.set_first_row_names_columns(renameCols);
1475  filter.set_trim_whitespace(stripSpaces);
1476  filter.set_simplify_whitespace(simplifySpaces);
1477 
1478  QFile file(fname);
1479  if ( file.open(QIODevice::ReadOnly) )
1480  {
1481  future::Table *temp = static_cast<future::Table *>(filter.importAspect(file));
1482  if (!temp) return;
1483  int preexisting_cols = columnCount();
1484  int overwritten_cols = qMin(temp->columnCount(), preexisting_cols);
1485  for (int i=0; i<overwritten_cols; i++) {
1486  column(i)->asStringColumn()->copy(temp->column(i));
1487  if (renameCols)
1488  column(i)->setName(temp->column(i)->name());
1489  }
1490  for (int i=overwritten_cols; i<preexisting_cols; i++)
1491  column(overwritten_cols)->remove();
1493  for (int i=overwritten_cols; i<temp->columnCount(); i++) {
1494  filter->input(0, temp->column(i));
1495  Column *new_col = new Column(temp->column(i)->name(), SciDAVis::Numeric);
1496  new_col->setPlotDesignation(SciDAVis::Y);
1497  new_col->copy(filter->output(0));
1498  d_future_table->addChild(new_col);
1499  }
1500  delete filter;
1501  delete temp;
1502  setWindowLabel(fname);
1503  }
1504 }

References Column::asStringColumn(), future::Table::column(), column(), columnCount(), future::Table::columnCount(), ColumnStringIO::copy(), Column::copy(), d_future_table, AsciiTableImportFilter::importAspect(), AbstractFilter::input(), AbstractAspect::name(), SciDAVis::Numeric, AbstractSimpleFilter::output(), AbstractAspect::remove(), AsciiTableImportFilter::set_separator(), AbstractAspect::setName(), Column::setPlotDesignation(), setWindowLabel(), and SciDAVis::Y.

Here is the call graph for this function:

◆ importV0x0001XXHeader

void Table::importV0x0001XXHeader ( QStringList  header)
slot

Definition at line 943 of file Table.cpp.

944 {
945  if (!d_future_table) return;
946  QStringList col_label = QStringList();
947  QList<SciDAVis::PlotDesignation> col_plot_type = QList<SciDAVis::PlotDesignation>();
948  for (int i=0; i<header.count();i++)
949  {
950  if (header[i].isEmpty())
951  continue;
952 
953  QString s = header[i].replace("_","-");
954  if (s.contains("[X]"))
955  {
956  col_label << s.remove("[X]");
957  col_plot_type << SciDAVis::X;
958  }
959  else if (s.contains("[Y]"))
960  {
961  col_label << s.remove("[Y]");
962  col_plot_type << SciDAVis::Y;
963  }
964  else if (s.contains("[Z]"))
965  {
966  col_label << s.remove("[Z]");
967  col_plot_type << SciDAVis::Z;
968  }
969  else if (s.contains("[xEr]"))
970  {
971  col_label << s.remove("[xEr]");
972  col_plot_type << SciDAVis::xErr;
973  }
974  else if (s.contains("[yEr]"))
975  {
976  col_label << s.remove("[yEr]");
977  col_plot_type << SciDAVis::yErr;
978  }
979  else
980  {
981  col_label << s;
982  col_plot_type << SciDAVis::noDesignation;
983  }
984  }
985  QList<Column*> quarantine;
986  for (int i=0; i<col_label.count() && i<d_future_table->columnCount();i++)
987  quarantine << column(i);
988  int i = 0;
989  foreach(Column * col, quarantine) {
990  d_future_table->removeChild(col, true);
991  // setting column name while col is still part of table triggers renaming
992  // to prevent name clashes
993  col->setName(col_label.at(i));
994  col->setPlotDesignation(col_plot_type.at(i));
995  i++;
996  }
997  d_future_table->appendColumns(quarantine);
998 }

References column(), columnCount(), d_future_table, SciDAVis::noDesignation, AbstractAspect::setName(), Column::setPlotDesignation(), SciDAVis::X, SciDAVis::xErr, SciDAVis::Y, SciDAVis::yErr, and SciDAVis::Z.

Referenced by ApplicationWindow::openTable(), ApplicationWindow::openTableStatistics(), and restore().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init

void Table::init ( )
slot

Definition at line 96 of file Table.cpp.

97 {
98  TableView::setTable(d_future_table);
99 
100  if (d_future_table)
101  {
102  d_future_table->setView(this);
103  birthdate = d_future_table->creationTime().toString(Qt::LocalDate);
104  }
105 
106  ui.gridLayout1->removeWidget(ui.formula_box);
107  delete ui.formula_box;
108  ui.formula_box = new ScriptEdit(scriptEnv, ui.formula_tab);
109  ui.formula_box->setObjectName(QString::fromUtf8("formula_box"));
110  ui.formula_box->setMinimumSize(QSize(60, 10));
111  ui.formula_box->setAcceptRichText(false);
112  ui.formula_box->setLineWrapMode(QTextEdit::WidgetWidth);
113  ui.gridLayout1->addWidget(ui.formula_box, 1, 0, 1, 3);
114 
115 
116  for (int i=0; i<columnCount(); i++)
117  ui.add_reference_combobox->addItem("col(\""+column(i)->name()+"\")");
118 
119  ui.add_function_combobox->addItems(scriptEnv->mathFunctions());
121 
122  connect(ui.add_function_combobox, SIGNAL(currentIndexChanged(int)),
123  this, SLOT(updateFunctionDoc()));
124  connect(ui.set_formula_button, SIGNAL(pressed()),
125  this, SLOT(applyFormula()));
126  connect(ui.add_function_button, SIGNAL(pressed()),
127  this, SLOT(addFunction()));
128  connect(ui.add_reference_button, SIGNAL(pressed()),
129  this, SLOT(addReference()));
130 
131  connect(d_future_table, SIGNAL(columnsAboutToBeRemoved(int, int)), this, SLOT(handleColumnsAboutToBeRemoved(int, int)));
132  connect(d_future_table, SIGNAL(columnsRemoved(int, int)), this, SLOT(handleColumnsRemoved(int, int)));
133  connect(d_future_table, SIGNAL(rowsInserted(int, int)), this, SLOT(handleRowChange()));
134  connect(d_future_table, SIGNAL(rowsRemoved(int, int)), this, SLOT(handleRowChange()));
135  connect(d_future_table, SIGNAL(dataChanged(int, int, int, int)), this, SLOT(handleColumnChange(int, int, int, int)));
136  connect(d_future_table, SIGNAL(columnsReplaced(int, int)), this, SLOT(handleColumnChange(int, int)));
137 
138  connect(d_future_table, SIGNAL(columnsInserted(int, int)), this, SLOT(handleChange()));
139  connect(d_future_table, SIGNAL(columnsReplaced(int, int)), this, SLOT(handleChange()));
140  connect(d_future_table, SIGNAL(columnsRemoved(int, int)), this, SLOT(handleChange()));
141  connect(d_future_table, SIGNAL(rowsInserted(int, int)), this, SLOT(handleChange()));
142  connect(d_future_table, SIGNAL(rowsRemoved(int, int)), this, SLOT(handleChange()));
143  connect(d_future_table, SIGNAL(dataChanged(int, int, int, int)), this, SLOT(handleChange()));
144  connect(d_future_table, SIGNAL(headerDataChanged(Qt::Orientation, int, int)), this, SLOT(handleChange()));
145  connect(d_future_table, SIGNAL(recalculate()), this, SLOT(recalculate()));
146 
147  connect(d_future_table, SIGNAL(aspectDescriptionChanged(const AbstractAspect*)),
148  this, SLOT(handleAspectDescriptionChange(const AbstractAspect *)));
149  connect(d_future_table, SIGNAL(aspectDescriptionAboutToChange(const AbstractAspect*)),
151 }

References addFunction(), addReference(), applyFormula(), MyWidget::birthdate, column(), columnCount(), d_future_table, handleAspectDescriptionAboutToChange(), handleAspectDescriptionChange(), handleChange(), handleColumnChange(), handleColumnsAboutToBeRemoved(), handleColumnsRemoved(), handleRowChange(), ScriptingEnv::mathFunctions(), AbstractAspect::name(), recalculate(), scripted::scriptEnv, TableView::ui, and updateFunctionDoc().

Referenced by Table().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ insertCol

void Table::insertCol ( )
slot

Definition at line 787 of file Table.cpp.

788 {
789  if (d_future_table)
790  d_future_table->insertEmptyColumns();
791 }

References d_future_table.

◆ insertCols

void Table::insertCols ( int  start,
int  count 
)
slot

Definition at line 773 of file Table.cpp.

774 {
775  if (d_future_table)
776  {
777  if (start < 0)
778  start = 0;
779 
780  QList<Column*> cols;
781  for(int i=0; i<count; i++)
782  cols << new Column(QString::number(i+1), SciDAVis::Numeric);
783  d_future_table->insertColumns(start, cols);
784  }
785 }

References d_future_table, and SciDAVis::Numeric.

◆ insertRow

void Table::insertRow ( )
slot

Definition at line 793 of file Table.cpp.

794 {
795  if (d_future_table)
796  d_future_table->insertEmptyRows();
797 }

References d_future_table.

◆ isCellSelected()

bool TableView::isCellSelected ( int  row,
int  col 
)
inherited

Return whether a cell is selected.

Definition at line 886 of file TableView.cpp.

887 {
888  if(!d_table || row < 0 || col < 0 || row >= d_table->rowCount() || col >= d_table->columnCount()) return false;
889 
890  return d_view_widget->selectionModel()->isSelected(d_model->index(row, col));
891 }

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

Here is the call graph for this function:

◆ isColumnSelected()

bool TableView::isColumnSelected ( int  col,
bool  full = false 
)
inherited

Returns true if column 'col' is selected; otherwise false.

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

Definition at line 762 of file TableView.cpp.

763 {
764  if(full)
765  return d_view_widget->selectionModel()->isColumnSelected(col, QModelIndex());
766  else
767  return d_view_widget->selectionModel()->columnIntersectsSelection(col, QModelIndex());
768 }

References TableView::d_view_widget.

Referenced by drawableColumnSelection(), TableView::eventFilter(), exportASCII(), TableView::firstSelectedColumn(), TableView::handleHorizontalSectionResized(), TableView::lastSelectedColumn(), TableView::selectedColumnCount(), selectedColumns(), TableView::selectedColumns(), selectedErrColumns(), selectedYColumns(), selectedYLabels(), and ApplicationWindow::showColStatistics().

Here is the caller graph for this function:

◆ isControlTabBarVisible()

bool TableView::isControlTabBarVisible ( )
inlineinherited

Definition at line 102 of file TableView.h.

102 { return d_control_tabs->isVisible(); }

References TableView::d_control_tabs.

◆ isRowSelected()

bool TableView::isRowSelected ( int  row,
bool  full = false 
)
inherited

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

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

Definition at line 794 of file TableView.cpp.

795 {
796  if(full)
797  return d_view_widget->selectionModel()->isRowSelected(row, QModelIndex());
798  else
799  return d_view_widget->selectionModel()->rowIntersectsSelection(row, QModelIndex());
800 }

References TableView::d_view_widget.

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

Here is the caller graph for this function:

◆ lastSelectedColumn()

int TableView::lastSelectedColumn ( bool  full = false)
inherited

Return the index of the last selected column.

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

Definition at line 816 of file TableView.cpp.

817 {
818  if (d_table)
819  {
820  int cols = d_table->columnCount();
821  for(int i=cols-1; i>=0; i--)
822  if(isColumnSelected(i, full)) return i;
823  }
824  return -2;
825 }

References TableView::d_table, and TableView::isColumnSelected().

Referenced by applyFormula(), and recalculate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lastSelectedRow()

int TableView::lastSelectedRow ( bool  full = false)
inherited

Return the index of the last selected row.

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

Definition at line 841 of file TableView.cpp.

842 {
843  if (d_table)
844  {
845  int rows = d_table->rowCount();
846  for(int i=rows-1; i>=0; i--)
847  if(isRowSelected(i, full)) return i;
848  }
849  return -2;
850 }

References TableView::d_table, and TableView::isRowSelected().

Referenced by exportASCII(), ApplicationWindow::plotPie(), ApplicationWindow::plotVectXYAM(), ApplicationWindow::plotVectXYXY(), and ApplicationWindow::selectPlotType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ modifiedData

void Table::modifiedData ( Table ,
const QString &   
)
signal

Referenced by handleColumnChange(), handleRowChange(), and TableStatistics::update().

Here is the caller graph for this function:

◆ modifiedWindow

void MyWidget::modifiedWindow ( MyWidget )
signalinherited

Referenced by Matrix::handleChange(), handleChange(), Matrix::invert(), Note::modifiedNote(), MyWidget::notifyChanges(), Matrix::recalculate(), and Matrix::setNumericFormat().

Here is the caller graph for this function:

◆ name()

◆ notifyChanges()

void MyWidget::notifyChanges ( )
inlineinherited

Notifies the main application that the window has been modified.

Definition at line 134 of file MyWidget.h.

134 {emit modifiedWindow(this);};

References MyWidget::modifiedWindow().

Referenced by ApplicationWindow::importASCII(), PlotDialog::pickBorderColor(), and PlotDialog::updateBorder().

Here is the caller graph for this function:

◆ noXColumn

bool Table::noXColumn ( )
slot

Definition at line 1022 of file Table.cpp.

1023 {
1024  return d_future_table? d_future_table->columnCount(SciDAVis::X) == 0: true;
1025 }

References d_future_table, and SciDAVis::X.

Referenced by ApplicationWindow::plotPie(), ApplicationWindow::validFor2DPlot(), and ApplicationWindow::validFor3DPlot().

Here is the caller graph for this function:

◆ noYColumn

bool Table::noYColumn ( )
slot

Definition at line 1027 of file Table.cpp.

1028 {
1029  return d_future_table? d_future_table->columnCount(SciDAVis::Y) == 0: true;
1030 }

References d_future_table, and SciDAVis::Y.

Referenced by ApplicationWindow::validFor3DPlot().

Here is the caller graph for this function:

◆ numCols

◆ numRows

◆ numSelectedRows

int Table::numSelectedRows ( )
slot

Definition at line 755 of file Table.cpp.

756 {
757  return selectedRowCount();
758 }

References TableView::selectedRowCount().

Referenced by ApplicationWindow::showRowStatistics().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pasteSelection

void Table::pasteSelection ( )
slot

Definition at line 868 of file Table.cpp.

869 {
870  if (d_future_table)
871  d_future_table->pasteIntoSelection();
872 }

References d_future_table.

◆ plotDesignations

QList< int > Table::plotDesignations ( )
slot

Definition at line 1287 of file Table.cpp.

1288 {
1289  QList<int> list;
1290  if (d_future_table)
1291  for (int i=0; i<d_future_table->columnCount(); i++)
1292  list << column(i)->plotDesignation();
1293  return list;
1294 }

References column(), d_future_table, and Column::plotDesignation().

Here is the call graph for this function:

◆ print [1/2]

void Table::print ( )
slot

Definition at line 225 of file Table.cpp.

226 {
227  print(QString());
228 }

Referenced by exportPDF(), and recalculate().

Here is the caller graph for this function:

◆ print [2/2]

void Table::print ( const QString &  fileName)
slot

Definition at line 230 of file Table.cpp.

231 {
232  QPrinter printer;
233  printer.setColorMode (QPrinter::GrayScale);
234 
235  if (!fileName.isEmpty())
236  {
237  printer.setCreator("SciDAVis");
238  printer.setOutputFormat(QPrinter::PdfFormat);
239  printer.setOutputFileName(fileName);
240  }
241  else
242  {
243  QPrintDialog printDialog(&printer);
244  if (printDialog.exec() != QDialog::Accepted)
245  return;
246  }
247 
248  printer.setFullPage( true );
249  QPainter p;
250  if ( !p.begin(&printer ) )
251  return; // paint on printer
252  int dpiy = printer.logicalDpiY();
253  const int margin = (int) ( (1/2.54)*dpiy ); // 1 cm margins
254 
255  QHeaderView *hHeader = d_view_widget->horizontalHeader();
256  QHeaderView *vHeader = d_view_widget->verticalHeader();
257 
258  int rows = numRows();
259  int cols = numCols();
260  int height = margin;
261  int i, vertHeaderWidth = vHeader->width();
262  int right = margin + vertHeaderWidth;
263 
264  // print header
265  p.setFont(hHeader->font());
266  QString header_label = d_view_widget->model()->headerData(0, Qt::Horizontal).toString();
267  QRect br = p.boundingRect(br, Qt::AlignCenter, header_label);
268  p.drawLine(right, height, right, height+br.height());
269  QRect tr(br);
270 
271  for (i=0;i<cols;i++)
272  {
273  int w = columnWidth(i);
274  tr.setTopLeft(QPoint(right,height));
275  tr.setWidth(w);
276  tr.setHeight(br.height());
277  header_label = d_view_widget->model()->headerData(i, Qt::Horizontal).toString();
278  p.drawText(tr, Qt::AlignCenter, header_label);
279  right += w;
280  p.drawLine(right, height, right, height+tr.height());
281 
282  if (right >= printer.width()-2*margin )
283  break;
284  }
285 
286  p.drawLine(margin + vertHeaderWidth, height, right-1, height);//first horizontal line
287  height += tr.height();
288  p.drawLine(margin, height, right-1, height);
289 
290  // print table values
291  for (i=0;i<rows;i++)
292  {
293  right = margin;
294  QString cell_text = d_view_widget->model()->headerData(i, Qt::Vertical).toString()+"\t";
295  tr = p.boundingRect(tr, Qt::AlignCenter, cell_text);
296  p.drawLine(right, height, right, height+tr.height());
297 
298  br.setTopLeft(QPoint(right,height));
299  br.setWidth(vertHeaderWidth);
300  br.setHeight(tr.height());
301  p.drawText(br, Qt::AlignCenter, cell_text);
302  right += vertHeaderWidth;
303  p.drawLine(right, height, right, height+tr.height());
304 
305  for(int j=0;j<cols;j++)
306  {
307  int w = columnWidth (j);
308  cell_text = text(i,j)+"\t";
309  tr = p.boundingRect(tr,Qt::AlignCenter,cell_text);
310  br.setTopLeft(QPoint(right,height));
311  br.setWidth(w);
312  br.setHeight(tr.height());
313  p.drawText(br, Qt::AlignCenter, cell_text);
314  right += w;
315  p.drawLine(right, height, right, height+tr.height());
316 
317  if (right >= printer.width()-2*margin )
318  break;
319  }
320  height += br.height();
321  p.drawLine(margin, height, right-1, height);
322 
323  if (height >= printer.height()-margin )
324  {
325  printer.newPage();
326  height = margin;
327  p.drawLine(margin, height, right, height);
328  }
329  }
330 }

References columnWidth(), TableView::d_view_widget, numCols(), numRows(), and text().

Here is the call graph for this function:

◆ recalculate [1/2]

bool Table::recalculate ( )
slot

Recalculate selected cells.

Definition at line 427 of file Table.cpp.

428 {
429  for (int col=firstSelectedColumn(); col<=lastSelectedColumn(); col++)
430  if (!recalculate(col, true))
431  return false;
432  return true;
433 }

References TableView::firstSelectedColumn(), and TableView::lastSelectedColumn().

Referenced by applyFormula(), and init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ recalculate [2/2]

bool Table::recalculate ( int  col,
bool  only_selected_rows = true 
)
slot

Compute cells from the cell formulas.

Definition at line 435 of file Table.cpp.

436 {
437  QApplication::setOverrideCursor(Qt::WaitCursor);
438  Column *col_ptr=column(col);
439  if (!col_ptr) return false;
440 
441  QList< Interval<int> > formula_intervals = col_ptr->formulaIntervals();
442  if (only_selected_rows) {
443  // remove non-selected rows from list of intervals
444  QList< Interval<int> > deselected = Interval<int>(0,col_ptr->rowCount()-1) - selectedRows().intervals();
445  foreach(Interval<int> i, deselected)
446  Interval<int>::subtractIntervalFromList(&formula_intervals, i);
447  }
448  foreach(Interval<int> interval, formula_intervals)
449  {
450  QString formula = col_ptr->formula(interval.start());
451  if (formula.isEmpty())
452  continue;
453 
454  Script *colscript = scriptEnv->newScript(formula, this, QString("<%1>").arg(colName(col)));
455  connect(colscript, SIGNAL(error(const QString&,const QString&,int)), scriptEnv, SIGNAL(error(const QString&,const QString&,int)));
456  connect(colscript, SIGNAL(print(const QString&)), scriptEnv, SIGNAL(print(const QString&)));
457 
458  if (!colscript->compile()) {
459  delete colscript;
460  QApplication::restoreOverrideCursor();
461  return false;
462  }
463 
464  colscript->setInt(col+1, "j");
465  QVariant ret;
466  int start_row = interval.start();
467  int end_row = interval.end();
468  switch (col_ptr->columnMode()) {
469  case SciDAVis::Numeric:
470  {
471  QVector<qreal> results(end_row-start_row+1);
472  for (int i=start_row; i<=end_row; i++) {
473  colscript->setInt(i+1,"i");
474  ret = colscript->eval();
475  if (!ret.isValid()) {
476  delete colscript;
477  QApplication::restoreOverrideCursor();
478  return false;
479  }
480  if (ret.canConvert(QVariant::Double))
481  results[i-start_row] = ret.toDouble();
482  else
483  results[i-start_row] = NAN;
484  }
485  col_ptr->replaceValues(start_row, results);
486  break;
487  }
488  default:
489  {
490  QStringList results;
491  for (int i=start_row; i<=end_row; i++) {
492  colscript->setInt(i+1,"i");
493  ret = colscript->eval();
494  if (!ret.isValid()) {
495  delete colscript;
496  QApplication::restoreOverrideCursor();
497  return false;
498  }
499  if (ret.type() == QVariant::Double)
500  results << QLocale().toString(ret.toDouble(), 'g', 14);
501  else if(ret.canConvert(QVariant::String))
502  results << ret.toString();
503  else
504  results << QString();
505  }
506  col_ptr->asStringColumn()->replaceTexts(start_row, results);
507  break;
508  }
509  }
510  delete colscript;
511  }
512  QApplication::restoreOverrideCursor();
513  return true;
514 }

References Column::asStringColumn(), colName(), column(), Column::columnMode(), Script::compile(), Script::eval(), Column::formula(), Column::formulaIntervals(), IntervalAttribute< bool >::intervals(), ScriptingEnv::newScript(), SciDAVis::Numeric, print(), ColumnStringIO::replaceTexts(), Column::replaceValues(), Column::rowCount(), scripted::scriptEnv, TableView::selectedRows(), and Script::setInt().

Here is the call graph for this function:

◆ removeCol [1/2]

void Table::removeCol ( )
slot

Definition at line 874 of file Table.cpp.

875 {
876  if (d_future_table)
877  d_future_table->removeSelectedColumns();
878 }

References d_future_table.

◆ removeCol [2/2]

void Table::removeCol ( const QStringList &  list)
slot

Definition at line 880 of file Table.cpp.

881 {
882  if (d_future_table)
883  foreach(QString name, list)
884  d_future_table->removeColumns(colIndex(name), 1);
885 }

References colIndex(), d_future_table, and name().

Here is the call graph for this function:

◆ removedCol

void Table::removedCol ( const QString &  )
signal

Referenced by handleColumnsRemoved().

Here is the caller graph for this function:

◆ rereadSectionSizes

void TableView::rereadSectionSizes ( )
slotinherited

Definition at line 211 of file TableView.cpp.

212 {
213  disconnect(d_horizontal_header, SIGNAL(sectionResized(int, int, int)), this, SLOT(handleHorizontalSectionResized(int, int, int)));
214 
215  if (d_table)
216  {
217  int cols = d_table->columnCount();
218  for (int i=0; i<cols; i++)
219  d_horizontal_header->resizeSection(i, d_table->columnWidth(i));
220  }
221 
222  connect(d_horizontal_header, SIGNAL(sectionResized(int, int, int)), this, SLOT(handleHorizontalSectionResized(int, int, int)));
223 }

References TableView::d_horizontal_header, TableView::d_table, and TableView::handleHorizontalSectionResized().

Referenced by TableView::init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resizedTable

void Table::resizedTable ( QWidget *  )
signal

◆ resizedWindow

void MyWidget::resizedWindow ( MyWidget )
signalinherited

Referenced by Graph3D::resizeEvent(), and MultiLayer::resizeLayers().

Here is the caller graph for this function:

◆ restore

void Table::restore ( const QStringList &  lst)
slot

Definition at line 1211 of file Table.cpp.

1212 {
1213 // TODO: obsolete, remove in 0.3.0, only needed for template loading
1214  QStringList temp_list;
1215  QStringList::const_iterator iterator=list_in.begin();
1216 
1217  temp_list= (*iterator++).split("\t");
1218  temp_list.removeFirst();
1219  importV0x0001XXHeader(temp_list);
1220 
1221  setColWidths((*iterator).right((*iterator).length()-9).split("\t", QString::SkipEmptyParts));
1222  iterator++;
1223 
1224  temp_list = (*iterator++).split("\t");
1225  if (temp_list[0] == "com")
1226  {
1227  temp_list.removeFirst();
1228  setCommands(temp_list);
1229  }
1230  else if (temp_list[0] == "<com>")
1231  {
1232  QStringList commands;
1233  for (int col=0; col<numCols(); col++)
1234  commands << "";
1235  for (; iterator != list_in.end() && *iterator != "</com>"; iterator++)
1236  {
1237  int col = (*iterator).mid(9,(*iterator).length()-11).toInt();
1238  QString formula;
1239  for (iterator++; iterator!=list_in.end() && *iterator != "</col>"; iterator++)
1240  formula += *iterator + "\n";
1241  formula.truncate(formula.length()-1);
1242  commands[col] = formula;
1243  }
1244  iterator++;
1245  setCommands(commands);
1246  }
1247 
1248  temp_list = (*iterator++).split("\t");
1249  temp_list.removeFirst();
1250  setColumnTypes(temp_list);
1251 
1252  temp_list = (*iterator++).split("\t");
1253  temp_list.removeFirst();
1254  setColComments(temp_list);
1255 }

References importV0x0001XXHeader(), numCols(), setColComments(), setColumnTypes(), setColWidths(), and setCommands().

Here is the call graph for this function:

◆ retranslateStrings()

void TableView::retranslateStrings ( )
protectedinherited

Definition at line 260 of file TableView.cpp.

261 {
262  d_hide_button->setToolTip(tr("Show/hide control tabs"));
263  ui.retranslateUi(d_control_tabs);
264 
265  ui.type_box->clear();
266  ui.type_box->addItem(tr("Numeric"), QVariant(int(SciDAVis::Numeric)));
267  ui.type_box->addItem(tr("Text"), QVariant(int(SciDAVis::Text)));
268  ui.type_box->addItem(tr("Month names"), QVariant(int(SciDAVis::Month)));
269  ui.type_box->addItem(tr("Day names"), QVariant(int(SciDAVis::Day)));
270  ui.type_box->addItem(tr("Date and time"), QVariant(int(SciDAVis::DateTime)));
271  ui.type_box->setCurrentIndex(0);
272 
273  ui.date_time_interval->clear();
274  ui.date_time_interval->addItem(tr("years"), int(Double2DateTimeFilter::Year));
275  ui.date_time_interval->addItem(tr("months"), int(Double2DateTimeFilter::Month));
276  ui.date_time_interval->addItem(tr("days"), int(Double2DateTimeFilter::Day));
277  ui.date_time_interval->addItem(tr("hours"), int(Double2DateTimeFilter::Hour));
278  ui.date_time_interval->addItem(tr("minutes"), int(Double2DateTimeFilter::Minute));
279  ui.date_time_interval->addItem(tr("seconds"), int(Double2DateTimeFilter::Second));
280  ui.date_time_interval->addItem(tr("milliseconds"), int(Double2DateTimeFilter::Millisecond));
281  ui.date_time_interval->setCurrentIndex(0);
282 
283  // TODO: implement formula stuff
284  //ui.formula_info->document()->setPlainText("not implemented yet");
285 }

References TableView::d_control_tabs, TableView::d_hide_button, SciDAVis::DateTime, Double2DateTimeFilter::Day, SciDAVis::Day, Double2DateTimeFilter::Hour, Double2DateTimeFilter::Millisecond, Double2DateTimeFilter::Minute, Double2DateTimeFilter::Month, SciDAVis::Month, SciDAVis::Numeric, Double2DateTimeFilter::Second, SciDAVis::Text, TableView::ui, and Double2DateTimeFilter::Year.

Referenced by TableView::changeEvent(), and TableView::init().

Here is the caller graph for this function:

◆ rowCount

int Table::rowCount ( )
slot

Definition at line 897 of file Table.cpp.

898 {
899  return d_future_table? d_future_table->rowCount():0;
900 }

References d_future_table.

Referenced by applyFormula(), and ApplicationWindow::importASCII().

Here is the caller graph for this function:

◆ saveAsTemplate

QString Table::saveAsTemplate ( const QString &  geometryInfo)
slot

Definition at line 1197 of file Table.cpp.

1198 {
1199  QString s="<table>\t"+QString::number(numRows())+"\t";
1200  s+=QString::number(numCols())+"\n";
1201  s+=geometryInfo;
1202  s+=saveHeader();
1203  s+=saveColumnWidths();
1204  s+=saveCommands();
1205  s+=saveColumnTypes();
1206  s+=saveComments();
1207  s +="</table>\n";
1208  return s;
1209 }

References numCols(), numRows(), saveColumnTypes(), saveColumnWidths(), saveCommands(), saveComments(), and saveHeader().

Here is the call graph for this function:

◆ saveColumnTypes

QString Table::saveColumnTypes ( )
slot

Definition at line 400 of file Table.cpp.

401 {
402 // TODO: obsolete, remove in 0.3.0
403  QString s="ColType";
404  for (int i=0; i<numCols(); i++)
405  s += "\t"+QString::number(column(i)->columnMode())+";0/6";
406  return s+"\n";
407 }

References column(), Column::columnMode(), and numCols().

Referenced by saveAsTemplate(), and TableStatistics::saveToString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveColumnWidths

QString Table::saveColumnWidths ( )
slot

Definition at line 390 of file Table.cpp.

391 {
392 // TODO: obsolete, remove in 0.3.0
393  QString s="ColWidth\t";
394  for (int i=0;i<numCols();i++)
395  s+=QString::number(columnWidth(i))+"\t";
396 
397  return s+"\n";
398 }

References columnWidth(), and numCols().

Referenced by saveAsTemplate(), and TableStatistics::saveToString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveCommands

QString Table::saveCommands ( )
slot

Definition at line 516 of file Table.cpp.

517 {
518 // TODO: obsolete, remove for 0.3.0, only needed for template saving
519  QString s="<com>\n";
520  for (int col=0; col<numCols(); col++)
521  if (!column(col)->formula(0).isEmpty())
522  {
523  s += "<col nr=\""+QString::number(col)+"\">\n";
524  s += column(col)->formula(0);
525  s += "\n</col>\n";
526  }
527  s += "</com>\n";
528  return s;
529 }

References column(), Column::formula(), and numCols().

Referenced by saveAsTemplate(), and TableStatistics::saveToString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveComments

QString Table::saveComments ( )
slot

Definition at line 531 of file Table.cpp.

532 {
533 // TODO: obsolete, remove for 0.3.0, only needed for template saving
534  QString s = "Comments\t";
535  for (int i=0; i<numCols(); i++)
536  {
537  s += column(i)->comment() + "\t";
538  }
539  return s + "\n";
540 }

References column(), AbstractAspect::comment(), and numCols().

Referenced by saveAsTemplate(), and TableStatistics::saveToString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveHeader

QString Table::saveHeader ( )
slot

Definition at line 610 of file Table.cpp.

611 {
612 // TODO: obsolete, remove for 0.3.0, only needed for template saving
613  QString s = "header";
614  for (int j=0; j<numCols(); j++)
615  {
616  switch (column(j)->plotDesignation())
617  {
618  case SciDAVis::X:
619  s += "\t" + colLabel(j) + "[X]";
620  break;
621  case SciDAVis::Y:
622  s += "\t" + colLabel(j) + "[Y]";
623  break;
624  case SciDAVis::Z:
625  s += "\t" + colLabel(j) + "[Z]";
626  break;
627  case SciDAVis::xErr:
628  s += "\t" + colLabel(j) + "[xEr]";
629  break;
630  case SciDAVis::yErr:
631  s += "\t" + colLabel(j) + "[yEr]";
632  break;
633  default:
634  s += "\t" + colLabel(j);
635  }
636  }
637  return s += "\n";
638 }

References colLabel(), column(), numCols(), Column::plotDesignation(), SciDAVis::X, SciDAVis::xErr, SciDAVis::Y, SciDAVis::yErr, and SciDAVis::Z.

Referenced by saveAsTemplate(), and TableStatistics::saveToString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveToDevice

void Table::saveToDevice ( QIODevice *  device,
const QString &  geometry 
)
slot

Definition at line 558 of file Table.cpp.

559 {
560  QTextStream stream(device);
561  stream.setCodec(QTextCodec::codecForName("UTF-8"));
562 
563  // write start tag
564  stream << "<table>\n";
565  stream.flush();
566 
567  // On Windows, writing to a QString has been observed to crash for large tables
568  // (apparently due to excessive memory usage).
569  // => use temporary file if possible
570  QTemporaryFile tmp_file;
571  QString tmp_string;
572  if (d_future_table)
573  {
574  QXmlStreamWriter xml(&tmp_string);
575  if (tmp_file.open())
576  xml.setDevice(&tmp_file);
577  d_future_table->save(&xml);
578  }
579 
580  // write number of characters of QXmlStreamWriter's output
581  // this is needed in case there are newlines in the XML
582  int xml_chars = 0;
583  if (tmp_file.isOpen()) {
584  tmp_file.seek(0);
585  QTextStream count(&tmp_file);
586  count.setCodec(QTextCodec::codecForName("UTF-8"));
587  while (!count.atEnd())
588  xml_chars += count.read(1024).length();
589  } else
590  xml_chars = tmp_string.length();
591  stream << xml_chars << "\n";
592  stream.flush();
593 
594  // Copy QXmlStreamWriter's output to device
595  if (tmp_file.isOpen()) {
596  tmp_file.seek(0);
597  qint64 bytes_read;
598  char buffer[1024];
599  while ((bytes_read = tmp_file.read(buffer, 1024)) > 0)
600  device->write(buffer, bytes_read);
601  } else
602  stream << tmp_string;
603  stream << "\n";
604 
605  // write geometry and end tag
606  stream << geometry << "\n";
607  stream << "</table>\n";
608 }

References d_future_table.

Referenced by ApplicationWindow::rawSaveFolder().

Here is the caller graph for this function:

◆ saveToString

QString Table::saveToString ( const QString &  geometry)
virtualslot

Reimplemented in TableStatistics.

Definition at line 542 of file Table.cpp.

543 {
544  QString s = "<table>\n";
545  QString xml;
546  if (d_future_table)
547  {
548  QXmlStreamWriter writer(&xml);
549  d_future_table->save(&writer);
550  }
551  s += QString::number(xml.length()) + "\n"; // this is need in case there are newlines in the XML
552  s += xml + "\n";
553  s += geometry + "\n";
554  s +="</table>\n";
555  return s;
556 }

References d_future_table.

◆ scriptingChangeEvent()

void scripted::scriptingChangeEvent ( ScriptingChangeEvent sce)
inherited

Definition at line 119 of file Script.cpp.

120 {
121  scriptEnv->decref();
122  sce->scriptingEnv()->incref();
123  scriptEnv = sce->scriptingEnv();
124 }

References ScriptingEnv::decref(), ScriptingEnv::incref(), scripted::scriptEnv, and ScriptingChangeEvent::scriptingEnv().

Referenced by ScriptEdit::customEvent(), ApplicationWindow::customEvent(), Matrix::customEvent(), and customEvent().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectAll

void TableView::selectAll ( )
slotinherited

Definition at line 308 of file TableView.cpp.

309 {
311 }

References TableView::d_view_widget, and TableViewWidget::selectAll().

Referenced by TableView::init(), and selectAllTable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectAllTable

void Table::selectAllTable ( )
slot

Definition at line 846 of file Table.cpp.

847 {
848  selectAll();
849 }

References TableView::selectAll().

Here is the call graph for this function:

◆ selectedColsNumber

int Table::selectedColsNumber ( )
slot

Definition at line 760 of file Table.cpp.

761 {
762  return selectedColumnCount();
763 }

References TableView::selectedColumnCount().

Here is the call graph for this function:

◆ selectedColumnCount() [1/2]

int TableView::selectedColumnCount ( bool  full = false)
inherited

Return how many columns are selected.

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

Definition at line 738 of file TableView.cpp.

739 {
740  int count = 0;
741  if (d_table)
742  {
743  int cols = d_table->columnCount();
744  for (int i=0; i<cols; i++)
745  if(isColumnSelected(i, full)) count++;
746  }
747  return count;
748 }

References TableView::d_table, and TableView::isColumnSelected().

Referenced by selectedColsNumber(), and ApplicationWindow::validFor2DPlot().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectedColumnCount() [2/2]

int TableView::selectedColumnCount ( SciDAVis::PlotDesignation  pd)
inherited

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

Definition at line 750 of file TableView.cpp.

751 {
752  int count = 0;
753  if (d_table)
754  {
755  int cols = d_table->columnCount();
756  for(int i=0; i<cols; i++)
757  if( isColumnSelected(i, false) && (d_table->column(i)->plotDesignation() == pd) ) count++;
758  }
759  return count;
760 }

References TableView::d_table, and TableView::isColumnSelected().

Here is the call graph for this function:

◆ selectedColumns [1/2]

QStringList Table::selectedColumns ( )
slot

Definition at line 663 of file Table.cpp.

664 {
665 // TODO for 0.3.0: extended selection support, Column * lists
666  QStringList names;
667  for (int i=0; i<numCols(); i++)
668  {
669  if(isColumnSelected(i))
670  names << name() + "_" + column(i)->name();
671  }
672  return names;
673 }

References column(), TableView::isColumnSelected(), name(), AbstractAspect::name(), and numCols().

Referenced by ApplicationWindow::autoCorrelate(), ApplicationWindow::convolute(), ApplicationWindow::correlate(), ApplicationWindow::deconvolute(), ApplicationWindow::multilayerPlot(), ApplicationWindow::plot3DBars(), ApplicationWindow::plot3DRibbon(), ApplicationWindow::plot3DScatter(), ApplicationWindow::plot3DTrajectory(), ApplicationWindow::plotPie(), ApplicationWindow::plotVectXYAM(), ApplicationWindow::plotVectXYXY(), ApplicationWindow::selectPlotType(), FFTDialog::setTable(), and ApplicationWindow::showColStatistics().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectedColumns() [2/2]

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

Return all selected columns.

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

Definition at line 770 of file TableView.cpp.

771 {
772  QList<Column*> list;
773  if (d_table)
774  {
775  int cols = d_table->columnCount();
776  for (int i=0; i<cols; i++)
777  if(isColumnSelected(i, full)) list << d_table->column(i);
778  }
779  return list;
780 }

References TableView::d_table, and TableView::isColumnSelected().

Referenced by TableView::applyType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectedErrColumns

QStringList Table::selectedErrColumns ( )
slot

Definition at line 699 of file Table.cpp.

700 {
701 // TODO for 0.3.0: Column * list
702  QStringList names;
703  for (int i=0;i<numCols();i++)
704  {
705  if (isColumnSelected(i) &&
708  names << name() + "_" + column(i)->name();
709  }
710  return names;
711 }

References column(), TableView::isColumnSelected(), name(), AbstractAspect::name(), numCols(), Column::plotDesignation(), SciDAVis::xErr, and SciDAVis::yErr.

Here is the call graph for this function:

◆ selectedRowCount()

int TableView::selectedRowCount ( bool  full = false)
inherited

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

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

Definition at line 782 of file TableView.cpp.

783 {
784  int count = 0;
785  if (d_table)
786  {
787  int rows = d_table->rowCount();
788  for (int i=0; i<rows; i++)
789  if(isRowSelected(i, full)) count++;
790  }
791  return count;
792 }

References TableView::d_table, and TableView::isRowSelected().

Referenced by numSelectedRows().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectedRows()

IntervalAttribute< bool > TableView::selectedRows ( bool  full = false)
inherited

Get the complete set of selected rows.

Definition at line 852 of file TableView.cpp.

852  {
854  if (d_table)
855  {
856  int rows = d_table->rowCount();
857  for (int i=0; i<rows; i++)
858  if (isRowSelected(i, full))
859  result.setValue(i, true);
860  }
861  return result;
862 }

References TableView::d_table, TableView::isRowSelected(), and IntervalAttribute< bool >::setValue().

Referenced by recalculate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectedYColumns

QStringList Table::selectedYColumns ( )
slot

Definition at line 687 of file Table.cpp.

688 {
689 // TODO for 0.3.0: Column * list
690  QStringList names;
691  for (int i=0;i<numCols();i++)
692  {
694  names << name() + "_" + column(i)->name();
695  }
696  return names;
697 }

References column(), TableView::isColumnSelected(), name(), AbstractAspect::name(), numCols(), Column::plotDesignation(), and SciDAVis::Y.

Referenced by ApplicationWindow::multilayerPlot().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectedYLabels

QMap< int, QString > Table::selectedYLabels ( )
slot

Definition at line 733 of file Table.cpp.

734 {
735 // TODO for 0.3.0: Column * list
736  QMap<int, QString> names;
737  for (int i=0;i <numCols(); i++)
738  {
740  names.insert(i, column(i)->name());
741  }
742  return names;
743 }

References column(), TableView::isColumnSelected(), AbstractAspect::name(), numCols(), Column::plotDesignation(), and SciDAVis::Y.

Referenced by Graph::plotBoxDiagram().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectionChanged

void TableView::selectionChanged ( const QItemSelection &  selected,
const QItemSelection &  deselected 
)
protectedslotinherited

Definition at line 442 of file TableView.cpp.

443 {
444  Q_UNUSED(selected);
445  Q_UNUSED(deselected);
446 }

Referenced by TableView::init().

Here is the caller graph for this function:

◆ setBackgroundColor

void Table::setBackgroundColor ( const QColor &  col)
slot

Definition at line 189 of file Table.cpp.

190 {
191  QPalette palette;
192  palette.setColor(QPalette::Window, col);
193  d_view_widget->setPalette(palette);
194 }

References TableView::d_view_widget.

◆ setBirthDate()

virtual void Table::setBirthDate ( const QString &  s)
inlinevirtual

Set the creation date.

Reimplemented from MyWidget.

Definition at line 97 of file Table.h.

98  {
99  birthdate = s;
100  if (d_future_table)
101  d_future_table->importV0x0001XXCreationTime(s);
102  }

References MyWidget::birthdate, and d_future_table.

Referenced by ApplicationWindow::openTable(), and ApplicationWindow::openTableStatistics().

Here is the caller graph for this function:

◆ setCaptionPolicy()

void Table::setCaptionPolicy ( CaptionPolicy  policy)
inlinevirtual

Set the caption policy.

Reimplemented from MyWidget.

Definition at line 76 of file Table.h.

77  {
78  if (d_future_table)
79  {
80  caption_policy = policy;
81  updateCaption();
82  switch (policy)
83  {
84  case Name:
85  d_future_table->setCaptionSpec("%n");
86  break;
87  case Label:
88  d_future_table->setCaptionSpec("%c");
89  break;
90  case Both:
91  d_future_table->setCaptionSpec("%n%C{ - }%c");
92  break;
93  }
94  }
95  }

References MyWidget::Both, MyWidget::caption_policy, d_future_table, MyWidget::Label, MyWidget::Name, and MyWidget::updateCaption().

Referenced by ApplicationWindow::convertMatrixToTable(), ApplicationWindow::importASCII(), ApplicationWindow::openTable(), ApplicationWindow::openTableStatistics(), ApplicationWindow::plotFile(), and TableStatistics::TableStatistics().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCell

void Table::setCell ( int  row,
int  col,
double  val 
)
slot

Definition at line 926 of file Table.cpp.

927 {
928  column(col)->setValueAt(row, val);
929 }

References column(), and Column::setValueAt().

Referenced by ApplicationWindow::convertMatrixToTable(), and ApplicationWindow::openTable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCellSelected()

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

Select/Deselect a cell.

Definition at line 893 of file TableView.cpp.

894 {
895  d_view_widget->selectionModel()->select(d_model->index(row, col),
896  select ? QItemSelectionModel::Select : QItemSelectionModel::Deselect);
897 }

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

Here is the call graph for this function:

◆ setCellsSelected()

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

Select/Deselect a range of cells.

Definition at line 899 of file TableView.cpp.

900 {
901  QModelIndex top_left = d_model->index(first_row, first_col);
902  QModelIndex bottom_right = d_model->index(last_row, last_col);
903  d_view_widget->selectionModel()->select(QItemSelection(top_left, bottom_right),
904  select ? QItemSelectionModel::SelectCurrent : QItemSelectionModel::Deselect);
905 }

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

Referenced by ApplicationWindow::showTable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setColComment

void Table::setColComment ( int  col,
const QString &  s 
)
slot

Definition at line 650 of file Table.cpp.

651 {
652  column(col)->setComment(s);
653 }

References column(), and AbstractAspect::setComment().

Here is the call graph for this function:

◆ setColComments

void Table::setColComments ( const QStringList &  lst)
slot

Definition at line 1377 of file Table.cpp.

1378 {
1379  if (d_future_table)
1380  for (int i=0; i<d_future_table->columnCount(); i++)
1381  column(i)->setComment(list.at(i));
1382 }

References column(), d_future_table, and AbstractAspect::setComment().

Referenced by ApplicationWindow::openTable(), ApplicationWindow::openTableStatistics(), and restore().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setColName

void Table::setColName ( int  col,
const QString &  text 
)
slot

Definition at line 655 of file Table.cpp.

656 {
657  if (col < 0 || col >= numCols())
658  return;
659 
660  column(col)->setName(text);
661 }

References column(), numCols(), AbstractAspect::setName(), and text().

Referenced by Convolution::addResultCurve(), Correlation::addResultCurve(), and TableStatistics::TableStatistics().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setColPlotDesignation

void Table::setColPlotDesignation ( int  col,
SciDAVis::PlotDesignation  d 
)
slot

Definition at line 1282 of file Table.cpp.

1283 {
1284  column(col)->setPlotDesignation(d);
1285 }

References column(), and Column::setPlotDesignation().

Referenced by Convolution::addResultCurve(), Correlation::addResultCurve(), ImportOPJ::importSpreadsheet(), ApplicationWindow::openTable(), ApplicationWindow::openTableStatistics(), and TableStatistics::TableStatistics().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setColumnForControlTabs()

void TableView::setColumnForControlTabs ( int  col)
protectedinherited

Definition at line 369 of file TableView.cpp.

370 {
371  if (d_table)
372  {
373  if(col < 0 || col >= d_table->columnCount()) return;
374  Column *col_ptr = d_table->column(col);
375 
376  QString str = tr("Current column:\nName: %1\nPosition: %2")\
377  .arg(col_ptr->name()).arg(col+1);
378 
379  ui.name_edit->setText(col_ptr->name());
380  ui.comment_box->document()->setPlainText(col_ptr->comment());
381  ui.type_box->setCurrentIndex(ui.type_box->findData((int)col_ptr->columnMode()));
382  switch(col_ptr->columnMode()) {
383  case SciDAVis::Numeric:
384  {
385  Double2StringFilter * filter = static_cast<Double2StringFilter*>(col_ptr->outputFilter());
386  ui.format_box->setCurrentIndex(ui.format_box->findData(filter->numericFormat()));
387  ui.digits_box->setValue(filter->numDigits());
388  ui.date_time_interval->setVisible(false);
389  ui.date_time_interval_label->setVisible(false);
390  ui.date_time_0->setVisible(false);
391  ui.date_time_0_label->setVisible(false);
392  break;
393  }
394  case SciDAVis::Month:
395  case SciDAVis::Day:
396  case SciDAVis::DateTime:
397  {
398  DateTime2StringFilter * filter = static_cast<DateTime2StringFilter*>(col_ptr->outputFilter());
399  ui.formatLineEdit->setText(filter->format());
400  ui.format_box->setCurrentIndex(ui.format_box->findData(filter->format()));
401  break;
402  }
403  default:
404  ui.date_time_interval->setVisible(false);
405  ui.date_time_interval_label->setVisible(false);
406  ui.date_time_0->setVisible(false);
407  ui.date_time_0_label->setVisible(false);
408  break;
409  }
410  ui.formula_box->setText(col_ptr->formula(0));
411 
412  }
413 }

References Column::columnMode(), AbstractAspect::comment(), TableView::d_table, SciDAVis::DateTime, SciDAVis::Day, DateTime2StringFilter::format(), Column::formula(), SciDAVis::Month, AbstractAspect::name(), Double2StringFilter::numDigits(), SciDAVis::Numeric, Double2StringFilter::numericFormat(), Column::outputFilter(), str, and TableView::ui.

Referenced by TableView::currentColumnChanged(), and TableView::handleHeaderDataChanged().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setColumnType

void Table::setColumnType ( int  col,
SciDAVis::ColumnMode  mode 
)
slot

Definition at line 1340 of file Table.cpp.

1341 {
1342  column(col)->setColumnMode(mode);
1343 }

References column(), and Column::setColumnMode().

Referenced by TableStatistics::TableStatistics().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setColumnTypes [1/2]

void Table::setColumnTypes ( const QStringList &  ctl)
slot

Definition at line 359 of file Table.cpp.

360 {
361 // TODO: obsolete, remove in 0.3.0
362  int n = qMin((int)ctl.count(), numCols());
363  for (int i=0; i<n; i++)
364  {
365  QStringList l = ctl[i].split(";");
366  switch (l[0].toInt())
367  {
368  // old enum: enum ColType{Numeric = 0, Text = 1, Date = 2, Time = 3, Month = 4, Day = 5};
369  case 0:
371  break;
372  case 1:
374  break;
375  case 2:
376  case 3:
377  case 6:
379  break;
380  case 4:
382  break;
383  case 5:
385  break;
386  }
387  }
388 }

References column(), SciDAVis::DateTime, SciDAVis::Day, SciDAVis::Month, numCols(), SciDAVis::Numeric, Column::setColumnMode(), and SciDAVis::Text.

Here is the call graph for this function:

◆ setColumnTypes [2/2]

void Table::setColumnTypes ( QList< int >  ctl)
slot

Definition at line 1310 of file Table.cpp.

1311 {
1312  if (!d_future_table) return;
1313  Q_ASSERT(ctl.size() == d_future_table->columnCount());
1314  for (int i=0; i<d_future_table->columnCount(); i++)
1315  {
1316  switch (ctl.at(i))
1317  {
1318  // old enum: enum ColType{Numeric = 0, Text = 1, Date = 2, Time = 3, Month = 4, Day = 5};
1319  case 0:
1321  break;
1322  case 1:
1324  break;
1325  case 2:
1326  case 3:
1327  case 6:
1329  break;
1330  case 4:
1332  break;
1333  case 5:
1335  break;
1336  }
1337  }
1338 }

References column(), d_future_table, SciDAVis::DateTime, SciDAVis::Day, SciDAVis::Month, SciDAVis::Numeric, Column::setColumnMode(), and SciDAVis::Text.

Referenced by ApplicationWindow::openTable(), ApplicationWindow::openTableStatistics(), and restore().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setColumnWidth()

void TableView::setColumnWidth ( int  col,
int  width 
)
inherited

Definition at line 225 of file TableView.cpp.

226 {
227  d_horizontal_header->resizeSection(col, width);
228 }

References TableView::d_horizontal_header.

Referenced by ImportOPJ::importSpreadsheet().

Here is the caller graph for this function:

◆ setColWidths

void Table::setColWidths ( const QStringList &  widths)
slot

Definition at line 353 of file Table.cpp.

354 {
355  for (int i=0;i<widths.count();i++)
356  d_view_widget->setColumnWidth(i, widths[i].toInt());
357 }

References TableView::d_view_widget.

Referenced by ApplicationWindow::openTable(), ApplicationWindow::openTableStatistics(), and restore().

Here is the caller graph for this function:

◆ setCommand

void Table::setCommand ( int  col,
const QString &  com 
)
slot

Set formula for column col.

Definition at line 415 of file Table.cpp.

416 {
417  column(col)->setFormula(Interval<int>(0, numRows()-1), com.trimmed());
418 }

References column(), numRows(), and Column::setFormula().

Referenced by ApplicationWindow::openTable(), and ApplicationWindow::openTableStatistics().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCommands [1/2]

void Table::setCommands ( const QString &  com)
slot

Set all column formulae.

Definition at line 420 of file Table.cpp.

421 {
422  QStringList lst = com.split("\t");
423  lst.pop_front();
424  setCommands(lst);
425 }

References setCommands().

Here is the call graph for this function:

◆ setCommands [2/2]

void Table::setCommands ( const QStringList &  com)
slot

Set all column formulae.

Definition at line 409 of file Table.cpp.

410 {
411  for(int i=0; i<(int)com.size() && i<numCols(); i++)
412  column(i)->setFormula(Interval<int>(0, numRows()-1), com.at(i).trimmed());
413 }

References column(), numCols(), numRows(), and Column::setFormula().

Referenced by ApplicationWindow::openTable(), ApplicationWindow::openTableStatistics(), restore(), and setCommands().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFolder()

void MyWidget::setFolder ( Folder f)
inlineinherited

Initializes the pointer to the parent folder of the window.

Definition at line 131 of file MyWidget.h.

131 {parentFolder = f;};

References MyWidget::parentFolder.

Referenced by Folder::addWindow(), ApplicationWindow::initBareMultilayerPlot(), ApplicationWindow::initMatrix(), ApplicationWindow::initNote(), ApplicationWindow::initPlot3D(), ApplicationWindow::initTable(), and Folder::removeWindow().

Here is the caller graph for this function:

◆ setHeader

void Table::setHeader ( QStringList  header)
slot

Definition at line 1000 of file Table.cpp.

1001 {
1002  if (!d_future_table) return;
1003  QList<Column*> quarantine;
1004  for (int i=0; i<header.count() && i<d_future_table->columnCount();i++)
1005  quarantine << column(i);
1006  int i = 0;
1007  foreach(Column * col, quarantine) {
1008  d_future_table->removeChild(col, true);
1009  // setting column name while col is still part of table triggers renaming
1010  // to prevent name clashes
1011  col->setName(header.at(i));
1012  i++;
1013  }
1014  d_future_table->appendColumns(quarantine);
1015 }

References column(), columnCount(), d_future_table, and AbstractAspect::setName().

Referenced by ApplicationWindow::openTable(), ApplicationWindow::openTableStatistics(), Fit::parametersTable(), and PlotDialog::showStatistics().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setHeaderColor

void Table::setHeaderColor ( const QColor &  col)
slot

Definition at line 208 of file Table.cpp.

209 {
210  QPalette palette;
211  palette.setColor(QPalette::WindowText, col);
212  d_view_widget->horizontalHeader()->setPalette(palette);
213 }

References TableView::d_view_widget.

Referenced by ApplicationWindow::customTable().

Here is the caller graph for this function:

◆ setHeaderFont

void Table::setHeaderFont ( const QFont &  fnt)
slot

Definition at line 215 of file Table.cpp.

216 {
217  d_view_widget->horizontalHeader()->setFont(fnt);
218 }

References TableView::d_view_widget.

Referenced by ApplicationWindow::customTable().

Here is the caller graph for this function:

◆ setHidden()

void MyWidget::setHidden ( )
virtualinherited

Notifies that a window was hidden by a direct user action.

Definition at line 162 of file MyWidget.cpp.

163 {
164  w_status = Hidden;
165  emit statusChanged (this);
166  hide();
167 }

References MyWidget::Hidden, MyWidget::statusChanged(), and MyWidget::w_status.

Referenced by ApplicationWindow::hideWindow(), and ApplicationWindow::openTemplate().

Here is the caller graph for this function:

◆ setMaximized()

void MyWidget::setMaximized ( )
inherited

Definition at line 183 of file MyWidget.cpp.

184 {
185  showMaximized();
187  emit statusChanged (this);
188 }

References MyWidget::Maximized, MyWidget::statusChanged(), and MyWidget::w_status.

Referenced by ApplicationWindow::folderItemDoubleClicked(), ApplicationWindow::maximizeWindow(), and ApplicationWindow::openTemplate().

Here is the caller graph for this function:

◆ setMinimized()

void MyWidget::setMinimized ( )
inherited

Definition at line 176 of file MyWidget.cpp.

177 {
178  showMinimized();
180  emit statusChanged (this);
181 }

References MyWidget::Minimized, MyWidget::statusChanged(), and MyWidget::w_status.

Referenced by ApplicationWindow::minimizeWindow(), and ApplicationWindow::openTemplate().

Here is the caller graph for this function:

◆ setName()

virtual void Table::setName ( const QString &  s)
inlinevirtual

Set the window name.

Reimplemented from MyWidget.

Definition at line 70 of file Table.h.

70 { if (d_future_table) d_future_table->setName(s); }

References d_future_table.

Referenced by ApplicationWindow::convertMatrixToTable(), ApplicationWindow::newTable(), ApplicationWindow::newTableStatistics(), and TableStatistics::TableStatistics().

Here is the caller graph for this function:

◆ setNormal()

void MyWidget::setNormal ( )
inherited

Definition at line 169 of file MyWidget.cpp.

170 {
171  showNormal();
172  w_status = Normal;
173  emit statusChanged (this);
174 }

References MyWidget::Normal, MyWidget::statusChanged(), and MyWidget::w_status.

Referenced by ApplicationWindow::activateSubWindow(), ApplicationWindow::folderItemDoubleClicked(), and ApplicationWindow::openTemplate().

Here is the caller graph for this function:

◆ setNumCols

void Table::setNumCols ( int  cols)
slot

Definition at line 1183 of file Table.cpp.

1184 {
1185  if (d_future_table)
1186  d_future_table->setColumnCount(cols);
1187 }

References d_future_table.

◆ setNumericPrecision()

void Table::setNumericPrecision ( int  prec)

Sets the number of significant digits.

◆ setNumRows

void Table::setNumRows ( int  rows)
slot

Definition at line 1177 of file Table.cpp.

1178 {
1179  if (d_future_table)
1180  d_future_table->setRowCount(rows);
1181 }

References d_future_table.

◆ setPlotDesignation

void Table::setPlotDesignation ( SciDAVis::PlotDesignation  pd)
slot

Definition at line 342 of file Table.cpp.

343 {
344  if (d_future_table)
345  d_future_table->setSelectionAs(pd);
346 }

References d_future_table.

◆ setStatus()

void MyWidget::setStatus ( Status  s)
inherited

Set the window status flag (hidden, normal, minimized or maximized)

Definition at line 153 of file MyWidget.cpp.

154 {
155  if (w_status == s)
156  return;
157 
158  w_status = s;
159  emit statusChanged (this);
160 }

References MyWidget::statusChanged(), and MyWidget::w_status.

Referenced by ApplicationWindow::changeFolder(), ApplicationWindow::restoreWindowGeometry(), and ApplicationWindow::updateWindowStatus().

Here is the caller graph for this function:

◆ setText

void Table::setText ( int  row,
int  col,
const QString &  text 
)
slot

Definition at line 938 of file Table.cpp.

939 {
940  column(col)->asStringColumn()->setTextAt(row, text);
941 }

References Column::asStringColumn(), column(), ColumnStringIO::setTextAt(), and text().

Referenced by ApplicationWindow::openTable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTextColor

void Table::setTextColor ( const QColor &  col)
slot

Definition at line 196 of file Table.cpp.

197 {
198  QPalette palette;
199  palette.setColor(QPalette::WindowText, col);
200  d_view_widget->setPalette(palette);
201 }

References TableView::d_view_widget.

◆ setTextFont

void Table::setTextFont ( const QFont &  fnt)
slot

Definition at line 203 of file Table.cpp.

204 {
205  d_view_widget->setFont(fnt);
206 }

References TableView::d_view_widget.

Referenced by ApplicationWindow::customTable().

Here is the caller graph for this function:

◆ setWindowLabel()

virtual void Table::setWindowLabel ( const QString &  s)
inlinevirtual

Set the window label.

Reimplemented from MyWidget.

Definition at line 74 of file Table.h.

74 { if (d_future_table) d_future_table->setComment(s); updateCaption(); }

References d_future_table, and MyWidget::updateCaption().

Referenced by ApplicationWindow::convertMatrixToTable(), importASCII(), ApplicationWindow::importASCII(), ImportOPJ::importSpreadsheet(), ApplicationWindow::openTable(), ApplicationWindow::openTableStatistics(), Table(), and TableStatistics::TableStatistics().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ showComments()

void TableView::showComments ( bool  on = true)
inherited

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

Definition at line 355 of file TableView.cpp.

356 {
358  update();
359 }

References TableView::d_horizontal_header, and TableDoubleHeaderView::showComments().

Referenced by ApplicationWindow::customTable(), and TableView::toggleComments().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ showContextMenu

void Table::showContextMenu ( bool  selection)
signal

◆ showControlDescriptionTab

void TableView::showControlDescriptionTab ( )
slotinherited

Definition at line 627 of file TableView.cpp.

628 {
629  d_control_tabs->setVisible(true);
630  d_hide_button->setArrowType(Qt::RightArrow);
631  ui.tab_widget->setCurrentIndex(0);
632  ui.tab_widget->setFocus();
633 }

References TableView::d_control_tabs, TableView::d_hide_button, and TableView::ui.

Referenced by TableView::handleHorizontalHeaderDoubleClicked().

Here is the caller graph for this function:

◆ showControlFormulaTab

void TableView::showControlFormulaTab ( )
slotinherited

Definition at line 643 of file TableView.cpp.

644 {
645  d_control_tabs->setVisible(true);
646  d_hide_button->setArrowType(Qt::RightArrow);
647  ui.tab_widget->setCurrentIndex(2);
648  ui.tab_widget->setFocus();
649 }

References TableView::d_control_tabs, TableView::d_hide_button, and TableView::ui.

◆ showControlTypeTab

void TableView::showControlTypeTab ( )
slotinherited

Definition at line 635 of file TableView.cpp.

636 {
637  d_control_tabs->setVisible(true);
638  d_hide_button->setArrowType(Qt::RightArrow);
639  ui.tab_widget->setCurrentIndex(1);
640  ui.tab_widget->setFocus();
641 }

References TableView::d_control_tabs, TableView::d_hide_button, and TableView::ui.

◆ showTitleBarMenu

void MyWidget::showTitleBarMenu ( )
signalinherited

Emitted when the title bar recieves a QContextMenuEvent.

Referenced by Graph3D::contextMenuEvent(), MyWidget::contextMenuEvent(), and MultiLayer::mousePressEvent().

Here is the caller graph for this function:

◆ status()

Status MyWidget::status ( )
inlineinherited

Return the window status flag (hidden, normal, minimized or maximized)

Definition at line 98 of file MyWidget.h.

98 {return w_status;};

References MyWidget::w_status.

Referenced by ApplicationWindow::changeFolder(), ApplicationWindow::clone(), ApplicationWindow::openTemplate(), ApplicationWindow::showAllFolderWindows(), ApplicationWindow::updateWindowStatus(), and ApplicationWindow::windowGeometryInfo().

Here is the caller graph for this function:

◆ statusChanged

void MyWidget::statusChanged ( MyWidget )
signalinherited

Emitted when the window status changed.

Referenced by MyWidget::changeEvent(), MyWidget::setHidden(), MyWidget::setMaximized(), MyWidget::setMinimized(), MyWidget::setNormal(), and MyWidget::setStatus().

Here is the caller graph for this function:

◆ text

QString Table::text ( int  row,
int  col 
)
slot

Definition at line 931 of file Table.cpp.

932 {
933  Column *colPtr = column(col);
934  if (!colPtr) return QString();
935  return colPtr->asStringColumn()->textAt(row);
936 }

References Column::asStringColumn(), column(), and ColumnStringIO::textAt().

Referenced by FFTDialog::activateCurve(), ApplicationWindow::convertTableToMatrix(), RangeSelectorTool::emitStatusText(), VectorCurve::loadData(), print(), TableStatistics::removeCol(), TableStatistics::renameCol(), setColName(), Convolution::setDataFromTable(), DataPickerTool::setSelection(), FFTDialog::setTable(), and setText().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toggleComments

void TableView::toggleComments ( )
slotinherited

Definition at line 350 of file TableView.cpp.

351 {
353 }

References TableView::areCommentsShown(), and TableView::showComments().

Here is the call graph for this function:

◆ toggleControlTabBar

void TableView::toggleControlTabBar ( )
slotinherited

Definition at line 318 of file TableView.cpp.

319 {
320  d_control_tabs->setVisible(!d_control_tabs->isVisible());
321  if(d_control_tabs->isVisible())
322  d_hide_button->setArrowType(Qt::RightArrow);
323  else
324  d_hide_button->setArrowType(Qt::LeftArrow);
325 }

References TableView::d_control_tabs, and TableView::d_hide_button.

Referenced by TableView::init().

Here is the caller graph for this function:

◆ updateCaption

void MyWidget::updateCaption ( )
protectedslotinherited

Set caption according to current CaptionPolicy, name and label.

Definition at line 52 of file MyWidget.cpp.

53 {
54  switch (caption_policy)
55  {
56  case Name:
57  setWindowTitle(name());
58  break;
59 
60  case Label:
61  if (!windowLabel().isEmpty())
62  setWindowTitle(windowLabel());
63  else
64  setWindowTitle(name());
65  break;
66 
67  case Both:
68  if (!windowLabel().isEmpty())
69  setWindowTitle(name() + " - " + windowLabel());
70  else
71  setWindowTitle(name());
72  break;
73  }
74 };

References MyWidget::Both, MyWidget::caption_policy, MyWidget::Label, MyWidget::Name, MyWidget::name(), and MyWidget::windowLabel().

Referenced by Matrix::handleAspectDescriptionChange(), handleAspectDescriptionChange(), Matrix::setCaptionPolicy(), MyWidget::setCaptionPolicy(), setCaptionPolicy(), MyWidget::setName(), Matrix::setWindowLabel(), MyWidget::setWindowLabel(), and setWindowLabel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateFormatBox

void TableView::updateFormatBox ( )
protectedslotinherited

Definition at line 448 of file TableView.cpp.

449 {
450  int type_index = ui.type_box->currentIndex();
451  if(type_index < 0) return; // should never happen
452  ui.format_box->clear();
453  ui.digits_box->setEnabled(false);
454  ui.formatLineEdit->setEnabled(false);
455  ui.date_time_interval->setEnabled(false);
456  ui.date_time_0->setEnabled(false);
457  switch(ui.type_box->itemData(type_index).toInt())
458  {
459  case SciDAVis::Numeric:
460  ui.digits_box->setEnabled(true);
461  ui.format_box->addItem(tr("Decimal"), QVariant('f'));
462  ui.format_box->addItem(tr("Scientific (e)"), QVariant('e'));
463  ui.format_box->addItem(tr("Scientific (E)"), QVariant('E'));
464  ui.format_box->addItem(tr("Automatic (e)"), QVariant('g'));
465  ui.format_box->addItem(tr("Automatic (E)"), QVariant('G'));
466  break;
467  case SciDAVis::Text:
468  ui.format_box->addItem(tr("Text"), QVariant());
469  break;
470  case SciDAVis::Month:
471  ui.format_box->addItem(tr("Number without leading zero"), QVariant("M"));
472  ui.format_box->addItem(tr("Number with leading zero"), QVariant("MM"));
473  ui.format_box->addItem(tr("Abbreviated month name"), QVariant("MMM"));
474  ui.format_box->addItem(tr("Full month name"), QVariant("MMMM"));
475  break;
476  case SciDAVis::Day:
477  ui.format_box->addItem(tr("Number without leading zero"), QVariant("d"));
478  ui.format_box->addItem(tr("Number with leading zero"), QVariant("dd"));
479  ui.format_box->addItem(tr("Abbreviated day name"), QVariant("ddd"));
480  ui.format_box->addItem(tr("Full day name"), QVariant("dddd"));
481  break;
482  case SciDAVis::DateTime:
483  {
484  // TODO: allow adding of the combo box entries here
485  const char * date_strings[] = {
486  "yyyy-MM-dd",
487  "yyyy/MM/dd",
488  "dd/MM/yyyy",
489  "dd/MM/yy",
490  "dd.MM.yyyy",
491  "dd.MM.yy",
492  "MM/yyyy",
493  "dd.MM.",
494  "yyyyMMdd",
495  0
496  };
497 
498  const char * time_strings[] = {
499  "hh",
500  "hh ap",
501  "hh:mm",
502  "hh:mm ap",
503  "hh:mm:ss",
504  "hh:mm:ss.zzz",
505  "hh:mm:ss:zzz",
506  "mm:ss.zzz",
507  "hhmmss",
508  0
509  };
510  int j,i;
511  for (i=0; date_strings[i] != 0; i++)
512  ui.format_box->addItem(QString(date_strings[i]), QVariant(date_strings[i]));
513  for (j=0; time_strings[j] != 0; j++)
514  ui.format_box->addItem(QString(time_strings[j]), QVariant(time_strings[j]));
515  for (i=0; date_strings[i] != 0; i++)
516  for (j=0; time_strings[j] != 0; j++)
517  ui.format_box->addItem(QString("%1 %2").arg(date_strings[i]).arg(time_strings[j]),
518  QVariant(QString(date_strings[i]) + " " + QString(time_strings[j])));
519  ui.formatLineEdit->setEnabled(true);
520  ui.date_time_interval->setEnabled(true);
521  ui.date_time_0->setEnabled(true);
522  break;
523  }
524  default:
525  ui.format_box->addItem(QString()); // just for savety to have at least one item in any case
526  }
527  ui.format_box->setCurrentIndex(0);
528  ui.digits_box->setVisible(ui.digits_box->isEnabled());
529  ui.digits_label->setVisible(ui.digits_box->isEnabled());
530  ui.formatLineEdit->setVisible(ui.formatLineEdit->isEnabled());
531  ui.format_label2->setVisible(ui.formatLineEdit->isEnabled());
532  if (ui.format_label2->isVisible())
533  ui.format_label->setText(tr("Predefined:"));
534  else
535  ui.format_label->setText(tr("Format:"));
536  ui.date_time_interval->setVisible(ui.date_time_interval->isEnabled());
537  ui.date_time_interval_label->setVisible(ui.date_time_interval->isEnabled());
538  ui.date_time_0->setVisible(ui.date_time_0->isEnabled());
539  ui.date_time_0_label->setVisible(ui.date_time_0->isEnabled());
540 }

References SciDAVis::DateTime, SciDAVis::Day, SciDAVis::Month, SciDAVis::Numeric, SciDAVis::Text, and TableView::ui.

Referenced by TableView::init().

Here is the caller graph for this function:

◆ updateFunctionDoc

void Table::updateFunctionDoc ( )
protectedslot

Definition at line 1420 of file Table.cpp.

1421 {
1422  ui.add_function_combobox->setToolTip(scriptEnv->mathFunctionDoc(ui.add_function_combobox->currentText()));
1423 }

References ScriptingEnv::mathFunctionDoc(), scripted::scriptEnv, and TableView::ui.

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateTypeInfo

void TableView::updateTypeInfo ( )
protectedslotinherited

Definition at line 542 of file TableView.cpp.

543 {
544  int format_index = ui.format_box->currentIndex();
545  int type_index = ui.type_box->currentIndex();
546 
547  QString str = tr("Selected column type:\n");
548  if(format_index >= 0 && type_index >= 0)
549  {
550  int type = ui.type_box->itemData(type_index).toInt();
551  switch(type)
552  {
553  case SciDAVis::Numeric:
554  str += tr("Double precision\nfloating point values\n");
555  ui.digits_box->setEnabled(true);
556  break;
557  case SciDAVis::Text:
558  str += tr("Text\n");
559  break;
560  case SciDAVis::Month:
561  str += tr("Month names\n");
562  break;
563  case SciDAVis::Day:
564  str += tr("Days of the week\n");
565  break;
566  case SciDAVis::DateTime:
567  str += tr("Dates and/or times\n");
568  ui.formatLineEdit->setEnabled(true);
569  break;
570  }
571  str += tr("Example: ");
572  switch(type)
573  {
574  case SciDAVis::Numeric:
575  str += QString::number(123.1234567890123456, ui.format_box->itemData(format_index).toChar().toLatin1(), ui.digits_box->value());
576  break;
577  case SciDAVis::Text:
578  str += tr("Hello world!\n");
579  break;
580  case SciDAVis::Month:
581  str += QLocale().toString(QDate(1900,1,1), ui.format_box->itemData(format_index).toString());
582  break;
583  case SciDAVis::Day:
584  str += QLocale().toString(QDate(1900,1,1), ui.format_box->itemData(format_index).toString());
585  break;
586  case SciDAVis::DateTime:
587  ui.formatLineEdit->setText(ui.format_box->itemData(format_index).toString());
588  ui.date_time_0->setDisplayFormat(ui.format_box->itemData(format_index).toString());
589  str += QDateTime(QDate(1900,1,1), QTime(23,59,59,999)).toString(ui.formatLineEdit->text());
590  break;
591  }
592  } else if (format_index == -1 && type_index >= 0 && ui.type_box->itemData(type_index).toInt() == SciDAVis::DateTime) {
593  str += tr("Dates and/or times\n");
594  ui.formatLineEdit->setEnabled(true);
595  str += tr("Example: ");
596  str += QDateTime(QDate(1900,1,1), QTime(23,59,59,999)).toString(ui.formatLineEdit->text());
597  }
598 
599 
600  ui.type_info->setText(str);
601  ui.digits_box->setVisible(ui.digits_box->isEnabled());
602  ui.digits_label->setVisible(ui.digits_box->isEnabled());
603  ui.formatLineEdit->setVisible(ui.formatLineEdit->isEnabled());
604  ui.format_label2->setVisible(ui.formatLineEdit->isEnabled());
605  if (ui.format_label2->isVisible())
606  ui.format_label->setText(tr("Predefined:"));
607  else
608  ui.format_label->setText(tr("Format:"));
609  }

References SciDAVis::DateTime, SciDAVis::Day, SciDAVis::Month, SciDAVis::Numeric, str, SciDAVis::Text, and TableView::ui.

Referenced by TableView::init().

Here is the caller graph for this function:

◆ verticalHeaderWidth

int Table::verticalHeaderWidth ( )
slot

Definition at line 1358 of file Table.cpp.

1359 {
1360  return d_view_widget->verticalHeader()->width();
1361 }

References TableView::d_view_widget.

Referenced by ApplicationWindow::importASCII(), and ImportOPJ::importSpreadsheet().

Here is the caller graph for this function:

◆ windowLabel()

virtual QString Table::windowLabel ( )
inlinevirtual

Return the window label.

Reimplemented from MyWidget.

Definition at line 72 of file Table.h.

72 { return d_future_table? d_future_table->comment(): QString(); }

References d_future_table.

Referenced by TableStatistics::saveToString().

Here is the caller graph for this function:

◆ YColumns

QStringList Table::YColumns ( )
slot

Definition at line 675 of file Table.cpp.

676 {
677 // TODO for 0.3.0: Column * list
678  QStringList names;
679  for (int i=0;i<numCols();i++)
680  {
681  if(column(i)->plotDesignation() == SciDAVis::Y)
682  names << name() + "_" + column(i)->name();
683  }
684  return names;
685 }

References column(), name(), AbstractAspect::name(), numCols(), Column::plotDesignation(), and SciDAVis::Y.

Referenced by ApplicationWindow::plotFile().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ askOnClose

bool MyWidget::askOnClose
protectedinherited

Toggle on/off: Ask the user "delete, hide, or cancel?" on a close event.

Definition at line 175 of file MyWidget.h.

Referenced by MyWidget::askOnCloseEvent(), Matrix::closeEvent(), MyWidget::closeEvent(), closeEvent(), and MyWidget::MyWidget().

◆ birthdate

QString MyWidget::birthdate
protectedinherited

The creation date.

Definition at line 166 of file MyWidget.h.

Referenced by MyWidget::birthDate(), init(), Matrix::init(), Matrix::setBirthDate(), MyWidget::setBirthDate(), and setBirthDate().

◆ caption_policy

CaptionPolicy MyWidget::caption_policy
protectedinherited

◆ d_control_tabs

◆ d_delegate

TableItemDelegate* TableView::d_delegate
protectedinherited

Pointer to the item delegate.

Definition at line 218 of file TableView.h.

Referenced by TableView::init().

◆ d_future_table

QPointer<future::Table> Table::d_future_table

◆ d_hide_button

QToolButton* TableView::d_hide_button
protectedinherited

◆ d_horizontal_header

◆ d_main_layout

QHBoxLayout* TableView::d_main_layout
protectedinherited

Definition at line 236 of file TableView.h.

Referenced by TableView::init().

◆ d_model

◆ d_stored_column_labels

QHash<const AbstractAspect *, QString> Table::d_stored_column_labels
private

Definition at line 283 of file Table.h.

Referenced by handleAspectDescriptionAboutToChange(), and handleAspectDescriptionChange().

◆ d_table

◆ d_view_widget

◆ parentFolder

Folder* MyWidget::parentFolder
protectedinherited

Pointer to the parent folder of the window.

Definition at line 159 of file MyWidget.h.

Referenced by MyWidget::folder(), and MyWidget::setFolder().

◆ scriptEnv

◆ ui

◆ w_label

QString MyWidget::w_label
protectedinherited

The window label.

See also
setWindowLabel(), windowLabel(), setCaptionPolicy()

Definition at line 164 of file MyWidget.h.

Referenced by MyWidget::MyWidget(), MyWidget::setWindowLabel(), and MyWidget::windowLabel().

◆ w_status


The documentation for this class was generated from the following files:
AsciiTableImportFilter::set_separator
void set_separator(const QString &value)
Definition: AsciiTableImportFilter.h:73
Table::handleChange
void handleChange()
Definition: Table.cpp:153
AbstractFilter::input
bool input(int port, const AbstractColumn *source)
Connect the provided data source to the specified input port.
Definition: AbstractFilter.cpp:31
Table::Numeric
@ Numeric
Definition: Table.h:57
Table::saveCommands
QString saveCommands()
Definition: Table.cpp:516
MyWidget::Label
@ Label
caption detemined by the window label
Definition: MyWidget.h:70
Table::column
Column * column(int index) const
Return column number 'index'.
Definition: Table.h:121
Table::text
QString text(int row, int col)
Definition: Table.cpp:931
Table::Text
@ Text
Definition: Table.h:57
Table::Date
@ Date
Definition: Table.h:57
ScriptingChangeEvent::scriptingEnv
ScriptingEnv * scriptingEnv() const
Definition: Script.h:136
ScriptingEnv::newScript
virtual Script * newScript(const QString &, QObject *, const QString &)=0
Instantiate the Script subclass matching the ScriptEnv subclass.
MyWidget::caption_policy
CaptionPolicy caption_policy
The caption policy.
Definition: MyWidget.h:173
MyWidget::Maximized
@ Maximized
Definition: MyWidget.h:73
Table::columnCount
int columnCount()
Definition: Table.cpp:902
Column::asStringColumn
ColumnStringIO * asStringColumn() const
Return a wrapper column object used for String I/O.
Definition: Column.h:166
TableView::d_hide_button
QToolButton * d_hide_button
Button to toogle the visibility of #d_tool_box.
Definition: TableView.h:235
Table::DateTime
@ DateTime
Definition: Table.h:57
ScriptEdit
Editor widget with support for evaluating expressions and executing code.
Definition: ScriptEdit.h:50
MyWidget::parentFolder
Folder * parentFolder
Pointer to the parent folder of the window.
Definition: MyWidget.h:159
scripted::scriptEnv
ScriptingEnv * scriptEnv
Definition: Script.h:155
Table::setColumnTypes
void setColumnTypes(QList< int > ctl)
Definition: Table.cpp:1310
ScriptingEnv::incref
void incref()
Increase the reference count. This should only be called by scripted and Script to avoid memory leaks...
Definition: ScriptingEnv.cpp:60
SciDAVis::yErr
@ yErr
y errors
Definition: globals.h:61
Column::outputFilter
AbstractSimpleFilter * outputFilter() const
Return the output filter (for data type -> string conversion)
Definition: Column.cpp:593
MyWidget::statusChanged
void statusChanged(MyWidget *)
Emitted when the window status changed.
TableView::firstSelectedColumn
int firstSelectedColumn(bool full=false)
Return the index of the first selected column.
Definition: TableView.cpp:802
TableModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: TableModel.cpp:143
Table::recalculate
bool recalculate()
Recalculate selected cells.
Definition: Table.cpp:427
Table::colLabel
QString colLabel(int col)
Definition: Table.cpp:1272
DateTime2StringFilter::setFormat
void setFormat(const QString &format)
Set the format string to be used for conversion.
Definition: DateTime2StringFilter.cpp:35
SciDAVis::xErr
@ xErr
x errors
Definition: globals.h:60
MyWidget::Normal
@ Normal
Definition: MyWidget.h:73
str
#define str(x)
Definition: PythonScripting.cpp:41
AbstractFilter
Base class for all analysis operations.
Definition: AbstractFilter.h:77
SciDAVis::Y
@ Y
y values
Definition: globals.h:58
Table::handleColumnsAboutToBeRemoved
void handleColumnsAboutToBeRemoved(int, int)
Definition: Table.cpp:171
TableView::d_horizontal_header
TableDoubleHeaderView * d_horizontal_header
Definition: TableView.h:237
AbstractAspect::setComment
void setComment(const QString &value)
Definition: AbstractAspect.cpp:265
MyWidget::Minimized
@ Minimized
Definition: MyWidget.h:73
SciDAVis::noDesignation
@ noDesignation
no plot designation
Definition: globals.h:56
MyWidget::showTitleBarMenu
void showTitleBarMenu()
Emitted when the title bar recieves a QContextMenuEvent.
ScriptingEnv::decref
void decref()
Decrease the reference count. This should only be called by scripted and Script to avoid segfaults.
Definition: ScriptingEnv.cpp:65
Table::setWindowLabel
virtual void setWindowLabel(const QString &s)
Set the window label.
Definition: Table.h:74
MyWidget::windowLabel
virtual QString windowLabel()
Return the window label.
Definition: MyWidget.h:76
Table::handleColumnChange
void handleColumnChange(int, int)
Definition: Table.cpp:158
Double2StringFilter::numericFormat
char numericFormat() const
Get format character as in QString::number.
Definition: Double2StringFilter.h:50
Table::addFunction
void addFunction()
Definition: Table.cpp:1410
future::Table
Aspect providing a spreadsheet table with column logic.
Definition: future_Table.h:86
TableView::lastSelectedColumn
int lastSelectedColumn(bool full=false)
Return the index of the last selected column.
Definition: TableView.cpp:816
TableModel::index
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Definition: TableModel.cpp:187
Table::applyFormula
void applyFormula()
Definition: Table.cpp:1389
AsciiTableImportFilter::importAspect
virtual AbstractAspect * importAspect(QIODevice &input)
Import an object from the specified device and convert it to an Aspect.
Definition: AsciiTableImportFilter.cpp:158
Column
Aspect that manages a column.
Definition: Column.h:59
IntervalAttribute< bool >
A class representing an interval-based attribute (bool version)
Definition: IntervalAttribute.h:198
TableView::showComments
void showComments(bool on=true)
Show or hide (if on = false) the column comments.
Definition: TableView.cpp:355
Double2DateTimeFilter
Conversion filter double -> QDateTime.
Definition: Double2DateTimeFilter.h:46
MyWidget::birthdate
QString birthdate
The creation date.
Definition: MyWidget.h:166
DateTime2StringFilter
Conversion filter QDateTime -> QString.
Definition: DateTime2StringFilter.h:41
MyWidget::name
virtual QString name()
Return the window name.
Definition: MyWidget.h:81
SCRIPTING_CHANGE_EVENT
#define SCRIPTING_CHANGE_EVENT
Definition: customevents.h:40
Table::d_future_table
QPointer< future::Table > d_future_table
Definition: Table.h:55
Table::aboutToRemoveCol
void aboutToRemoveCol(const QString &)
Table::handleRowChange
void handleRowChange()
Definition: Table.cpp:183
Table::removedCol
void removedCol(const QString &)
Column::formulaIntervals
QList< Interval< int > > formulaIntervals() const override
Return the intervals that have associated formulas.
Definition: Column.cpp:633
Double2StringFilter::setNumDigits
void setNumDigits(int digits)
Set number of displayed digits.
Definition: Double2StringFilter.cpp:69
Double2DateTimeFilter::Minute
@ Minute
Definition: Double2DateTimeFilter.h:50
Column::setColumnMode
void setColumnMode(SciDAVis::ColumnMode mode, AbstractFilter *conversion_filter=0) override
Set the column mode.
Definition: Column.cpp:85
Table::setCommands
void setCommands(const QStringList &com)
Set all column formulae.
Definition: Table.cpp:409
Table::saveHeader
QString saveHeader()
Definition: Table.cpp:610
Table::columnWidth
int columnWidth(int col)
Definition: Table.cpp:348
Double2DateTimeFilter::Month
@ Month
Definition: Double2DateTimeFilter.h:50
Double2DateTimeFilter::Hour
@ Hour
Definition: Double2DateTimeFilter.h:50
Column::setPlotDesignation
void setPlotDesignation(SciDAVis::PlotDesignation pd)
Set the column plot designation.
Definition: Column.cpp:136
Column::setFormula
void setFormula(Interval< int > i, QString formula)
Set a formula string for an interval of rows.
Definition: Column.cpp:182
Table::addReference
void addReference()
Definition: Table.cpp:1415
SciDAVis::ColumnMode
ColumnMode
The column mode (defines output and input filter for table columns)
Definition: globals.h:66
Column::isInvalid
bool isInvalid(int row) const override
Return whether a certain row contains an invalid value
Definition: Column.cpp:598
TableView::d_control_tabs
QWidget * d_control_tabs
Widget that contains the control tabs UI from ui.
Definition: TableView.h:233
TableView::d_table
QPointer< future::Table > d_table
Definition: TableView.h:238
scripted::scriptingChangeEvent
void scriptingChangeEvent(ScriptingChangeEvent *)
Definition: Script.cpp:119
Table::saveComments
QString saveComments()
Definition: Table.cpp:531
MyWidget::modifiedWindow
void modifiedWindow(MyWidget *)
Column::rowCount
int rowCount() const override
Return the data vector size.
Definition: Column.cpp:583
AbstractAspect::endMacro
void endMacro()
End the undo stack macro.
Definition: AbstractAspect.cpp:222
TableDoubleHeaderView::areCommentsShown
bool areCommentsShown() const
Return whether comments are show currently.
Definition: TableDoubleHeaderView.cpp:102
TableView::selectAll
void selectAll()
Definition: TableView.cpp:308
AbstractAspect::beginMacro
void beginMacro(const QString &text)
Begin an undo stack macro (series of commands)
Definition: AbstractAspect.cpp:215
Table::Time
@ Time
Definition: Table.h:57
TableView::selectedRowCount
int selectedRowCount(bool full=false)
Return how many rows are (at least partly) selected.
Definition: TableView.cpp:782
TableView::TableView
TableView(future::Table *table)
Constructor.
Definition: TableView.cpp:64
TableView::isRowSelected
bool isRowSelected(int row, bool full=false)
Returns true if row 'row' is selected; otherwise false.
Definition: TableView.cpp:794
Table::name
virtual QString name()
Return the window name.
Definition: Table.h:68
IntervalAttribute< bool >::setValue
void setValue(Interval< int > i, bool value=true)
Definition: IntervalAttribute.h:210
Table::numCols
int numCols()
Definition: Table.cpp:892
Table::rowCount
int rowCount()
Definition: Table.cpp:897
ColumnStringIO::textAt
virtual QString textAt(int row) const
Return the content of row 'row'.
Definition: Column.cpp:644
TableView::selectedColumnCount
int selectedColumnCount(bool full=false)
Return how many columns are selected.
Definition: TableView.cpp:738
Double2StringFilter::setNumericFormat
void setNumericFormat(char format)
Set format character as in QString::number.
Definition: Double2StringFilter.cpp:64
Table::importV0x0001XXHeader
void importV0x0001XXHeader(QStringList header)
Definition: Table.cpp:943
SciDAVis::Month
@ Month
column contains month names
Definition: globals.h:69
TableView::isColumnSelected
bool isColumnSelected(int col, bool full=false)
Returns true if column 'col' is selected; otherwise false.
Definition: TableView.cpp:762
Double2DateTimeFilter::Second
@ Second
Definition: Double2DateTimeFilter.h:50
TableDoubleHeaderView::showComments
void showComments(bool on=true)
Show or hide (if on = false) the column comments.
Definition: TableDoubleHeaderView.cpp:107
AbstractSimpleFilter::output
virtual AbstractColumn * output(int port)
Return a pointer to d_output_column on port 0 (don't override unless you really know what you are doi...
Definition: AbstractSimpleFilter.cpp:115
AbstractAspect::name
QString name() const
Definition: AbstractAspect.cpp:229
Column::columnMode
SciDAVis::ColumnMode columnMode() const override
Return the column mode.
Definition: Column.cpp:579
Table::setColWidths
void setColWidths(const QStringList &widths)
Definition: Table.cpp:353
TableView::retranslateStrings
void retranslateStrings()
Definition: TableView.cpp:260
MyWidget::w_status
Status w_status
The window status.
Definition: MyWidget.h:168
Table::saveColumnTypes
QString saveColumnTypes()
Definition: Table.cpp:400
Column::insertRows
void insertRows(int before, int count) override
Insert some empty (or initialized with zero) rows.
Definition: Column.cpp:124
MyWidget::Name
@ Name
caption determined by the window name
Definition: MyWidget.h:69
Script
A chunk of scripting code. Abstract.
Definition: Script.h:53
TableModel::activateFormulaMode
void activateFormulaMode(bool on)
Definition: TableModel.h:90
SciDAVis::Text
@ Text
column contains strings
Definition: globals.h:68
FitData::p
size_t p
Definition: fit_gsl.h:44
FitData::n
size_t n
Definition: fit_gsl.h:43
MyWidget::Hidden
@ Hidden
Definition: MyWidget.h:73
AbstractAspect::parentAspect
AbstractAspect * parentAspect() const
Return my parent Aspect or 0 if I currently don't have one.
Definition: AbstractAspect.cpp:109
Table::colName
QString colName(int col)
Definition: Table.cpp:765
Column::replaceValues
virtual void replaceValues(int first, const QVector< qreal > &new_values) override
Replace a range of values.
Definition: Column.cpp:234
SciDAVis::DateTime
@ DateTime
column contains dates and/or times
Definition: globals.h:71
Column::formula
QString formula(int row) const override
Return the formula associated with row 'row'
Definition: Column.cpp:628
DateTime2StringFilter::format
QString format() const
Return the format string.
Definition: DateTime2StringFilter.h:55
Table::setColComments
void setColComments(const QStringList &lst)
Definition: Table.cpp:1377
Double2StringFilter::numDigits
int numDigits() const
Get number of displayed digits.
Definition: Double2StringFilter.h:52
Table::d_stored_column_labels
QHash< const AbstractAspect *, QString > d_stored_column_labels
Definition: Table.h:283
Double2DateTimeFilter::Millisecond
@ Millisecond
Definition: Double2DateTimeFilter.h:50
Column::plotDesignation
SciDAVis::PlotDesignation plotDesignation() const override
Return the column plot designation.
Definition: Column.cpp:588
ScriptingChangeEvent
notify an object that it should update its scripting environment (see class scripted)
Definition: Script.h:133
TableView::areCommentsShown
bool areCommentsShown() const
Return whether comments are show currently.
Definition: TableView.cpp:345
Table::init
void init()
Definition: Table.cpp:96
scripted::scripted
scripted(ScriptingEnv *env)
Definition: Script.cpp:108
AbstractAspect::setName
void setName(const QString &value)
Definition: AbstractAspect.cpp:234
TableView::selectedColumns
QList< Column * > selectedColumns(bool full=false)
Return all selected columns.
Definition: TableView.cpp:770
Table::Month
@ Month
Definition: Table.h:57
String2DoubleFilter
Locale-aware conversion filter QString -> double.
Definition: String2DoubleFilter.h:40
AbstractAspect::comment
QString comment() const
Definition: AbstractAspect.cpp:260
MyWidget::Both
@ Both
caption = "name - label"
Definition: MyWidget.h:71
TableView::firstSelectedRow
int firstSelectedRow(bool full=false)
Return the index of the first selected row.
Definition: TableView.cpp:827
TableView::lastSelectedRow
int lastSelectedRow(bool full=false)
Return the index of the last selected row.
Definition: TableView.cpp:841
Table::Day
@ Day
Definition: Table.h:57
ScriptingEnv::mathFunctions
virtual const QStringList mathFunctions() const
Return a list of supported mathematical functions. These should be imported into the global namespace...
Definition: ScriptingEnv.h:72
ScriptingEnv::mathFunctionDoc
virtual const QString mathFunctionDoc(const QString &) const
Return a documentation string for the given mathematical function.
Definition: ScriptingEnv.h:74
future::Table::columnCount
int columnCount() const
Return the total number of columns in the table.
Definition: future_Table.cpp:248
IntervalAttribute< bool >::intervals
QList< Interval< int > > intervals() const
Definition: IntervalAttribute.h:292
Double2DateTimeFilter::UnitInterval
UnitInterval
Definition: Double2DateTimeFilter.h:50
ColumnStringIO::setTextAt
virtual void setTextAt(int row, const QString &value)
Definition: Column.cpp:652
AsciiTableImportFilter
Import an ASCII file as Table.
Definition: AsciiTableImportFilter.h:52
Column::copy
bool copy(const AbstractColumn *other) override
Copy another column of the same type.
Definition: Column.cpp:108
AbstractAspect::remove
virtual void remove()
Remove me from my parent's list of children.
Definition: AbstractAspect.h:250
Table::colNames
QStringList colNames()
Definition: Table.cpp:1263
SciDAVis::Z
@ Z
z values
Definition: globals.h:59
ColumnStringIO::replaceTexts
virtual void replaceTexts(int start_row, const QStringList &texts)
Set the content of row 'row'.
Definition: Column.cpp:677
Script::eval
virtual QVariant eval()
Evaluate the Code, returning QVariant() on an error / exception.
Definition: Script.cpp:96
future::Table::column
Column * column(int index) const
Return column number 'index'.
Definition: future_Table.cpp:129
TableViewWidget::selectAll
void selectAll()
Definition: TableView.cpp:988
TableModel::formulaModeActive
bool formulaModeActive() const
Definition: TableModel.h:91
Table::modifiedData
void modifiedData(Table *, const QString &)
SciDAVis::X
@ X
x values
Definition: globals.h:57
MyWidget::hiddenWindow
void hiddenWindow(MyWidget *)
Emitted when the window was hidden.
TableView::showControlDescriptionTab
void showControlDescriptionTab()
Definition: TableView.cpp:627
SciDAVis::Day
@ Day
column containts day of week names
Definition: globals.h:70
Table::handleAspectDescriptionAboutToChange
void handleAspectDescriptionAboutToChange(const AbstractAspect *aspect)
Definition: Table.cpp:1425
Table::print
void print()
Definition: Table.cpp:225
SciDAVis::Numeric
@ Numeric
column contains doubles
Definition: globals.h:67
Table::colIndex
int colIndex(const QString &name)
Definition: Table.cpp:1017
ColumnStringIO::copy
virtual bool copy(const AbstractColumn *other)
Copy another column of the same type.
Definition: Column.cpp:661
TableView::handleHorizontalSectionResized
void handleHorizontalSectionResized(int logicalIndex, int oldSize, int newSize)
Definition: TableView.cpp:235
MyWidget::askOnClose
bool askOnClose
Toggle on/off: Ask the user "delete, hide, or cancel?" on a close event.
Definition: MyWidget.h:175
String2DateTimeFilter
Conversion filter QString -> QDateTime.
Definition: String2DateTimeFilter.h:48
Script::setInt
virtual bool setInt(int, const char *)
Definition: Script.h:94
Table::saveColumnWidths
QString saveColumnWidths()
Definition: Table.cpp:390
Table::changedColHeader
void changedColHeader(const QString &, const QString &)
Interval< int >
MyWidget::updateCaption
void updateCaption()
Set caption according to current CaptionPolicy, name and label.
Definition: MyWidget.cpp:52
Column::textAt
QString textAt(int row) const override
Return the content of row 'row'.
Definition: Column.cpp:240
Double2DateTimeFilter::Day
@ Day
Definition: Double2DateTimeFilter.h:50
Table::handleColumnsRemoved
void handleColumnsRemoved(int, int)
Definition: Table.cpp:177
TableView::selectedRows
IntervalAttribute< bool > selectedRows(bool full=false)
Get the complete set of selected rows.
Definition: TableView.cpp:852
Column::valueAt
double valueAt(int row) const override
Return the double value in row 'row'.
Definition: Column.cpp:260
Column::setTextAt
void setTextAt(int row, const QString &new_value)
Set the content of row 'row'.
Definition: Column.cpp:197
Double2StringFilter
Locale-aware conversion filter double -> QString.
Definition: Double2StringFilter.h:39
MyWidget::changeEvent
virtual void changeEvent(QEvent *event)
Definition: MyWidget.cpp:129
MyWidget::aspect
QString aspect()
Return the window status as a string.
Definition: MyWidget.cpp:106
TableView::d_model
TableModel * d_model
Pointer to the current underlying model.
Definition: TableView.h:220
AbstractAspect
Base class of all persistent objects in a Project.
Definition: AbstractAspect.h:86
Double2DateTimeFilter::Year
@ Year
Definition: Double2DateTimeFilter.h:50
Column::setDateTimeAt
void setDateTimeAt(int row, const QDateTime &new_value)
Set the content of row 'row'.
Definition: Column.cpp:218
Script::compile
virtual bool compile(bool for_eval=true)
Compile the Code. Return true if the implementation doesn't support compilation.
Definition: Script.cpp:90
TableView::ui
Ui::ControlTabs ui
UI with options tabs (description, format, formula etc.)
Definition: TableView.h:229
Table::handleAspectDescriptionChange
void handleAspectDescriptionChange(const AbstractAspect *aspect)
Definition: Table.cpp:1434
Column::setValueAt
void setValueAt(int row, double new_value)
Set the content of row 'row'.
Definition: Column.cpp:229
Table::numRows
int numRows()
Definition: Table.cpp:887
Table::updateFunctionDoc
void updateFunctionDoc()
Definition: Table.cpp:1420
TableView::d_view_widget
TableViewWidget * d_view_widget
The table view (first part of the UI)
Definition: TableView.h:231
TableView::setColumnForControlTabs
void setColumnForControlTabs(int col)
Definition: TableView.cpp:369
Column::setInvalid
void setInvalid(Interval< int > i, bool invalid=true)
Set an interval invalid or valid.
Definition: Column.cpp:162