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)  

TableView Class Reference

View class for Table. More...

#include <TableView.h>

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

Public Types

enum  CaptionPolicy { Name = 0, Label = 1, Both = 2 }
 Possible window captions. More...
 
enum  Status { Hidden = -1, Normal = 0, Minimized = 1, Maximized = 2 }
 

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

 TableView (future::Table *table)
 Constructor. More...
 
virtual ~TableView ()
 Destructor. More...
 
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 QString windowLabel ()
 Return the window label. More...
 
virtual void setWindowLabel (const QString &s)
 Set the window label. More...
 
virtual QString name ()
 Return the window name. More...
 
virtual void setName (const QString &s)
 Set the window name. More...
 
virtual CaptionPolicy captionPolicy ()
 Return the caption policy. More...
 
virtual void setCaptionPolicy (CaptionPolicy policy)
 Set the caption policy. More...
 
virtual QString birthDate ()
 Return the creation date. More...
 
virtual void setBirthDate (const QString &s)
 Set 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 QString saveAsTemplate (const QString &)
 
virtual void restore (const QStringList &)
 Not implemented yet. More...
 
virtual void print ()
 
virtual void exportPDF (const QString &)
 
virtual QString saveToString (const QString &)
 
virtual void setHidden ()
 Notifies that a window was hidden by a direct user action. More...
 
void closeEvent (QCloseEvent *)
 Close event handler. 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 ()
 

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...
 

selection related functions

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
 
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 ()
 
virtual void changeEvent (QEvent *event)
 
void retranslateStrings ()
 
void setColumnForControlTabs (int col)
 
bool eventFilter (QObject *watched, QEvent *event)
 
void init ()
 Initialization. More...
 

Detailed Description

View class for Table.

Definition at line 88 of file TableView.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  };

◆ 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

◆ TableView()

TableView::TableView ( future::Table table)

Constructor.

File : TableView.cpp Project : SciDAVis

Description : View class for Table

Copyright : (C) 2007 Tilman Benkert (thzs*gmx.net) (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 64 of file TableView.cpp.

65  : d_table(table)
66 #else
67 TableView::TableView(const QString& label, QWidget* parent, const QString name, Qt::WindowFlags f)
68  : MyWidget(label, parent, name, f)
69 #endif
70 {
71 #ifndef LEGACY_CODE_0_2_x
72  d_model = new TableModel(table);
73  init();
74 #else
75  d_model = NULL;
76 #endif
77 }

References d_model, and init().

Here is the call graph for this function:

◆ ~TableView()

TableView::~TableView ( )
virtual

Destructor.

Definition at line 79 of file TableView.cpp.

80 {
81  delete d_model;
82 }

References d_model.

Member Function Documentation

◆ activateFormulaMode

void TableView::activateFormulaMode ( bool  on)
slot

Definition at line 958 of file TableView.cpp.

959 {
961 }

References TableModel::activateFormulaMode(), and d_model.

Here is the call graph for this function:

◆ advanceCell

void TableView::advanceCell ( )
protectedslot

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 d_table, and d_view_widget.

Referenced by init().

Here is the caller graph for this function:

◆ applyDescription

void TableView::applyDescription ( )
protectedslot

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 d_table, d_view_widget, and ui.

Referenced by init().

Here is the caller graph for this function:

◆ applyType

void TableView::applyType ( )
protectedslot

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(), selectedColumns(), Column::setColumnMode(), DateTime2StringFilter::setFormat(), Double2StringFilter::setNumDigits(), Double2StringFilter::setNumericFormat(), SciDAVis::Text, and ui.

Referenced by init().

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

◆ areCommentsShown()

bool TableView::areCommentsShown ( ) const

Return whether comments are show currently.

Definition at line 345 of file TableView.cpp.

346 {
348 }

References TableDoubleHeaderView::areCommentsShown(), and d_horizontal_header.

Referenced by Table::commentsEnabled(), and 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(), handleAspectAdded(), Table::handleAspectDescriptionAboutToChange(), Matrix::handleAspectDescriptionChange(), Table::handleAspectDescriptionChange(), 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:

◆ changeEvent()

void TableView::changeEvent ( QEvent *  event)
protectedvirtual

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 retranslateStrings().

Here is the call graph for this function:

◆ 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 MyWidget::closeEvent ( QCloseEvent *  e)
inherited

Close event handler.

Ask the user "delete, hide, or cancel?" if the "ask on close" flag is set.

Definition at line 76 of file MyWidget.cpp.

77 {
78 if (askOnClose)
79  {
80  switch( QMessageBox::information(this,tr("SciDAVis"),
81  tr("Do you want to hide or delete") + "<p><b>'" + objectName() + "'</b> ?",
82  tr("Delete"), tr("Hide"), tr("Cancel"), 0,2))
83  {
84  case 0:
85  emit closedWindow(this);
86  e->accept();
87  break;
88 
89  case 1:
90  e->ignore();
91  emit hiddenWindow(this);
92  break;
93 
94  case 2:
95  e->ignore();
96  break;
97  }
98  }
99 else
100  {
101  emit closedWindow(this);
102  e->accept();
103  }
104 }

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

◆ columnWidth()

int TableView::columnWidth ( int  col) const

Definition at line 230 of file TableView.cpp.

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

References d_horizontal_header.

◆ 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().

◆ currentColumnChanged

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

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 d_table, and setColumnForControlTabs().

Referenced by init().

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

◆ deselectAll

void TableView::deselectAll ( )
slot

Definition at line 313 of file TableView.cpp.

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

References d_view_widget.

Referenced by ApplicationWindow::showTable().

Here is the caller graph for this function:

◆ eventFilter()

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

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 d_horizontal_header, d_model, d_table, d_view_widget, TableModel::index(), isColumnSelected(), and TableModel::rowCount().

Here is the call graph for this function:

◆ exportPDF()

virtual void MyWidget::exportPDF ( const QString &  )
inlinevirtualinherited

Reimplemented in MultiLayer, Note, and Graph3D.

Definition at line 108 of file MyWidget.h.

108 {};

◆ firstSelectedColumn()

int TableView::firstSelectedColumn ( bool  full = false)

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 d_table, and isColumnSelected().

Referenced by Table::applyFormula(), ApplicationWindow::plot3DBars(), ApplicationWindow::plot3DRibbon(), ApplicationWindow::plot3DScatter(), ApplicationWindow::plot3DTrajectory(), Table::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)

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 d_table, and isRowSelected().

