Isis Developer Reference
Isis::TableMainWindow Class Reference

a subclass of the qisis mainwindow, tablemainwindow handles all of the table tasks. More...

#include <TableMainWindow.h>

Inheritance diagram for Isis::TableMainWindow:
Inheritance graph
Collaboration diagram for Isis::TableMainWindow:
Collaboration graph

Public Slots

void showTable ()
 This method checks to see if the table has been created. More...
 
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. More...
 
void syncRows ()
 Use this method to sync the table with the dock widget list if the table orientation is horizontal. More...
 
void saveAsTable ()
 This method will select a file, set it as the current file and save the table. More...
 
void saveTable ()
 This method allows the user to save the data from the table to the current file. More...
 
void clearTable ()
 This method clears all items from each row and column. More...
 
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. More...
 
void clearRow (int row)
 This method clears the text of the given row. More...
 
void setCurrentRow (int row)
 Sets the current row to row. More...
 
void setCurrentIndex (int currentIndex)
 Sets the current index to currentIndex. More...
 
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. More...
 
bool trackListItems ()
 Returns whether or not we should track items. More...
 
void loadTable ()
 This method loads a text file into the table. More...
 
void writeSettings () const
 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. More...
 
void resizeColumn (int columnIndex)
 

Signals

void fileLoaded ()
 Signal emitted when a file has loaded. More...
 

Public Member Functions

 TableMainWindow (QString title, QWidget *parent=0)
 Constructs a new TableMainWindow object. More...
 
 ~TableMainWindow ()
 
void clear ()
 
QTableWidget * table () const
 Returns the table. More...
 
QList< QListWidgetItem * > itemList () const
 
QListWidget * listWidget () const
 Returns the list widget. More...
 
int selectedRows () const
 Returns the selected rows. More...
 
int currentIndex () const
 Returns the current index. More...
 
int currentRow () const
 Returns the current row. More...
 
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. More...
 
void deleteColumn (int item)
 This method deletes a column from the table. More...
 
void setStatusMessage (QString message)
 sets the status message in the lower lefthand corner of the window. More...
 
void closeEvent (QCloseEvent *event)
 
void hideEvent (QHideEvent *event)
 

Static Public Member Functions

static QString settingsFileName (QString objectTitle)
 

Protected Member Functions

bool eventFilter (QObject *o, QEvent *e)
 This event filter is installed in the constructor. More...
 
void createTable ()
 This creates the table main window. More...
 
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 table columns are visible. More...
 
void readColumnSettings ()
 This method reads the columns in the table and sets their size to the appropriate size, or the size to auto based on what they were stored as. More...
 
QString settingsFileName () const
 
virtual void readSettings (QSize defaultSize=QSize())
 This method ensure that the settings get written even if the Main window was only hidden, not closed. More...
 

Detailed Description

a subclass of the qisis mainwindow, tablemainwindow handles all of the table tasks.

Author
????-??-?? Stacy Alley

Constructor & Destructor Documentation

◆ TableMainWindow()

Isis::TableMainWindow::TableMainWindow ( QString  title,
QWidget parent = 0 
)

Constructs a new TableMainWindow object.

Parameters
title
parent

References createTable(), readColumnSettings(), and Isis::MainWindow::readSettings().

◆ ~TableMainWindow()

Isis::TableMainWindow::~TableMainWindow ( )

References writeSettings().

Member Function Documentation

◆ addToTable()

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.

Parameters
setOn
heading
menuText
insertAt
o
toolTip

References readColumnSettings(), and readItemSettings().

Referenced by Isis::AdvancedTrackTool::AdvancedTrackTool(), Isis::PlotWindow::fillTable(), Isis::MeasureTool::MeasureTool(), and Isis::SunShadowTool::SunShadowTool().

◆ clear()

void Isis::TableMainWindow::clear ( )

References writeSettings().

Referenced by createTable().

◆ clearRow

void Isis::TableMainWindow::clearRow ( int  row)
slot

This method clears the text of the given row.

Parameters
row

Referenced by Isis::AdvancedTrackTool::mouseLeave(), and Isis::MeasureTool::updateMeasure().

◆ clearTable

void Isis::TableMainWindow::clearTable ( )
slot

This method clears all items from each row and column.

Referenced by createTable(), and loadTable().

◆ closeEvent()

void Isis::TableMainWindow::closeEvent ( QCloseEvent *  event)
virtual
Parameters
event

Reimplemented from Isis::MainWindow.

References Isis::MainWindow::closeEvent(), and writeSettings().

◆ createTable()

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 clear(), clearTable(), deleteRows(), loadTable(), resizeColumn(), saveAsTable(), saveTable(), and syncColumns().

Referenced by showTable(), and TableMainWindow().

◆ currentIndex()

int Isis::TableMainWindow::currentIndex ( ) const
inline

Returns the current index.

Returns
int

Referenced by setCurrentIndex().

◆ currentRow()

int Isis::TableMainWindow::currentRow ( ) const
inline

◆ deleteColumn()

void Isis::TableMainWindow::deleteColumn ( int  item)

