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

Widget for entering format rules for a given field. More...

#include <TBFormat.qo.h>

Inheritance diagram for casa::TBFormatter:

Signals

void clearRequested (int index)
 This signal is emitted when the user clicks the "Clear casacore::Format" button. More...
 
void setRequested (int index, TBFormat *format)
 This signal is emitted when the user enters a format and then clicks the "Set casacore::Format" button. More...
 

Public Member Functions

 TBFormatter (casacore::String field, casacore::String type, int index, QFontColor font, QWidget *parent=NULL)
 Constructor that takes the field name, type, and index to be formatted, along with the default (unformatted) QFontColor and an optional pointer to the parent widget. More...
 
 ~TBFormatter ()
 
void setFormat (TBFormat *f)
 Sets the displayed format to the given format. More...
 

Private Slots

void changeColor ()
 Slot for when the user wants a color chooser. More...
 
void clearFormat ()
 Slot for when the user clicks the "Clear casacore::Format" button. More...
 
void setFormat ()
 Slot for when the user clicks the "Set casacore::Format" button. More...
 
void applyAllTurned (bool on)
 Slot for when the user clicks the "apply to all" checkbox. More...
 
void applySelectionChanged (int newIndex)
 Slot for when the user clicks in the value-dependent format list. More...
 
void valuesChanged ()
 Slot for when the user changes a font or color parameter. More...
 

Private Member Functions

QFontColorgetFont ()
 Collects the QFontColor information currently set in the GUI and returns it. More...
 
void setFontColor (QFontColor *color)
 Sets the displayed font and color information to the given QFontColor. More...
 

Private Attributes

casacore::String field
 Field being formatted. More...
 
casacore::String type
 Type of the field being formatted. More...
 
int index
 Index of the field being formatted. More...
 
std::vector< QFontColor * > fonts
 casacore::Vector of QFontColors for value-dependent formats. More...
 
bool update
 Flag indicating whether any GUI-generated events are "genuine.". More...
 

Static Private Attributes

static const int UNLIMITED_DECIMALS
 Unlimited decimals constant. More...
 

Detailed Description

Widget for entering format rules for a given field.

Synopsis

A TBFormatter is a dialog that can be used to get format rules from the user. The user can then command either to clear the format (and remove all formatting) or to set the format for a given field. Important: this behavior is implemented through the use of signals, which means that it is the caller's/parent's responsibility for handling the signals and applying the formats as needed.

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

Constructor & Destructor Documentation

casa::TBFormatter::TBFormatter ( casacore::String  field,
casacore::String  type,
int  index,
QFontColor  font,
QWidget *  parent = NULL 
)

Constructor that takes the field name, type, and index to be formatted, along with the default (unformatted) QFontColor and an optional pointer to the parent widget.

If the parent pointer is NULL, this will be displayed as a dialog; otherwise it can be displayed inside the parent.

casa::TBFormatter::~TBFormatter ( )

Member Function Documentation

void casa::TBFormatter::applyAllTurned ( bool  on)
privateslot

Slot for when the user clicks the "apply to all" checkbox.

If the all box is checked, the list of value-dependent formats is disabled.

void casa::TBFormatter::applySelectionChanged ( int  newIndex)
privateslot

Slot for when the user clicks in the value-dependent format list.

The selected format is displayed in the widget.

void casa::TBFormatter::changeColor ( )
privateslot

Slot for when the user wants a color chooser.

Opens a QColorDialog.

void casa::TBFormatter::clearFormat ( )
privateslot

Slot for when the user clicks the "Clear casacore::Format" button.

Emits the clearFormat() signal and closes the window.

void casa::TBFormatter::clearRequested ( int  index)
signal

This signal is emitted when the user clicks the "Clear casacore::Format" button.

The parent/caller should then remove the format for the field with the specified index.

QFontColor* casa::TBFormatter::getFont ( )
private

Collects the QFontColor information currently set in the GUI and returns it.

void casa::TBFormatter::setFontColor ( QFontColor color)
private

Sets the displayed font and color information to the given QFontColor.

void casa::TBFormatter::setFormat ( TBFormat f)

Sets the displayed format to the given format.

void casa::TBFormatter::setFormat ( )
privateslot

Slot for when the user clicks the "Set casacore::Format" button.

Collects the format information from the widget, emits the setRequested() signal, and closes the window.

void casa::TBFormatter::setRequested ( int  index,
TBFormat format 
)
signal

This signal is emitted when the user enters a format and then clicks the "Set casacore::Format" button.

The parent/caller should then set the format for the specified field to the specified format.

void casa::TBFormatter::valuesChanged ( )
privateslot

Slot for when the user changes a font or color parameter.

The QFontColor in the value-dependent vector is updated accordingly.

Member Data Documentation

casacore::String casa::TBFormatter::field
private

Field being formatted.

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

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

casacore::Vector of QFontColors for value-dependent formats.

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

int casa::TBFormatter::index
private

Index of the field being formatted.

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

casacore::String casa::TBFormatter::type
private

Type of the field being formatted.

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

const int casa::TBFormatter::UNLIMITED_DECIMALS
staticprivate

Unlimited decimals constant.

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

bool casa::TBFormatter::update
private

Flag indicating whether any GUI-generated events are "genuine.".

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


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