Referenced by Table::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:

◆ 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

Definition at line 953 of file TableView.cpp.

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

References d_model, and TableModel::formulaModeActive().

Here is the call graph for this function:

◆ getCurrentCell()

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

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 d_view_widget.

◆ goToCell

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

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 d_model, d_view_widget, and TableModel::index().

Here is the call graph for this function:

◆ goToNextColumn

void TableView::goToNextColumn ( )
slot

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 d_table, and d_view_widget.

Referenced by init().

Here is the caller graph for this function:

◆ goToPreviousColumn

void TableView::goToPreviousColumn ( )
slot

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 d_table, and d_view_widget.

Referenced by init().

Here is the caller graph for this function:

◆ handleAspectAboutToBeRemoved

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

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 d_table, and ui.

Referenced by init().

Here is the caller graph for this function:

◆ handleAspectAdded

void TableView::handleAspectAdded ( const AbstractAspect aspect)
protectedslot

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(), d_table, AbstractAspect::name(), AbstractAspect::parentAspect(), and ui.

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)
protectedslot

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(), d_table, AbstractAspect::name(), AbstractAspect::parentAspect(), and ui.

Referenced by init().

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

◆ handleFormatLineEditChange

void TableView::handleFormatLineEditChange ( )
protectedslot

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 ui.

Referenced by init().

Here is the caller graph for this function:

◆ handleHeaderDataChanged

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

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 d_view_widget, and setColumnForControlTabs().

Referenced by init().

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

◆ handleHorizontalHeaderDoubleClicked

void TableView::handleHorizontalHeaderDoubleClicked ( int  index)
protectedslot

Definition at line 339 of file TableView.cpp.

340 {
341  Q_UNUSED(index);
343 }

References showControlDescriptionTab().

Referenced by 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 
)
protectedslot

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 d_table, and d_view_widget.

Referenced by init().

Here is the caller graph for this function:

◆ handleHorizontalSectionResized

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

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 d_horizontal_header, d_table, and isColumnSelected().

Referenced by rereadSectionSizes().

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

◆ hasMultiSelection()

bool TableView::hasMultiSelection ( )

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 d_view_widget.

◆ hiddenWindow

void MyWidget::hiddenWindow ( MyWidget )
signalinherited

Emitted when the window was hidden.

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

Here is the caller graph for this function:

◆ init()

void TableView::init ( )
protected

Initialization.

Definition at line 92 of file TableView.cpp.

