casa
$Rev:20696$
|
Subclass of QTableWidgetItem that allows for custom sorting. More...
#include <TBDataTab.qo.h>
Public Member Functions | |
TBDataItem (TBData *data) | |
Constructor to take the String value and the type. | |
~TBDataItem () | |
virtual bool | operator< (const QTableWidgetItem &other) const |
Override QTableWidgetItem's less-than operator. | |
Private Member Functions | |
void | set (String value, bool text) |
Set the Qt::UserRole and, if text is true, the Qt::DisplayRole values. | |
Private Attributes | |
String | type |
Holds the data type. | |
bool | arrayDimension |
Is true if the value stored for Qt::UserRole is an array dimension, false otherwise. | |
TBData * | tdata |
Subclass of QTableWidgetItem that allows for custom sorting.
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. Array types are sorted using the first element for one-dimensional arrays and the first dimension for other arrays.
Definition at line 67 of file TBDataTab.qo.h.
casa::TBDataItem::TBDataItem | ( | TBData * | data | ) |
Constructor to take the String value and the type.
TBDataItem(String value, String type);
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 | ( | String | value, |
bool | text | ||
) | [private] |
Set the Qt::UserRole and, if text is true, the Qt::DisplayRole values.
bool casa::TBDataItem::arrayDimension [private] |
Is true if the value stored for Qt::UserRole is an array dimension, false otherwise.
Definition at line 90 of file TBDataTab.qo.h.
TBData* casa::TBDataItem::tdata [private] |
Definition at line 92 of file TBDataTab.qo.h.
String casa::TBDataItem::type [private] |
Holds the data type.
Definition at line 86 of file TBDataTab.qo.h.