GraphicTextWidget Class Reference

A widget used to get text along with other customizable properties, such as font and color, from the user. More...

#include <GraphicTextWidget.h>

List of all members.

Public Slots

void setText (const QString &text)
void setAlignment (int alignment)
void setTextFont (const QFont &textFont)
void setColor (const QColor &color)
void setTextReadOnly (bool bTextReadOnly)

Signals

void textChanged (const QString &text)
void alignmentChanged (int alignment)
void fontChanged (const QFont &textFont)
void colorChanged (const QColor &color)

Public Member Functions

 GraphicTextWidget (QWidget *pParent=NULL)
virtual ~GraphicTextWidget ()
QString getText () const
int getAlignment () const
QFont getTextFont () const
QColor getColor () const

Protected Slots

void notifyTextChange ()
void notifyAlignmentChange ()
void notifyFontChange ()


Detailed Description

A widget used to get text along with other customizable properties, such as font and color, from the user.

The graphic text widget will allow users to customize text, specifying alignment, font, and color. In addition, users may be able to modify the text. This widget is not meant to display the text but rather to allow the user to customize text which is displayed elsewhere, such as a Measurement or Plot.

Definition at line 30 of file GraphicTextWidget.h.


Constructor & Destructor Documentation

GraphicTextWidget::GraphicTextWidget ( QWidget *  pParent = NULL  ) 

Creates a graphic text widget.

Parameters:
pParent The parent widget.

virtual GraphicTextWidget::~GraphicTextWidget (  )  [virtual]

Destroys the graphic text widget and all child items.


Member Function Documentation

QString GraphicTextWidget::getText (  )  const

Returns the text to be displayed to the user.

Returns:
The text to be displayed to the user. By default, an empty string will be returned.

int GraphicTextWidget::getAlignment (  )  const

Returns the alignment which should be used to display the text.

This will correspond to one or more of the values in Qt::AlignmentFlag.

Returns:
The alignment to use when displaying the text. By default, the alignment is Qt::AlignLeft.

QFont GraphicTextWidget::getTextFont (  )  const

Returns the font which should be used to display the text.

Returns:
The font to use when displaying the text. By default, the QFontComboBox default font is used without bold, italics, or underlining. By default, the FontSizeComboBox default font size is used.

QColor GraphicTextWidget::getColor (  )  const

Returns the color which should be used to display the text.

Returns:
The color to use when displaying the text. By default, the CustomColorButton default color is used.

void GraphicTextWidget::setText ( const QString &  text  )  [slot]

Sets the text to be displayed to the user.

Parameters:
text The text to display.

void GraphicTextWidget::setAlignment ( int  alignment  )  [slot]

Sets the alignment which should be used to display the text.

By default, the alignment is Qt::AlignLeft.

Parameters:
alignment The alignment to use. The only supported values are Qt::AlignLeft, Qt::AlignHCenter, and Qt::AlignRight.

void GraphicTextWidget::setTextFont ( const QFont &  textFont  )  [slot]

Sets the font which should be used to display the text.

By default, the QFontComboBox default font is used without bold, italics, or underlining. By default, the FontSizeComboBox default font size is used.

Parameters:
textFont The font to use.

void GraphicTextWidget::setColor ( const QColor &  color  )  [slot]

Sets the color which should be used to display the text.

By default, the CustomColorButton default color is used.

Parameters:
color The color to use.

void GraphicTextWidget::setTextReadOnly ( bool  bTextReadOnly  )  [slot]

Sets whether the user can modify the text.

By default, the text can be edited by the user.

Parameters:
bTextReadOnly True to disable editing, false otherwise.

void GraphicTextWidget::textChanged ( const QString &  text  )  [signal]

Emitted when the text is changed.

Parameters:
text The newly set text.

void GraphicTextWidget::alignmentChanged ( int  alignment  )  [signal]

Emitted when the alignment is changed.

Parameters:
alignment The newly set alignment.

void GraphicTextWidget::fontChanged ( const QFont &  textFont  )  [signal]

Emitted when the font is changed.

Parameters:
textFont The newly set font.

void GraphicTextWidget::colorChanged ( const QColor &  color  )  [signal]

Emitted when the color is changed.

Parameters:
color The newly set color.

void GraphicTextWidget::notifyTextChange (  )  [protected, slot]

Causes textChanged() to be emitted.

void GraphicTextWidget::notifyAlignmentChange (  )  [protected, slot]

Causes alignmentChanged() to be emitted.

void GraphicTextWidget::notifyFontChange (  )  [protected, slot]

Causes fontChanged() to be emitted.


Software Development Kit - Opticks 4.9.0 Build 16218