93 {
94  QWidget* d_main_widget = new QWidget();
95  d_main_layout = new QHBoxLayout();
96  d_main_widget->setLayout(d_main_layout);
97  d_main_layout->setSpacing(0);
98  d_main_layout->setContentsMargins(0, 0, 0, 0);
99 
100  d_view_widget = new TableViewWidget(this);
101 #ifdef Q_OS_MAC
102  QSettings settings(QSettings::IniFormat,QSettings::UserScope,
103  "SciDAVis", "SciDAVis");
104 #else
105  QSettings settings(QSettings::NativeFormat,QSettings::UserScope,
106  "SciDAVis", "SciDAVis");
107 #endif
108  settings.beginGroup("[Table]");
109  int defaultRowHeight = settings.value("DefaultRowHeight", 20).toInt();
110  settings.endGroup();
111  d_view_widget->verticalHeader()->setDefaultSectionSize(defaultRowHeight);
112  d_view_widget->setModel(d_model);
113  connect(d_view_widget, SIGNAL(advanceCell()), this, SLOT(advanceCell()));
114  d_main_layout->addWidget(d_view_widget);
115 
117 #if QT_VERSION >= 0x050000
118  d_horizontal_header->setSectionsClickable(true);
119 #else
120  d_horizontal_header->setClickable(true);
121 #endif
122  d_horizontal_header->setHighlightSections(true);
123  d_view_widget->setHorizontalHeader(d_horizontal_header);
124 
125  d_hide_button = new QToolButton();
126  d_hide_button->setArrowType(Qt::RightArrow);
127  d_hide_button->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding));
128  d_hide_button->setCheckable(false);
129  d_main_layout->addWidget(d_hide_button);
130  connect(d_hide_button, SIGNAL(pressed()), this, SLOT(toggleControlTabBar()));
131  d_control_tabs = new QWidget();
132  ui.setupUi(d_control_tabs);
133  d_main_layout->addWidget(d_control_tabs);
134 
136  d_view_widget->setItemDelegate(d_delegate);
137 
138  d_view_widget->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding));
139  d_main_layout->setStretchFactor(d_view_widget, 1);
140 
141  setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding));
142 
143  d_view_widget->setFocusPolicy(Qt::StrongFocus);
144  setFocusPolicy(Qt::StrongFocus);
145  setFocus();
146 #if QT_VERSION >= 0x040300
147  d_view_widget->setCornerButtonEnabled(true);
148 #endif
149 
150  d_view_widget->setSelectionMode(QAbstractItemView::ExtendedSelection);
151 
152  QHeaderView * v_header = d_view_widget->verticalHeader();
153 #if QT_VERSION >= 0x050000
154  v_header->setSectionResizeMode(QHeaderView::Interactive);
155  v_header->setSectionsMovable(false);
156  d_horizontal_header->setSectionResizeMode(QHeaderView::Interactive);
157  d_horizontal_header->setSectionsMovable(true);
158 #else
159  v_header->setResizeMode(QHeaderView::Interactive);
160  v_header->setMovable(false);
161  d_horizontal_header->setResizeMode(QHeaderView::Interactive);
162  d_horizontal_header->setMovable(true);
163 #endif
164  connect(d_horizontal_header, SIGNAL(sectionMoved(int,int,int)), this, SLOT(handleHorizontalSectionMoved(int,int,int)));
165  connect(d_horizontal_header, SIGNAL(sectionDoubleClicked(int)), this, SLOT(handleHorizontalHeaderDoubleClicked(int)));
166 
167  d_horizontal_header->setDefaultSectionSize(future::Table::defaultColumnWidth());
168 
169  v_header->installEventFilter(this);
170  d_horizontal_header->installEventFilter(this);
171  d_view_widget->installEventFilter(this);
172 
173  connect(d_model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)), d_view_widget,
174  SLOT(updateHeaderGeometry(Qt::Orientation,int,int)) );
175  connect(d_model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)), this,
176  SLOT(handleHeaderDataChanged(Qt::Orientation,int,int)) );
177  connect(d_table, SIGNAL(aspectDescriptionChanged(const AbstractAspect*)),
178  this, SLOT(handleAspectDescriptionChanged(const AbstractAspect*)));
179  connect(d_table, SIGNAL(aspectAdded(const AbstractAspect*)),
180  this, SLOT(handleAspectAdded(const AbstractAspect*)));
181  connect(d_table, SIGNAL(aspectAboutToBeRemoved(const AbstractAspect*,int)),
182  this, SLOT(handleAspectAboutToBeRemoved(const AbstractAspect*,int)));
183 
184  this->setWidget(d_main_widget);
186 
187  // keyboard shortcuts
188  QShortcut * sel_all = new QShortcut(QKeySequence(tr("Ctrl+A", "Table: select all")), d_view_widget);
189  connect(sel_all, SIGNAL(activated()), d_view_widget, SLOT(selectAll()));
190 
191  connect(ui.type_box, SIGNAL(currentIndexChanged(int)), this, SLOT(updateFormatBox()));
192  connect(ui.format_box, SIGNAL(currentIndexChanged(int)), this, SLOT(updateTypeInfo()));
193  connect(ui.formatLineEdit, SIGNAL(textEdited(const QString)), this, SLOT(handleFormatLineEditChange()));
194  connect(ui.digits_box, SIGNAL(valueChanged(int)), this, SLOT(updateTypeInfo()));
195  connect(ui.previous_column_button, SIGNAL(clicked()), this, SLOT(goToPreviousColumn()));
196  connect(ui.next_column_button, SIGNAL(clicked()), this, SLOT(goToNextColumn()));
198 
199  QItemSelectionModel * sel_model = d_view_widget->selectionModel();
200 
201  connect(sel_model, SIGNAL(currentColumnChanged(const QModelIndex&, const QModelIndex&)),
202  this, SLOT(currentColumnChanged(const QModelIndex&, const QModelIndex&)));
203  connect(sel_model, SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&)),
204  this, SLOT(selectionChanged(const QItemSelection&,const QItemSelection&)));
205  connect(ui.button_set_description, SIGNAL(pressed()),
206  this, SLOT(applyDescription()));
207  connect(ui.button_set_type, SIGNAL(pressed()),
208  this, SLOT(applyType()));
209 }

