casa
$Rev:20696$
|
Rules used to format displayed values for fields. More...
#include <TBFormat.qo.h>
Public Member Functions | |
TBFormat () | |
Default Constructor. | |
~TBFormat () | |
QFontColor * | getAllFont () |
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 | |
QFontColor * | allFont |
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. |
Rules used to format displayed values for fields.
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.
Default Constructor.
void casa::TBFormat::addFont | ( | QFontColor * | fc | ) |
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.
int casa::TBFormat::getDecimalPlaces | ( | ) |
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.
vector<QFontColor*>* casa::TBFormat::getFonts | ( | ) |
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.
bool casa::TBFormat::getScientificFormat | ( | ) |
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.
void casa::TBFormat::setAllFont | ( | QFontColor * | fc | ) |
Sets the QFontColor to be used on all values.
void casa::TBFormat::setBoolFormat | ( | BooleanFormat | f | ) |
Sets the boolean format.
void casa::TBFormat::setDateFormat | ( | String | d | ) |
Sets the date format for this format.
void casa::TBFormat::setDecimalPlaces | ( | int | dp | ) |
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.
void casa::TBFormat::setScientificFormat | ( | bool | sf | ) |
Sets the scientific format flag.
void casa::TBFormat::setVectorThreshold | ( | int | v | ) |
Sets the vector threshold of this format.
See getVectorThreshold().
QFontColor* casa::TBFormat::allFont [private] |
The QFontColor to apply to all values, or NULL if there are value-dependent QFontColors.
Definition at line 157 of file TBFormat.qo.h.
BooleanFormat casa::TBFormat::boolFormat [private] |
The format for boolean values.
Definition at line 169 of file TBFormat.qo.h.
String casa::TBFormat::dateFormat [private] |
The format for displaying dates.
See TBConstants::dateFormatIsValid().
Definition at line 172 of file TBFormat.qo.h.
int casa::TBFormat::decimalPlaces [private] |
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.
bool casa::TBFormat::scientificFormat [private] |
Whether scientific format should be used.
Definition at line 166 of file TBFormat.qo.h.
int casa::TBFormat::vectorThreshold [private] |
The vector threshold, or -1 for unlimited.
Definition at line 175 of file TBFormat.qo.h.