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

Rules used to format displayed values for fields. More...

#include <TBFormat.qo.h>

List of all members.

Public Member Functions

 TBFormat ()
 Default Constructor.
 ~TBFormat ()
QFontColorgetAllFont ()
 Returns the QFontColor that is applied to all values (i.e., regardless of negative or positive etc.).
void setAllFont (QFontColor *fc)
 Sets the QFontColor to be used on all values.
vector< QFontColor * > * getFonts ()
 Returns the QFontColors used for different values; the order depends on the type.
void setFonts (vector< QFontColor * > *f)
 Sets the value-dependent QFontColors to the values in the given vector.
void addFont (QFontColor *fc)
 Adds a font to the end of the value-dependent QFontColor vector.
String getDateFormat ()
 Returns the date format if this format applies to a date, a blank string otherwise.
void setDateFormat (String d)
 Sets the date format for this format.
BooleanFormat getBoolFormat ()
 Returns the boolean format.
void setBoolFormat (BooleanFormat f)
 Sets the boolean format.
bool getScientificFormat ()
 Returns true if this format's scientific format is on, false otherwise.
void setScientificFormat (bool sf)
 Sets the scientific format flag.
int getDecimalPlaces ()
 Returns the number of decimal places for this format.
void setDecimalPlaces (int dp)
 Sets the number of decimal places for this format.
int getVectorThreshold ()
 Returns the vector threshold for this format.
void setVectorThreshold (int v)
 Sets the vector threshold of this format.
void applyTo (QTableWidgetItem *item, TBData *data)
 Applies this format to the display value in the given QTableWidgetItem.

Private Attributes

QFontColorallFont
 The QFontColor to apply to all values, or NULL if there are value-dependent QFontColors.
vector< QFontColor * > fonts
 The vector of value-dependent QFontColors (can be empty).
int decimalPlaces
 The number of decimal places to display, or -1 for unlimited.
bool scientificFormat
 Whether scientific format should be used.
BooleanFormat boolFormat
 The format for boolean values.
String dateFormat
 The format for displaying dates.
int vectorThreshold
 The vector threshold, or -1 for unlimited.

Detailed Description

Rules used to format displayed values for fields.

Synopsis

A TBFormat contains all information necessary to format a displayed value. A format consists of different options depending on the type of the value being formatted. For example, an integer value could be in scientific notation and could have a different font style for negative and positive numbers. Generally speaking, a format has two parts: type-specific options such as scientific notation or date format, and font options. Some types may have multiple font options (i.e., one for negative values and one for non-negative values).

Definition at line 82 of file TBFormat.qo.h.


Constructor & Destructor Documentation

Default Constructor.


Member Function Documentation

Adds a font to the end of the value-dependent QFontColor vector.

void casa::TBFormat::applyTo ( QTableWidgetItem *  item,
TBData data 
)

Applies this format to the display value in the given QTableWidgetItem.

The pre-format data and the type must also be provided.

Returns the QFontColor that is applied to all values (i.e., regardless of negative or positive etc.).

If this format has value-dependent QFontColors, this will return NULL.

Returns the boolean format.

If this format is not for a boolean value, this operation is undefined.

Returns the date format if this format applies to a date, a blank string otherwise.

See TBConstants::dateFormatIsValid().

Returns the number of decimal places for this format.

If there is an unlimited number of decimal places, or this format doesn't apply to decimals, -1 is returned.

Returns the QFontColors used for different values; the order depends on the type.

For example, for a format applied to integers the non-negative QFontColor is first. If there is a format for all values, this will return an empty vector.

Returns true if this format's scientific format is on, false otherwise.

Returns the vector threshold for this format.

A vector threshold, when applied to one-dimensional arrays, will "hide" the values in the array and display the shape instead IF the size is greater than the specified threshold. If the threshold is unlimited, or this format does not apply to array types, -1 is returned.

Sets the QFontColor to be used on all values.

Sets the boolean format.

Sets the date format for this format.

See TBConstants::dateFormatIsValid().

Sets the number of decimal places for this format.

void casa::TBFormat::setFonts ( vector< QFontColor * > *  f)

Sets the value-dependent QFontColors to the values in the given vector.

Sets the scientific format flag.

Sets the vector threshold of this format.

See getVectorThreshold().


Member Data Documentation

The QFontColor to apply to all values, or NULL if there are value-dependent QFontColors.

Definition at line 157 of file TBFormat.qo.h.

The format for boolean values.

Definition at line 169 of file TBFormat.qo.h.

The format for displaying dates.

See TBConstants::dateFormatIsValid().

Definition at line 172 of file TBFormat.qo.h.

The number of decimal places to display, or -1 for unlimited.

Definition at line 163 of file TBFormat.qo.h.

vector<QFontColor*> casa::TBFormat::fonts [private]

The vector of value-dependent QFontColors (can be empty).

Definition at line 160 of file TBFormat.qo.h.

Whether scientific format should be used.

Definition at line 166 of file TBFormat.qo.h.

The vector threshold, or -1 for unlimited.

Definition at line 175 of file TBFormat.qo.h.


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