References advanceCell(), applyDescription(), applyType(), currentColumnChanged(), d_control_tabs, d_delegate, d_hide_button, d_horizontal_header, d_main_layout, d_model, d_table, d_view_widget, future::Table::defaultColumnWidth(), goToNextColumn(), goToPreviousColumn(), handleAspectAboutToBeRemoved(), handleAspectAdded(), handleAspectDescriptionChanged(), handleFormatLineEditChange(), handleHeaderDataChanged(), handleHorizontalHeaderDoubleClicked(), handleHorizontalSectionMoved(), rereadSectionSizes(), retranslateStrings(), selectAll(), selectionChanged(), toggleControlTabBar(), ui, updateFormatBox(), and updateTypeInfo().

Referenced by TableView().

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

◆ isCellSelected()

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

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 d_model, d_table, d_view_widget, and TableModel::index().

Here is the call graph for this function:

◆ isColumnSelected()

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

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 d_view_widget.

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

Here is the caller graph for this function:

◆ isControlTabBarVisible()

bool TableView::isControlTabBarVisible ( )
inline

Definition at line 102 of file TableView.h.

102 { return d_control_tabs->isVisible(); }

References d_control_tabs.

◆ isRowSelected()

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

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

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

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 d_view_widget.

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

Here is the caller graph for this function:

◆ lastSelectedColumn()

int TableView::lastSelectedColumn ( bool  full = false)

Return the index of the last selected column.

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

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 d_table, and isColumnSelected().

Referenced by Table::applyFormula(), and Table::recalculate().

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

◆ lastSelectedRow()

int TableView::lastSelectedRow ( bool  full = false)

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 d_table, and isRowSelected().

Referenced by Table::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:

◆ modifiedWindow

void MyWidget::modifiedWindow ( MyWidget )
signalinherited

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

Here is the caller graph for this function:

◆ name()

virtual QString MyWidget::name ( )
inlinevirtualinherited

Return the window name.

Reimplemented in Table, and Matrix.

Definition at line 81 of file MyWidget.h.

81 {return objectName();};

Referenced by RenameWindowDialog::accept(), ApplicationWindow::addListViewItem(), ApplicationWindow::alreadyUsedName(), ApplicationWindow::appendProject(), ApplicationWindow::clone(), ApplicationWindow::closeWindow(), ApplicationWindow::depending3DPlots(), ApplicationWindow::dependingPlots(), MultiLayer::exportSVG(), MultiLayer::exportVector(), Folder::findWindow(), ApplicationWindow::generateUniqueName(), Note::init(), ApplicationWindow::loadImage(), ApplicationWindow::loadProject(), MultiLayer::MultiLayer(), MyWidget::MyWidget(), ApplicationWindow::openNote(), ApplicationWindow::openSurfacePlot(), Graph3D::print(), ApplicationWindow::removeWindowFromLists(), ApplicationWindow::renameWindow(), ApplicationWindow::restoreWindowGeometry(), ApplicationWindow::saveAsTemplate(), Graph3D::saveToString(), MultiLayer::saveToString(), Note::saveToString(), PlotDialog::setMultiLayer(), ApplicationWindow::setShowWindowsPolicy(), RenameWindowDialog::setWidget(), ApplicationWindow::showWindowMenuImpl(), MyWidget::updateCaption(), Graph3D::updateData(), Graph3D::updateScales(), ApplicationWindow::updateWindowStatus(), ApplicationWindow::window(), Folder::window(), ApplicationWindow::windowProperties(), ApplicationWindow::windowsMenuAboutToShow(), and ApplicationWindow::windowsMenuActivated().

