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

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

#include <TBFormat.qo.h>

Public Member Functions

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

Private Attributes

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

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 79 of file TBFormat.qo.h.

Constructor & Destructor Documentation

casa::TBFormat::TBFormat ( )

Default Constructor.

casa::TBFormat::~TBFormat ( )

Member Function Documentation

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.

QFontColor* casa::TBFormat::getAllFont ( )

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.

tb::BooleanFormat casa::TBFormat::getBoolFormat ( )

Returns the boolean format.

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

casacore::String casa::TBFormat::getDateFormat ( )

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

See TBConstants::dateFormatIsValid().

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.

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

int casa::TBFormat::getVectorThreshold ( )

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 ( tb::BooleanFormat  f)

Sets the boolean format.

void casa::TBFormat::setDateFormat ( casacore::String  d)

Sets the date format for this format.

See TBConstants::dateFormatIsValid().

void casa::TBFormat::setDecimalPlaces ( int  dp)

Sets the number of decimal places for this format.

void casa::TBFormat::setFonts ( std::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().

Member Data Documentation

QFontColor* casa::TBFormat::allFont
private

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

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

tb::BooleanFormat casa::TBFormat::boolFormat
private

The format for boolean values.

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

casacore::String casa::TBFormat::dateFormat
private

The format for displaying dates.

See TBConstants::dateFormatIsValid().

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

int casa::TBFormat::decimalPlaces
private

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

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

std::vector<QFontColor*> casa::TBFormat::fonts
private

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

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

bool casa::TBFormat::scientificFormat
private

Whether scientific format should be used.

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

int casa::TBFormat::vectorThreshold
private

The vector threshold, or -1 for unlimited.

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


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