Isis 3 Programmer Reference
TableMainWindow.h
1 #ifndef TableMainWindow_h
2 #define TableMainWindow_h
3 
4 #include <QMainWindow>
5 #include <QMenu>
6 
7 #include <QListWidgetItem>
8 #include <QPointer>
9 
10 #include "MainWindow.h"
11 
12 class QTableWidget;
13 
14 namespace Isis {
57  class TableMainWindow : public MainWindow {
58  Q_OBJECT
59  public:
60  TableMainWindow(QString title, QWidget *parent = 0);
61  ~TableMainWindow();
62 
63  void clear();
64 
70  QTableWidget *table() const {
71  return p_table;
72  };
73 
74 
75  QList<QListWidgetItem *> itemList() const;
76 
77 
84  QListWidget *listWidget() const {
85  return p_listWidget;
86  };
87 
94  int selectedRows() const {
95  return p_selectedRows;
96  };
97 
104  int currentIndex() const {
105  return p_currentIndex;
106  };
107 
114  int currentRow() const {
115  return p_currentRow;
116  };
117 
118  void addToTable(bool setOn, const QString &heading,
119  const QString &menuText = "", int insertAt = -1,
120  Qt::Orientation o = Qt::Horizontal, QString toolTip = "");
121  void deleteColumn(int item);
122  void setStatusMessage(QString message);
123  void closeEvent(QCloseEvent *event);
124  void hideEvent(QHideEvent *event);
125 
126  public slots:
127  void showTable();
128  void syncColumns();
129  void syncRows();
130  void saveAsTable();
131  void saveTable();
132  void clearTable();
133  void deleteRows();
134  void clearRow(int row);
135  void setCurrentRow(int row);
136  void setCurrentIndex(int currentIndex);
137  void setTrackListItems(bool track = false);
138  bool trackListItems();
139  void loadTable();
140  void writeSettings() const;
141  void resizeColumn(int columnIndex);
142 
143  signals:
148  void fileLoaded();
149 
150  protected:
151  bool eventFilter(QObject *o, QEvent *e);
152  void createTable();
153  void readItemSettings(QString heading, QListWidgetItem *item,
154  bool defaultChecked);
155 
156  void readColumnSettings();
157 
158  private:
159  std::string p_appName;
161  QString p_title;
163 
166 
167  QTableWidget *p_table;
168  QPointer<QListWidget> p_listWidget;
172 
177 
178  };
179 };
180 
181 #endif
Isis::TableMainWindow::eventFilter
bool eventFilter(QObject *o, QEvent *e)
This event filter is installed in the constructor.
Definition: TableMainWindow.cpp:831
Isis::TableMainWindow::p_currentIndex
int p_currentIndex
Current index.
Definition: TableMainWindow.h:170
QWidget
Isis::TableMainWindow::p_listWidget
QPointer< QListWidget > p_listWidget
List widget.
Definition: TableMainWindow.h:168
Isis::TableMainWindow::listWidget
QListWidget * listWidget() const
Returns the list widget.
Definition: TableMainWindow.h:84
Isis::TableMainWindow::setCurrentIndex
void setCurrentIndex(int currentIndex)
Sets the current index to currentIndex.
Definition: TableMainWindow.cpp:906
Isis::TableMainWindow::table
QTableWidget * table() const
Returns the table.
Definition: TableMainWindow.h:70
Isis::TableMainWindow::fileLoaded
void fileLoaded()
Signal emitted when a file has loaded.
QList< QListWidgetItem * >
Isis::TableMainWindow::p_currentFile
QFile p_currentFile
The current file.
Definition: TableMainWindow.h:165
Isis::TableMainWindow::writeSettings
void writeSettings() const
This overriden method is called when the Tablemainwindow is closed or hidden to write the size and lo...
Definition: TableMainWindow.cpp:624
Isis::TableMainWindow::p_appName
std::string p_appName
The application name.
Definition: TableMainWindow.h:159
Isis::TableMainWindow::syncColumns
void syncColumns()
This method hides and shows the columns according to which items the user has selected to be view-abl...
Definition: TableMainWindow.cpp:291
Isis::TableMainWindow::p_selectedRows
int p_selectedRows
Number of selected rows.
Definition: TableMainWindow.h:169
Isis::TableMainWindow::trackListItems
bool trackListItems()
Returns whether or not we should track items.
Definition: TableMainWindow.cpp:886
Isis::TableMainWindow::p_save
QAction * p_save
Action to save the table to the current file.
Definition: TableMainWindow.h:164
Isis::TableMainWindow::TableMainWindow
TableMainWindow(QString title, QWidget *parent=0)
Constructs a new TableMainWindow object.
Definition: TableMainWindow.cpp:24
Isis::TableMainWindow::readColumnSettings
void readColumnSettings()
This method reads the columns in the table and sets their size to the appropriate size,...
Definition: TableMainWindow.cpp:588
Isis::TableMainWindow::saveTable
void saveTable()
This method allows the user to save the data from the table to the current file.
Definition: TableMainWindow.cpp:496
Isis::TableMainWindow::addToTable
void addToTable(bool setOn, const QString &heading, const QString &menuText="", int insertAt=-1, Qt::Orientation o=Qt::Horizontal, QString toolTip="")
Adds a new column to the table when a new curve is added to the plot.
Definition: TableMainWindow.cpp:208
Isis::TableMainWindow::setTrackListItems
void setTrackListItems(bool track=false)
If this property is true, the class will keep track of the checked/unchecked items in the dock area w...
Definition: TableMainWindow.cpp:875
Isis::TableMainWindow::showTable
void showTable()
This method checks to see if the table has been created.
Definition: TableMainWindow.cpp:383
Isis::TableMainWindow::clearRow
void clearRow(int row)
This method clears the text of the given row.
Definition: TableMainWindow.cpp:452
Isis::TableMainWindow::currentIndex
int currentIndex() const
Returns the current index.
Definition: TableMainWindow.h:104
Isis::TableMainWindow::selectedRows
int selectedRows() const
Returns the selected rows.
Definition: TableMainWindow.h:94
Isis::TableMainWindow::p_dock
QDockWidget * p_dock
The dock widget.
Definition: TableMainWindow.h:162
Isis::TableMainWindow::p_visibleColumns
int p_visibleColumns
Number of visible columns.
Definition: TableMainWindow.h:173
Isis::TableMainWindow::p_trackItems
bool p_trackItems
Boolean to track items.
Definition: TableMainWindow.h:176
Isis::TableMainWindow::clearTable
void clearTable()
This method clears all items from each row and column.
Definition: TableMainWindow.cpp:394
Isis::TableMainWindow::closeEvent
void closeEvent(QCloseEvent *event)
Definition: TableMainWindow.cpp:850
Isis::TableMainWindow::setCurrentRow
void setCurrentRow(int row)
Sets the current row to row.
Definition: TableMainWindow.cpp:896
Isis::TableMainWindow::p_startColumn
QList< int > p_startColumn
List of start columns.
Definition: TableMainWindow.h:174
Isis::TableMainWindow::p_endColumn
QList< int > p_endColumn
List of end columns.
Definition: TableMainWindow.h:175
Isis::TableMainWindow::p_currentRow
int p_currentRow
Current row.
Definition: TableMainWindow.h:171
Isis::TableMainWindow::p_table
QTableWidget * p_table
The table.
Definition: TableMainWindow.h:167
Isis::TableMainWindow
a subclass of the qisis mainwindow, tablemainwindow handles all of the table tasks.
Definition: TableMainWindow.h:57
Isis::TableMainWindow::saveAsTable
void saveAsTable()
This method will select a file, set it as the current file and save the table.
Definition: TableMainWindow.cpp:465
Isis::TableMainWindow::p_title
QString p_title
The title string.
Definition: TableMainWindow.h:161
Isis::TableMainWindow::deleteColumn
void deleteColumn(int item)
This method deletes a column from the table.
Definition: TableMainWindow.cpp:356
Isis::TableMainWindow::p_parent
QWidget * p_parent
The parent widget.
Definition: TableMainWindow.h:160
Isis::TableMainWindow::setStatusMessage
void setStatusMessage(QString message)
sets the status message in the lower lefthand corner of the window.
Definition: TableMainWindow.cpp:191
Isis::TableMainWindow::createTable
void createTable()
This creates the table main window.
Definition: TableMainWindow.cpp:86
Isis::TableMainWindow::currentRow
int currentRow() const
Returns the current row.
Definition: TableMainWindow.h:114
Isis::TableMainWindow::deleteRows
void deleteRows()
This method is called when the user selects a row or rows uses the delete button or selects the delet...
Definition: TableMainWindow.cpp:414
Isis::MainWindow
Base class for the Qisis main windows.
Definition: MainWindow.h:24
QObject
Isis::TableMainWindow::syncRows
void syncRows()
Use this method to sync the table with the dock widget list if the table orientation is horizontal.
Definition: TableMainWindow.cpp:323
QAction
QDockWidget
Isis::TableMainWindow::hideEvent
void hideEvent(QHideEvent *event)
Definition: TableMainWindow.cpp:863
Isis::TableMainWindow::readItemSettings
void readItemSettings(QString heading, QListWidgetItem *item, bool defaultChecked)
This method reads the 'checked' settings on the items listed in the dock area which determine which t...
Definition: TableMainWindow.cpp:571
Isis::TableMainWindow::loadTable
void loadTable()
This method loads a text file into the table.
Definition: TableMainWindow.cpp:656
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16