Here is the caller graph for this function:

◆ 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:

◆ print()

virtual void MyWidget::print ( )
inlinevirtualinherited

Reimplemented in Note, MultiLayer, and Graph3D.

Definition at line 107 of file MyWidget.h.

107 {};

◆ rereadSectionSizes

void TableView::rereadSectionSizes ( )
slot

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 d_horizontal_header, d_table, and handleHorizontalSectionResized().

Referenced by init().

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

◆ resizedWindow

void MyWidget::resizedWindow ( MyWidget )
signalinherited

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

Here is the caller graph for this function:

◆ restore()

virtual void MyWidget::restore ( const QStringList &  )
inlinevirtualinherited

Not implemented yet.

Definition at line 105 of file MyWidget.h.

105 {};

Referenced by ApplicationWindow::openTemplate().

Here is the caller graph for this function:

◆ retranslateStrings()

void TableView::retranslateStrings ( )
protected

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 d_control_tabs, 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, ui, and Double2DateTimeFilter::Year.

Referenced by changeEvent(), and init().

Here is the caller graph for this function:

◆ saveAsTemplate()

virtual QString MyWidget::saveAsTemplate ( const QString &  )
inlinevirtualinherited

Reimplemented in Matrix, MultiLayer, and Graph3D.

Definition at line 102 of file MyWidget.h.

102 {return QString();};

Referenced by ApplicationWindow::saveAsTemplate().

Here is the caller graph for this function:

◆ saveToString()

virtual QString MyWidget::saveToString ( const QString &  )
inlinevirtualinherited

Reimplemented in Matrix, TableStatistics, MultiLayer, and Graph3D.

Definition at line 110 of file MyWidget.h.

110 {return QString();};

Referenced by ApplicationWindow::rawSaveFolder().

Here is the caller graph for this function:

◆ selectAll

void TableView::selectAll ( )
slot

Definition at line 308 of file TableView.cpp.

309 {
311 }

References d_view_widget, and TableViewWidget::selectAll().

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

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

◆ selectedColumnCount() [1/2]

int TableView::selectedColumnCount ( bool  full = false)

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 d_table, and isColumnSelected().

Referenced by Table::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)

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 d_table, and isColumnSelected().

Here is the call graph for this function:

◆ selectedColumns()

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

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 d_table, and isColumnSelected().

Referenced by applyType().

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

◆ selectedRowCount()

int TableView::selectedRowCount ( bool  full = false)

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

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

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 d_table, and isRowSelected().

Referenced by Table::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)

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 d_table, isRowSelected(), and IntervalAttribute< bool >::setValue().

Referenced by Table::recalculate().

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 
)
protectedslot

Definition at line 442 of file TableView.cpp.

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

Referenced by init().

Here is the caller graph for this function:

◆ setBirthDate()

virtual void MyWidget::setBirthDate ( const QString &  s)
inlinevirtualinherited

Set the creation date.

Reimplemented in Table, and Matrix.

Definition at line 93 of file MyWidget.h.

93 {birthdate = s;};

References MyWidget::birthdate.

Referenced by ApplicationWindow::appendProject(), Note::init(), Graph3D::initPlot(), ApplicationWindow::loadProject(), MultiLayer::MultiLayer(), ApplicationWindow::openNote(), and ApplicationWindow::openSurfacePlot().

Here is the caller graph for this function:

◆ setCaptionPolicy()

virtual void MyWidget::setCaptionPolicy ( CaptionPolicy  policy)
inlinevirtualinherited

Set the caption policy.

Reimplemented in Table, and Matrix.

Definition at line 88 of file MyWidget.h.

88 { caption_policy = policy; updateCaption(); }

References MyWidget::caption_policy, and MyWidget::updateCaption().

Referenced by RenameWindowDialog::accept(), ApplicationWindow::appendProject(), ApplicationWindow::clone(), ApplicationWindow::loadImage(), ApplicationWindow::loadProject(), ApplicationWindow::openNote(), ApplicationWindow::openSurfacePlot(), and ApplicationWindow::renameWindow().

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 
)

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 d_model, 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 
)

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 d_model, 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:

◆ setColumnForControlTabs()

