casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
casa::TBDataItem Class Reference

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

#include <TBDataTab.qo.h>

List of all members.

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


Constructor & Destructor Documentation

Constructor to take the String value and the type.

TBDataItem(String value, String type);


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 ( String  value,
bool  text 
) [private]

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


Member Data Documentation

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

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

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

Holds the data type.

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


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