This class handles display of data in a table using Qt. WORK IN PROGESS. More...
#include <DGVTable.h>
Public Slots | |
void | zapSelection () |
Sets the selection to zero. | |
void | delSelection () |
Deletes the selection. | |
void | plotSelection () |
Plots the selection. | |
void | scanSelection () |
Scans through the selection using line plot. | |
void | saveSelection () |
Save the selection using CSV file. | |
void | saveAll () |
Save the entire table using CSV file. | |
Signals | |
void | plotAvailable (DGVPlot *) |
Send signal that a plot is available for showing. | |
Public Member Functions | |
DGVTable (QWidget *parent=0) | |
The standard constructor. | |
virtual | ~DGVTable () |
The standard destructor. | |
void | setName (QString filename) |
Set the name of the table. | |
virtual void | setItem (int row, int column, tableType value) |
Sets the value into table at position. Automates item creation etc. | |
virtual void | setItem (int row, int column, QString value) |
tableType | getItem (int x, int y) |
Returns the data at (x,y) in the table. | |
bool | loadCSV (const QString filename) |
Loads the CSV file into table. Returns true if successful. | |
void | setData (Array< tableType, 2 > &values) |
Sets table up for values provided. | |
Array< tableType, 2 > & | data () |
Returns a Blitz++ array containing the table data. | |
void | clearArray () |
QString | strippedName () |
Returns the stripped (path removed) name of the table. | |
QString | strippedNamePrefix () |
Returns the stripped (path removed) name of the table with "Table" prefix. | |
Protected Member Functions | |
virtual void | contextMenuEvent (QContextMenuEvent *event) |
The context menu setup member. | |
void | createConnections () |
Sets up the connections between widgets. | |
Protected Attributes | |
QString | name |
Name of the table (with full path). | |
QAction * | zapAct |
Action object for zapping a selection. | |
QAction * | delAct |
Action object for deleting a selection. | |
QAction * | plotAct |
Action object for plotting a selection. | |
QAction * | scanAct |
Action object for scanning through a selection. | |
QAction * | saveAct |
Action object for saving the selection. | |
QAction * | saveAllAct |
Action object for saving entire table. | |
QAction * | closeAct |
Action object for closing the table. | |
Array< tableType, 2 > | tableData |
Array. Empty until data() is called. Then it is assumed that DGVImage is not used and is created. |
This class handles display of data in a table using Qt. WORK IN PROGESS.
It uses the QTableWidget to display Blitz++ arrays and also reads CSV files.
Definition at line 40 of file DGVTable.h.
DGVTable::DGVTable | ( | QWidget * | parent = 0 |
) |
The standard constructor.
Definition at line 27 of file DGVTable.cpp.
DGVTable::~DGVTable | ( | ) | [virtual] |
The standard destructor.
Definition at line 32 of file DGVTable.cpp.
void DGVTable::clearArray | ( | ) | [inline] |
Definition at line 92 of file DGVTable.h.
void DGVTable::contextMenuEvent | ( | QContextMenuEvent * | event | ) | [protected, virtual] |
The context menu setup member.
Definition at line 356 of file DGVTable.cpp.
void DGVTable::createConnections | ( | ) | [protected] |
Sets up the connections between widgets.
Definition at line 392 of file DGVTable.cpp.
Array< tableType, 2 > & DGVTable::data | ( | ) |
Returns a Blitz++ array containing the table data.
Clears the internal Blitz++ array containing the table data.
Definition at line 335 of file DGVTable.cpp.
void DGVTable::delSelection | ( | ) | [slot] |
tableType DGVTable::getItem | ( | int | x, | |
int | y | |||
) |
Returns the data at (x,y) in the table.
Definition at line 65 of file DGVTable.cpp.
bool DGVTable::loadCSV | ( | const QString | filename | ) |
Loads the CSV file into table. Returns true if successful.
Detect CSV structure
< Use first line for detection
< Restart stream
Definition at line 277 of file DGVTable.cpp.
void DGVTable::plotAvailable | ( | DGVPlot * | _t1 | ) | [signal] |
Send signal that a plot is available for showing.
Definition at line 98 of file moc_DGVTable.cpp.
void DGVTable::plotSelection | ( | ) | [slot] |
Plots the selection.
< Array of Array is done to have variable-sized rows
Get selected items, which is put into 1D form
Get the actual ranges selected
Resize the Blitz arrays
Copy the data ordered row wise
Determine shape of selection
Definition at line 114 of file DGVTable.cpp.
void DGVTable::saveAll | ( | ) | [slot] |
Save the entire table using CSV file.
Definition at line 248 of file DGVTable.cpp.
void DGVTable::saveSelection | ( | ) | [slot] |
Save the selection using CSV file.
Get selected items, which is put into 1D form
Get the actual ranges selected
Determine shape of selection
Definition at line 193 of file DGVTable.cpp.
void DGVTable::scanSelection | ( | ) | [slot] |
Scans through the selection using line plot.
Definition at line 165 of file DGVTable.cpp.
void DGVTable::setData | ( | Array< tableType, 2 > & | values | ) |
Sets table up for values provided.
Definition at line 326 of file DGVTable.cpp.
void DGVTable::setItem | ( | int | row, | |
int | column, | |||
tableType | value | |||
) | [virtual] |
Sets the value into table at position. Automates item creation etc.
Definition at line 43 of file DGVTable.cpp.
void DGVTable::setItem | ( | int | row, | |
int | column, | |||
QString | value | |||
) | [virtual] |
Definition at line 55 of file DGVTable.cpp.
void DGVTable::setName | ( | QString | filename | ) |
Set the name of the table.
Definition at line 37 of file DGVTable.cpp.
QString DGVTable::strippedName | ( | ) |
Returns the stripped (path removed) name of the table.
Definition at line 346 of file DGVTable.cpp.
QString DGVTable::strippedNamePrefix | ( | ) |
Returns the stripped (path removed) name of the table with "Table" prefix.
Definition at line 351 of file DGVTable.cpp.
void DGVTable::zapSelection | ( | ) | [slot] |
Sets the selection to zero.
Definition at line 74 of file DGVTable.cpp.
QAction* DGVTable::closeAct [protected] |
Action object for closing the table.
Definition at line 160 of file DGVTable.h.
QAction* DGVTable::delAct [protected] |
Action object for deleting a selection.
Definition at line 153 of file DGVTable.h.
QString DGVTable::name [protected] |
Name of the table (with full path).
Definition at line 150 of file DGVTable.h.
QAction* DGVTable::plotAct [protected] |
Action object for plotting a selection.
Definition at line 155 of file DGVTable.h.
QAction* DGVTable::saveAct [protected] |
Action object for saving the selection.
Definition at line 158 of file DGVTable.h.
QAction* DGVTable::saveAllAct [protected] |
Action object for saving entire table.
Definition at line 159 of file DGVTable.h.
QAction* DGVTable::scanAct [protected] |
Action object for scanning through a selection.
Definition at line 156 of file DGVTable.h.
Array<tableType,2> DGVTable::tableData [protected] |
Array. Empty until data() is called. Then it is assumed that DGVImage is not used and is created.
Definition at line 163 of file DGVTable.h.
QAction* DGVTable::zapAct [protected] |
Action object for zapping a selection.
Definition at line 152 of file DGVTable.h.