void TableView::setColumnForControlTabs ( int  col)
protected

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(), d_table, SciDAVis::DateTime, SciDAVis::Day, DateTime2StringFilter::format(), Column::formula(), SciDAVis::Month, AbstractAspect::name(), Double2StringFilter::numDigits(), SciDAVis::Numeric, Double2StringFilter::numericFormat(), Column::outputFilter(), str, and ui.

Referenced by currentColumnChanged(), and handleHeaderDataChanged().

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

◆ setColumnWidth()

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

Definition at line 225 of file TableView.cpp.

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

References d_horizontal_header.

Referenced by ImportOPJ::importSpreadsheet().

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:

◆ 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 MyWidget::setName ( const QString &  s)
inlinevirtualinherited

Set the window name.

Reimplemented in Table, and Matrix.

Definition at line 83 of file MyWidget.h.

83 {setObjectName(s); updateCaption();};

References MyWidget::updateCaption().

Referenced by ApplicationWindow::dataPlot3D(), ApplicationWindow::dataPlotXYZ(), ApplicationWindow::initBareMultilayerPlot(), ApplicationWindow::initNote(), ApplicationWindow::newPlot3D(), ApplicationWindow::openMatrixPlot3D(), ApplicationWindow::plot3DMatrix(), and ApplicationWindow::renameWindow().

Here is the call graph for this function:
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:

◆ 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:

◆ setWindowLabel()

virtual void MyWidget::setWindowLabel ( const QString &  s)
inlinevirtualinherited

Set the window label.

Reimplemented in Table, and Matrix.

Definition at line 78 of file MyWidget.h.

78 { w_label = s; updateCaption();};

References MyWidget::updateCaption(), and MyWidget::w_label.

Referenced by RenameWindowDialog::accept(), ApplicationWindow::appendProject(), ApplicationWindow::clone(), ImportOPJ::importGraphs(), ImportOPJ::importNotes(), ApplicationWindow::loadImage(), ApplicationWindow::loadProject(), ApplicationWindow::openNote(), and ApplicationWindow::openSurfacePlot().

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

◆ showComments()

void TableView::showComments ( bool  on = true)

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

Definition at line 355 of file TableView.cpp.

356 {
358  update();
359 }

References d_horizontal_header, and TableDoubleHeaderView::showComments().

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

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

◆ showControlDescriptionTab

void TableView::showControlDescriptionTab ( )
slot

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 d_control_tabs, d_hide_button, and ui.

Referenced by handleHorizontalHeaderDoubleClicked().

Here is the caller graph for this function:

◆ showControlFormulaTab

void TableView::showControlFormulaTab ( )
slot

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 d_control_tabs, d_hide_button, and ui.

◆ showControlTypeTab

void TableView::showControlTypeTab ( )
slot

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 d_control_tabs, d_hide_button, and 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:

◆ toggleComments

void TableView::toggleComments ( )
slot

Definition at line 350 of file TableView.cpp.

351 {
353 }

References areCommentsShown(), and showComments().

Here is the call graph for this function:

◆ toggleControlTabBar

void TableView::toggleControlTabBar ( )
slot

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 d_control_tabs, and d_hide_button.

Referenced by 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(), Table::handleAspectDescriptionChange(), Matrix::setCaptionPolicy(), MyWidget::setCaptionPolicy(), Table::setCaptionPolicy(), MyWidget::setName(), Matrix::setWindowLabel(), MyWidget::setWindowLabel(), and Table::setWindowLabel().

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

◆ updateFormatBox

void TableView::updateFormatBox ( )
protectedslot

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 ui.

Referenced by init().

Here is the caller graph for this function:

◆ updateTypeInfo

void TableView::updateTypeInfo ( )
protectedslot

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 ui.

Referenced by init().

Here is the caller graph for this function:

◆ windowLabel()

virtual QString MyWidget::windowLabel ( )
inlinevirtualinherited

Return the window label.

Reimplemented in Table, and Matrix.

Definition at line 76 of file MyWidget.h.

76 {return QString(w_label);};

References MyWidget::w_label.

Referenced by RenameWindowDialog::accept(), ApplicationWindow::addListViewItem(), ApplicationWindow::clone(), Folder::findWindow(), Graph3D::saveToString(), MultiLayer::saveToString(), Note::saveToString(), RenameWindowDialog::setWidget(), and MyWidget::updateCaption().

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(), Table::closeEvent(), and MyWidget::MyWidget().

◆ birthdate

QString MyWidget::birthdate
protectedinherited

◆ caption_policy

◆ d_control_tabs

QWidget* TableView::d_control_tabs
protected

◆ d_delegate

TableItemDelegate* TableView::d_delegate
protected

Pointer to the item delegate.

Definition at line 218 of file TableView.h.

