Isis 3.0 Developer's Reference (API) |
Home |
a subclass of the qisis mainwindow, tablemainwindow handles all of the table tasks. More...
#include <TableMainWindow.h>
Inherits Isis::MainWindow.
Public Slots | |
void | showTable () |
This method checks to see if the table has been created. | |
void | syncColumns () |
This method hides and shows the columns according to which items the user has selected to be view-able on the left hand side list. | |
void | syncRows () |
Use this method to sync the table with the dock widget list if the table orientation is horizontal. | |
void | saveAsTable () |
This method will select a file, set it as the current file and save the table. | |
void | saveTable () |
This method allows the user to save the data from the table to the current file. | |
void | clearTable () |
This method clears all items from each row and column. | |
void | deleteRows () |
This method is called when the user selects a row or rows uses the delete button or selects the delete row menu item from the file menu. | |
void | clearRow (int row) |
This method clears the text of the given row. | |
void | setCurrentRow (int row) |
Sets the current row to row. | |
void | setCurrentIndex (int currentIndex) |
Sets the current index to currentIndex. | |
void | setTrackListItems (bool track=false) |
If this property is true, the class will keep track of the checked/unchecked items in the dock area which determines which columns are visible in the table. | |
bool | trackListItems () |
Returns whether or not we should track items. | |
void | loadTable () |
This method loads a text file into the table. | |
void | writeSettings () |
This overriden method is called when the Tablemainwindow is closed or hidden to write the size and location settings (and dock widget settings) to a config file in the user's home directory. | |
Signals | |
void | fileLoaded () |
Signal emitted when a file has loaded. | |
Public Member Functions | |
QTableWidget * | table () const |
Returns the table. | |
QList< QListWidgetItem * > | itemList () const |
Returns the item list. | |
QListWidget * | listWidget () const |
Returns the list widget. | |
int | selectedRows () const |
Returns the selected rows. | |
int | currentIndex () const |
Returns the current index. | |
int | currentRow () const |
Returns the current row. | |
TableMainWindow (QString title, QWidget *parent=0) | |
Constructs a new TableMainWindow object. | |
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. | |
void | deleteColumn (int item) |
This method deletes a column from the table. | |
void | setStatusMessage (QString message) |
sets the status message in the lower lefthand corner of the window. | |
void | closeEvent (QCloseEvent *event) |
void | hideEvent (QHideEvent *event) |
virtual void | writeSettings () const |
This method is called when the Main window is closed or hidden to write the size and location settings to a config file in the user's home directory. | |
Protected Member Functions | |
bool | eventFilter (QObject *o, QEvent *e) |
This event filter is installed in the constructor. | |
void | createTable () |
This creates the table main window. | |
void | readSettings () |
This overriden method is called from the constructor so that when the Tablemainwindow is created, it know's it's size and location and the dock widget settings. | |
void | readItemSettings (QString heading, QListWidgetItem *item) |
This method reads the 'checked' settings on the items listed in the dock area which determine which table columns are visible. |
a subclass of the qisis mainwindow, tablemainwindow handles all of the table tasks.
Isis::TableMainWindow::TableMainWindow | ( | QString | title, | |
QWidget * | parent = 0 | |||
) |
Constructs a new TableMainWindow object.
title | ||
parent |
References createTable(), readSettings(), and writeSettings().
void Isis::TableMainWindow::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.
Also adds the item to the dock area.
setOn | ||
heading | ||
menuText | ||
insertAt | ||
o | ||
toolTip |
References readItemSettings().
Referenced by Isis::PlotWindow::fillTable().
void Isis::TableMainWindow::clearRow | ( | int | row | ) | [slot] |
void Isis::TableMainWindow::clearTable | ( | ) | [slot] |
This method clears all items from each row and column.
References c.
Referenced by createTable(), and loadTable().
void Isis::TableMainWindow::closeEvent | ( | QCloseEvent * | event | ) | [virtual] |
void Isis::TableMainWindow::createTable | ( | ) | [protected] |
This creates the table main window.
The table and docking area are created here. It also adds the two default menus to the menu bar. Programmers can add more menus to the menu bar once an instance of this class is established.
References clearTable(), deleteRows(), loadTable(), saveAsTable(), saveTable(), and syncColumns().
Referenced by showTable(), and TableMainWindow().
int Isis::TableMainWindow::currentIndex | ( | ) | const [inline] |
Returns the current index.
int Isis::TableMainWindow::currentRow | ( | ) | const [inline] |
Returns the current row.
void Isis::TableMainWindow::deleteColumn | ( | int | item | ) |
void Isis::TableMainWindow::deleteRows | ( | ) | [slot] |
This method is called when the user selects a row or rows uses the delete button or selects the delete row menu item from the file menu.
References c, d, and selectedRows().
Referenced by createTable().
bool Isis::TableMainWindow::eventFilter | ( | QObject * | o, | |
QEvent * | e | |||
) | [protected, virtual] |
This event filter is installed in the constructor.
o | ||
e |
Reimplemented from Isis::MainWindow.
References writeSettings().
void Isis::TableMainWindow::fileLoaded | ( | ) | [signal] |
Signal emitted when a file has loaded.
Referenced by loadTable().
void Isis::TableMainWindow::hideEvent | ( | QHideEvent * | event | ) | [virtual] |
QList<QListWidgetItem *> Isis::TableMainWindow::itemList | ( | ) | const [inline] |
Returns the item list.
QListWidget* Isis::TableMainWindow::listWidget | ( | ) | const [inline] |
void Isis::TableMainWindow::loadTable | ( | ) | [slot] |
This method loads a text file into the table.
References c, clearTable(), fileLoaded(), and str.
Referenced by createTable().
void Isis::TableMainWindow::readItemSettings | ( | QString | heading, | |
QListWidgetItem * | item | |||
) | [protected] |
This method reads the 'checked' settings on the items listed in the dock area which determine which table columns are visible.
This method is only called if p_trackItems is set to true.
heading | ||
item |
References Isis::Filename::Expanded().
Referenced by addToTable().
void Isis::TableMainWindow::readSettings | ( | ) | [protected, virtual] |
This overriden method is called from the constructor so that when the Tablemainwindow is created, it know's it's size and location and the dock widget settings.
Reimplemented from Isis::MainWindow.
References Isis::Filename::Expanded().
Referenced by TableMainWindow().
void Isis::TableMainWindow::saveAsTable | ( | ) | [slot] |
This method will select a file, set it as the current file and save the table.
References saveTable().
Referenced by createTable().
void Isis::TableMainWindow::saveTable | ( | ) | [slot] |
This method allows the user to save the data from the table to the current file.
References line.
Referenced by createTable(), and saveAsTable().
int Isis::TableMainWindow::selectedRows | ( | ) | const [inline] |
void Isis::TableMainWindow::setCurrentIndex | ( | int | currentIndex | ) | [slot] |
Sets the current index to currentIndex.
currentIndex |
void Isis::TableMainWindow::setCurrentRow | ( | int | row | ) | [slot] |
Sets the current row to row.
row |
void Isis::TableMainWindow::setStatusMessage | ( | QString | message | ) |
sets the status message in the lower lefthand corner of the window.
message |
void Isis::TableMainWindow::setTrackListItems | ( | bool | track = false |
) | [slot] |
If this property is true, the class will keep track of the checked/unchecked items in the dock area which determines which columns are visible in the table.
track |
Referenced by Isis::PlotWindow::showTable().
void Isis::TableMainWindow::showTable | ( | ) | [slot] |
This method checks to see if the table has been created.
If not it calls the createTable method before calling show.
References createTable(), and syncColumns().
Referenced by deleteColumn().
void Isis::TableMainWindow::syncColumns | ( | ) | [slot] |
This method hides and shows the columns according to which items the user has selected to be view-able on the left hand side list.
(dock area)
Referenced by createTable(), showTable(), and Isis::PlotWindow::showTable().
void Isis::TableMainWindow::syncRows | ( | ) | [slot] |
Use this method to sync the table with the dock widget list if the table orientation is horizontal.
QTableWidget* Isis::TableMainWindow::table | ( | ) | const [inline] |
Returns the table.
Referenced by Isis::PlotWindow::clearPlot(), Isis::PlotWindow::fillTable(), and Isis::MeasureTool::rubberBandComplete().
bool Isis::TableMainWindow::trackListItems | ( | ) | [slot] |
Returns whether or not we should track items.
void Isis::MainWindow::writeSettings | ( | ) | const [virtual, inherited] |
This method is called when the Main window is closed or hidden to write the size and location settings to a config file in the user's home directory.
void Isis::TableMainWindow::writeSettings | ( | ) | [slot] |
This overriden method is called when the Tablemainwindow is closed or hidden to write the size and location settings (and dock widget settings) to a config file in the user's home directory.
References c, colWidth, and Isis::Filename::Expanded().
Referenced by closeEvent(), eventFilter(), hideEvent(), and TableMainWindow().