This method deletes a column from the table.

Parameters
item

References showTable().

◆ deleteRows

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

Referenced by createTable().

◆ eventFilter()

bool Isis::TableMainWindow::eventFilter ( QObject o,
QEvent *  e 
)
protected

This event filter is installed in the constructor.

Parameters
o
e
Returns
bool

References writeSettings().

◆ fileLoaded

void Isis::TableMainWindow::fileLoaded ( )
signal

Signal emitted when a file has loaded.

Referenced by loadTable().

◆ hideEvent()

void Isis::TableMainWindow::hideEvent ( QHideEvent *  event)
Parameters
event

◆ itemList()

QList< QListWidgetItem * > Isis::TableMainWindow::itemList ( ) const

◆ listWidget()

QListWidget* Isis::TableMainWindow::listWidget ( ) const
inline

Returns the list widget.

Returns
QListWidget*

Referenced by Isis::PlotWindow::fillTable().

◆ loadTable

void Isis::TableMainWindow::loadTable ( )
slot

This method loads a text file into the table.

References clearTable(), fileLoaded(), and itemList().

Referenced by createTable().

◆ readColumnSettings()

void Isis::TableMainWindow::readColumnSettings ( )
protected

This method reads the columns in the table and sets their size to the appropriate size, or the size to auto based on what they were stored as.

References Isis::MainWindow::settingsFileName().

Referenced by addToTable(), and TableMainWindow().

◆ readItemSettings()

void Isis::TableMainWindow::readItemSettings ( QString  heading,
QListWidgetItem *  item,
bool  defaultChecked 
)
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.

Parameters
heading
item

References Isis::MainWindow::settingsFileName().

Referenced by addToTable().

◆ readSettings()

void Isis::MainWindow::readSettings ( QSize  defaultSize = QSize())
protectedvirtualinherited

This method ensure that the settings get written even if the Main window was only hidden, not closed.

Parameters
eventThis method is called from the constructor so that when the Main window is created, it know's it's size and location.

References Isis::MainWindow::settingsFileName().

Referenced by Isis::PlotWindow::PlotWindow(), TableMainWindow(), and Isis::ViewportMainWindow::ViewportMainWindow().

◆ resizeColumn

void Isis::TableMainWindow::resizeColumn ( int  columnIndex)
slot

Referenced by createTable().

◆ saveAsTable

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

◆ saveTable

void Isis::TableMainWindow::saveTable ( )
slot

This method allows the user to save the data from the table to the current file.

Referenced by createTable(), and saveAsTable().

◆ selectedRows()

int Isis::TableMainWindow::selectedRows ( ) const
inline

Returns the selected rows.

Returns
int

Referenced by deleteRows().

◆ setCurrentIndex

void Isis::TableMainWindow::setCurrentIndex ( int  currentIndex)
slot

Sets the current index to currentIndex.

Parameters
currentIndex

References currentIndex().

◆ setCurrentRow

void Isis::TableMainWindow::setCurrentRow ( int  row)
slot

Sets the current row to row.

Parameters
row

Referenced by Isis::MeasureTool::rubberBandComplete().

◆ setStatusMessage()

void Isis::TableMainWindow::setStatusMessage ( QString  message)

sets the status message in the lower lefthand corner of the window.

Parameters
message

Referenced by Isis::AdvancedTrackTool::AdvancedTrackTool(), Isis::MeasureTool::MeasureTool(), and Isis::SunShadowTool::SunShadowTool().

◆ settingsFileName() [1/2]

◆ settingsFileName() [2/2]

QString Isis::MainWindow::settingsFileName ( QString  objectTitle)
staticinherited

◆ setTrackListItems

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.

Parameters
track

Referenced by Isis::AdvancedTrackTool::AdvancedTrackTool(), Isis::MeasureTool::MeasureTool(), Isis::PlotWindow::showTable(), and Isis::SunShadowTool::SunShadowTool().

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

History:
2017-10-06 Adam Goins - showTable() now calls syncColumns() after it calls this->show() so that it hides the unselected columns appropriately. Fixes #5141.
History:
2017-10-06 Adam Goins - showTable() now calls syncColumns() after it calls this->show() so that it hides the unselected columns appropriately. Fixes #5141.

References createTable(), and syncColumns().

Referenced by deleteColumn(), and Isis::AdvancedTrackTool::record().

◆ syncColumns

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)

References itemList().

Referenced by createTable(), Isis::PlotWindow::showTable(), and showTable().

◆ syncRows

void Isis::TableMainWindow::syncRows ( )
slot

Use this method to sync the table with the dock widget list if the table orientation is horizontal.

References itemList().

◆ table()

◆ trackListItems

bool Isis::TableMainWindow::trackListItems ( )
slot

Returns whether or not we should track items.

Returns
bool

◆ writeSettings

void Isis::TableMainWindow::writeSettings ( ) const
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 itemList(), and Isis::MainWindow::settingsFileName().

Referenced by clear(), closeEvent(), eventFilter(), and ~TableMainWindow().


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