Referenced by init().

◆ d_hide_button

QToolButton* TableView::d_hide_button
protected

Button to toogle the visibility of #d_tool_box.

Definition at line 235 of file TableView.h.

Referenced by init(), retranslateStrings(), showControlDescriptionTab(), showControlFormulaTab(), showControlTypeTab(), TableStatistics::TableStatistics(), and toggleControlTabBar().

◆ d_horizontal_header

◆ d_main_layout

QHBoxLayout* TableView::d_main_layout
protected

Definition at line 236 of file TableView.h.

Referenced by init().

◆ d_model

TableModel* TableView::d_model
protected

Pointer to the current underlying model.

Definition at line 220 of file TableView.h.

Referenced by activateFormulaMode(), eventFilter(), formulaModeActive(), goToCell(), init(), isCellSelected(), setCellSelected(), setCellsSelected(), TableView(), and ~TableView().

◆ 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().

◆ 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:
TableModel
Model for the access to a Table.
Definition: TableModel.h:54
MyWidget::Label
@ Label
caption detemined by the window label
Definition: MyWidget.h:70
MyWidget::caption_policy
CaptionPolicy caption_policy
The caption policy.
Definition: MyWidget.h:173
MyWidget::Maximized
@ Maximized
Definition: MyWidget.h:73
TableViewWidget
Helper class for TableView.
Definition: TableView.h:66
TableView::d_hide_button
QToolButton * d_hide_button
Button to toogle the visibility of #d_tool_box.
Definition: TableView.h:235
MyWidget::parentFolder
Folder * parentFolder
Pointer to the parent folder of the window.
Definition: MyWidget.h:159
Column::outputFilter
AbstractSimpleFilter * outputFilter() const
Return the output filter (for data type -> string conversion)
Definition: Column.cpp:593
TableView::d_main_layout
QHBoxLayout * d_main_layout
Definition: TableView.h:236
TableView::handleAspectAboutToBeRemoved
void handleAspectAboutToBeRemoved(const AbstractAspect *aspect, int index)
Definition: TableView.cpp:436
MyWidget::statusChanged
void statusChanged(MyWidget *)
Emitted when the window status changed.
TableView::goToNextColumn
void goToNextColumn()
Definition: TableView.cpp:963
TableModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: TableModel.cpp:143
DateTime2StringFilter::setFormat
void setFormat(const QString &format)
Set the format string to be used for conversion.
Definition: DateTime2StringFilter.cpp:35
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
TableView::d_horizontal_header
TableDoubleHeaderView * d_horizontal_header
Definition: TableView.h:237
MyWidget::Minimized
@ Minimized
Definition: MyWidget.h:73
MyWidget::showTitleBarMenu
void showTitleBarMenu()
Emitted when the title bar recieves a QContextMenuEvent.
MyWidget::windowLabel
virtual QString windowLabel()
Return the window label.
Definition: MyWidget.h:76
TableDoubleHeaderView
Horizontal header for TableView displaying comments in a second header.
Definition: TableDoubleHeaderView.h:71
Double2StringFilter::numericFormat
char numericFormat() const
Get format character as in QString::number.
Definition: Double2StringFilter.h:50
TableModel::index
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Definition: TableModel.cpp:187
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
MyWidget
Base class of all MDI client windows.
Definition: MyWidget.h:52
TableView::handleAspectAdded
void handleAspectAdded(const AbstractAspect *aspect)
Definition: TableView.cpp:426
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
future::Table::defaultColumnWidth
static int defaultColumnWidth()
Definition: future_Table.h:232
TableView::handleHorizontalHeaderDoubleClicked
void handleHorizontalHeaderDoubleClicked(int index)
Definition: TableView.cpp:339
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
Double2DateTimeFilter::Month
@ Month
Definition: Double2DateTimeFilter.h:50
Double2DateTimeFilter::Hour
@ Hour
Definition: Double2DateTimeFilter.h:50
SciDAVis::ColumnMode
ColumnMode
The column mode (defines output and input filter for table columns)
Definition: globals.h:66
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
MyWidget::modifiedWindow
void modifiedWindow(MyWidget *)
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::updateTypeInfo
void updateTypeInfo()
Definition: TableView.cpp:542
TableView::toggleControlTabBar
void toggleControlTabBar()
Definition: TableView.cpp:318
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
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
IntervalAttribute< bool >::setValue
void setValue(Interval< int > i, bool value=true)
Definition: IntervalAttribute.h:210
Double2StringFilter::setNumericFormat
void setNumericFormat(char format)
Set format character as in QString::number.
Definition: Double2StringFilter.cpp:64
TableView::applyDescription
void applyDescription()
Definition: TableView.cpp:651
TableView::goToPreviousColumn
void goToPreviousColumn()
Definition: TableView.cpp:974
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
TableView::handleHeaderDataChanged
void handleHeaderDataChanged(Qt::Orientation orientation, int first, int last)
Definition: TableView.cpp:727
TableDoubleHeaderView::showComments
void showComments(bool on=true)
Show or hide (if on = false) the column comments.
Definition: TableDoubleHeaderView.cpp:107
AbstractAspect::name
QString name() const
Definition: AbstractAspect.cpp:229
Column::columnMode
SciDAVis::ColumnMode columnMode() const override
Return the column mode.
Definition: Column.cpp:579
TableView::d_delegate
TableItemDelegate * d_delegate
Pointer to the item delegate.
Definition: TableView.h:218
TableView::retranslateStrings
void retranslateStrings()
Definition: TableView.cpp:260
TableView::selectionChanged
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
Definition: TableView.cpp:442
MyWidget::w_status
Status w_status
The window status.
Definition: MyWidget.h:168
TableView::currentColumnChanged
void currentColumnChanged(const QModelIndex &current, const QModelIndex &previous)
Definition: TableView.cpp:361
MyWidget::Name
@ Name
caption determined by the window name
Definition: MyWidget.h:69
TableModel::activateFormulaMode
void activateFormulaMode(bool on)
Definition: TableModel.h:90
SciDAVis::Text
@ Text
column contains strings
Definition: globals.h:68
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
SciDAVis::DateTime
@ DateTime
column contains dates and/or times
Definition: globals.h:71
TableView::handleFormatLineEditChange
void handleFormatLineEditChange()
Definition: TableView.cpp:611
Column::formula
QString formula(int row) const override
Return the formula associated with row 'row'
Definition: Column.cpp:628
MyWidget::closedWindow
void closedWindow(MyWidget *)
Emitted when the window was closed.
DateTime2StringFilter::format
QString format() const
Return the format string.
Definition: DateTime2StringFilter.h:55
TableView::updateFormatBox
void updateFormatBox()
Definition: TableView.cpp:448
Double2StringFilter::numDigits
int numDigits() const
Get number of displayed digits.
Definition: Double2StringFilter.h:52
Double2DateTimeFilter::Millisecond
@ Millisecond
Definition: Double2DateTimeFilter.h:50
TableView::areCommentsShown
bool areCommentsShown() const
Return whether comments are show currently.
Definition: TableView.cpp:345
TableView::handleAspectDescriptionChanged
void handleAspectDescriptionChanged(const AbstractAspect *aspect)
Definition: TableView.cpp:415
TableView::selectedColumns
QList< Column * > selectedColumns(bool full=false)
Return all selected columns.
Definition: TableView.cpp:770
AbstractAspect::comment
QString comment() const
Definition: AbstractAspect.cpp:260
MyWidget::Both
@ Both
caption = "name - label"
Definition: MyWidget.h:71
TableView::rereadSectionSizes
void rereadSectionSizes()
Definition: TableView.cpp:211
TableView::applyType
void applyType()
Definition: TableView.cpp:665
Double2DateTimeFilter::UnitInterval
UnitInterval
Definition: Double2DateTimeFilter.h:50
TableViewWidget::selectAll
void selectAll()
Definition: TableView.cpp:988
TableModel::formulaModeActive
bool formulaModeActive() const
Definition: TableModel.h:91
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
TableItemDelegate
Item delegate for TableView.
Definition: TableItemDelegate.h:37
SciDAVis::Numeric
@ Numeric
column contains doubles
Definition: globals.h:67
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
TableView::advanceCell
void advanceCell()
Advance current cell after [Return] or [Enter] was pressed.
Definition: TableView.cpp:287
MyWidget::updateCaption
void updateCaption()
Set caption according to current CaptionPolicy, name and label.
Definition: MyWidget.cpp:52
Double2DateTimeFilter::Day
@ Day
Definition: Double2DateTimeFilter.h:50
Double2StringFilter
Locale-aware conversion filter double -> QString.
Definition: Double2StringFilter.h:39
TableView::handleHorizontalSectionMoved
void handleHorizontalSectionMoved(int index, int from, int to)
Definition: TableView.cpp:327
MyWidget::changeEvent
virtual void changeEvent(QEvent *event)
Definition: MyWidget.cpp:129
MyWidget::w_label
QString w_label
The window label.
Definition: MyWidget.h:164
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
TableView::ui
Ui::ControlTabs ui
UI with options tabs (description, format, formula etc.)
Definition: TableView.h:229
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