30 #include <casaqt/QtBrowser/TBDataTab.ui.h>
40 class QCloseableWidget;
41 class TBFilterRuleSequence;
79 virtual bool operator<(
const QTableWidgetItem& other)
const;
141 std::vector<std::pair<casacore::String, bool> >*
getSortFields();
152 void setData(
int row,
int col,
TBData* newVal,
bool format =
true);
161 void refresh(
int row,
int col,
bool format =
true);
166 void sortBy(std::vector<std::pair<casacore::String, bool> >& s);
299 std::vector<std::pair<casacore::String, bool> >
currSort;
311 void sort(
int col,
bool asc);
void rightWidgetClosed(QWidget *which)
This signal is emitted when the side panel is closed.
void clearFormat(int index)
Clears the format on the field at the given index.
void copyData()
Slot for copying the currently selected text into the system clipboard.
void pageBack()
Slot for page back button.
int loadRows
How many rows per page are loaded at once.
bool arrayOpened
Indicates whether the side panel is currently open with an array or not.
void refresh(int row, int col, bool format=true)
Refreshes the table backend using TBTable::refresh(), then updates the displayed data using setData()...
void formatField()
Formats the field that was just right-clicked.
void setData(int row, int col, TBData *newVal, bool format=true)
Sets the given cell in the QTableWidget to the new value, but does NOT update the backend...
void clearSortIndicator()
Clears the sort indicator on the QTableWidget.
int page
The currently loaded page.
void set(casacore::String value, bool text)
Set the Qt::UserRole and, if text is true, the Qt::DisplayRole values.
void restoreColumns()
Slot for the restore columns button.
QBrush & getUnselectedCellBackground()
Retruns the QBrush that is used to draw the background of any unselected cells in the QTableWidget...
void pageForward()
Slot for page forward button.
void applyFilter()
Applies the current filter to the displayed rows.
TBTableTabs * ttabs
Useful pointers to table backend.
void referenceMenuClicked(QAction *which)
Slot for the menu command chosen from the reference menu shown on a right click.
void displayFieldInfo()
Displays the tooltip for the last clicked header in a dialog.
casacore::Data types used for loaded data.
QBrush unselectedBackground
Brushes used to draw the backgrounds of unselected and selected cells in the QTableWidget, respectively.
void headerClicked(int index)
Slot for QHeaderView::sectionClicked().
Subclass of QTableWidgetItem that allows for custom sorting.
void clearAllFormats()
Clears all formats on all fields.
int logicalIndex(int visibleIndex)
Returns the logical index for the row with the given visible index.
TBFormat * formatAt(int index)
Returns the current format for the field at the given index, or NULL if there is none.
Widget used to display table data.
void showWidgetInSplitter(QWidget *widget, bool isArray=false)
Shows the given widget in the side panel.
void displayFieldStatistics()
Displays statistics (min, max, mean) for the last clicked header in a dialog.
void hideColumn()
Hides the column that was just right-clicked.
TBFilterRuleSequence * getFilter()
Returns the current row filter, or NULL if there is none.
QCloseableWidget * rightWidget
Side panel.
void contextMenuEvent(QContextMenuEvent *event)
Catches the right-click event; if the right click is on a table cell and the displayed data could be ...
void clearWidgetInSplitter()
Clears whatever widget (if any) is currently being displayed in the side panel.
std::vector< std::pair< casacore::String, bool > > * getSortFields()
Returns the current sort on the displayed data.
void followReferenceRequested(casacore::String subtable, int index)
This signal is emitted when the user right-clicks on an index and selects the "Follow subtable index ...
void sortBy(std::vector< std::pair< casacore::String, bool > > &s)
Sorts the displayed data with the given order.
void pageFirst()
Slot to go to first page.
std::vector< int > rowIndices
Keeps track of the un-sorted order of the rows.
void updatePageTrackers()
Update widgets that keep track of what page the browser is on.
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
bool arrayDimension
Is true if the value stored for Qt::UserRole is an array dimension, false otherwise.
Wrapper around a QProgressPanel or other QLabel/QProgressBar pairing.
virtual bool operator<(const QTableWidgetItem &other) const
Override QTableWidgetItem's less-than operator.
TBFilterRuleSequence * filter
Current row filter, or NULL if there is none.
void pageGo()
Slot for page go button.
QBrush selectedBackground
void notifyDataChanged(int row, int col)
Slot for QTableWidget::cellChanged().
std::vector< QTableWidgetItem * > rowItems
Keeps track of the un-sorted order of the rows.
void dataChanged(int row, int col, casacore::String newVal)
This signal is emitted when the user has edited a cell.
void sortCleared()
This signal is emitted when a sort is cleared from the table.
void updateTable(ProgressHelper *pp=NULL)
Updates the QTableWidget with new data that has been loaded into the table backend.
std::vector< QTableWidgetItem * > highlightedCells
casacore::List of cells that are highlighted (the row and column of the currently selected cell)...
void headerMoved()
Slot for when a column header is moved.
int clickedHeader
Used for handling right-clicks on headers.
Primary interface for the rest of the browser to a table.
void applyFormat(int index, TBFormat *format)
Applies the given format to the field at the given index.
QTableWidget * getTableWidget()
Returns the QTableWidget that displays the data.
TBDataItem(TBData *data)
Constructor to take the casacore::String value and the type.
void clearSort()
Slot for the clear sort button.
bool goForward
Remembers whether you pressed the next or previous button.
bool loadPage(int p)
Loads the given page into the table backend, which then updates the display.
TBArrayPanel * arrayPanel
Points to the current array panel, or NULL if there is none.
std::vector< TBFormat * > formats
Current field formats.
casacore::String type
Holds the data type.
A sequence of TBFilterRules that can be used to filter rows.
void pageLast()
Slot to go to last page.
Collection of table backend and display tabs.
void resizeHeaders()
Slot for the resize headers button.
void setFilter(TBFilterRuleSequence *rule)
Sets the current filter to the given rules, but does NOT apply it.
TBDataTab(TBTableTabs *tt)
Constructor that takes the parent TBTableTabs.
String: the storage and methods of handling collections of characters.
QFontColor * defaultFormat
"Cleared" format for cell text.
void sort(int col, bool asc)
Sorts on the given row.
void sortEntered()
This signal is emitted when a sort is applied to the table.
void columnHidden(int index, bool hidden)
This signal is emitted when a column is shown or hidden.
std::vector< std::pair< casacore::String, bool > > currSort
The current sort order.
void highlight(int row)
Selects and highlights the given row in the table widget.
QBrush & getSelectedCellBackground()
Returns the QBrush that is used to draw the background of any selected cells in the QTableWidget...
void cellClicked(int row, int col)
Slot for QTableWidget::currentCellChanged().
void setSortIndicator(int index, bool asc)
Sets the sort indicator on the QTableWidget for the given column with an ascending arrow if asc is tr...
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
void doubleClicked(int row, int col)
Slot for QTableWidget::cellDoubleClicked().
Panel that can hold multiple TBViewArray widgets.
QFont color is a convenience class containing a QFont and a QColor.
int visibleIndex(int logicalIndex)
Returns the visible index for the row with the given logical index.