casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casa::TBDataItem Class Reference

Subclass of QTableWidgetItem that allows for custom sorting. More...

#include <TBDataTab.qo.h>

Inheritance diagram for casa::TBDataItem:

Public Member Functions

 TBDataItem (TBData *data)
 Constructor to take the casacore::String value and the type. More...
 
 ~TBDataItem ()
 
virtual bool operator< (const QTableWidgetItem &other) const
 Override QTableWidgetItem's less-than operator. More...
 

Private Member Functions

void set (casacore::String value, bool text)
 Set the Qt::UserRole and, if text is true, the Qt::DisplayRole values. More...
 

Private Attributes

casacore::String type
 Holds the data type. More...
 
bool arrayDimension
 Is true if the value stored for Qt::UserRole is an array dimension, false otherwise. More...
 
TBDatatdata
 

Detailed Description

Subclass of QTableWidgetItem that allows for custom sorting.

Synopsis

TBDataItem takes a value and a type. The object saves the value in two ways using Qt::DisplayRole and Qt::UserRole. The value is stored as a string using QtDisplayRole, and this is what is actually shown in the QTableWidget. The data stored with Qt::UserRole, however, may be of a different type, such as an integer. This storage is used when sorting so that, for example, numbers can be sorted numerically rather than lexiographically. casacore::Array types are sorted using the first element for one-dimensional arrays and the first dimension for other arrays.

Definition at line 64 of file TBDataTab.qo.h.

Constructor & Destructor Documentation

casa::TBDataItem::TBDataItem ( TBData data)

Constructor to take the casacore::String value and the type.

TBDataItem(casacore::String value, casacore::String type);

casa::TBDataItem::~TBDataItem ( )

Member Function Documentation

virtual bool casa::TBDataItem::operator< ( const QTableWidgetItem &  other) const
virtual

Override QTableWidgetItem's less-than operator.

Returns true if the value of this TBDataItem is less than that of the given TBDataItem, false otherwise. If other is not of type TBDataItem, the behavior is undefined. Also, since this operator is only used for custom sorting, the other TBDataItem is assumed to have the same type as this one.

void casa::TBDataItem::set ( casacore::String  value,
bool  text 
)
private

Set the Qt::UserRole and, if text is true, the Qt::DisplayRole values.

Member Data Documentation

bool casa::TBDataItem::arrayDimension
private

Is true if the value stored for Qt::UserRole is an array dimension, false otherwise.

Definition at line 87 of file TBDataTab.qo.h.

TBData* casa::TBDataItem::tdata
private

Definition at line 89 of file TBDataTab.qo.h.

casacore::String casa::TBDataItem::type
private

Holds the data type.

Definition at line 83 of file TBDataTab.qo.h.


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