Main Page   Class Hierarchy   Compound List   File List   Header Files   Compound Members   File Members  

QBigTextWidget Class Reference

The class for displaying formatted text with different properties. More...

#include <qbigtextwidget.h>

Class diagram for QBigTextWidget:

QWidget

List of all members.

Public Members

 QBigTextWidget ( QWidget* parent = 0, const char* name = 0, WFlags f=0 )
 ~QBigTextWidget ()

Public Slots

void setFontSize ( int )
void setFontFamily ( const char* )
void setFontColor ( QColor )
void setBgColor ( QColor )
void setDolarColor ( QColor )
void setText ( const char * )
int fontSize () const
const char* fontFamily () const
QColor fontColor () const
QColor bgColor () const
QColor dolarColor () const
const char* text () const

Protected Members

void paintEvent ( QPaintEvent* )
const char* widget_text
int font_size
QString font_family
QColor font_color
QColor bg_color
QColor dolar_color

Detailed Description

The class for displaying formatted text with different properties.

This class allows displaying any given text with a properties set through the following methods:

Moreover the text can be formatted using the following control sequences: The control sequences work as a mode switches, so the following text:

[Just] {a[n te}st] text.

will be displayed as:

Just an test text.


Member Function Documentation

QBigTextWidget::QBigTextWidget (QWidget * parent = 0, const char * name = 0, WFlags f = 0)

Constructor.

The constructor doesn't really do anything special. The font is set by default to 20pt Arial with black color on light gray background. The default text is set to be: Example of the text.

QBigTextWidget::~QBigTextWidget ()

Destructor.

Does nothing.

void QBigTextWidget::setFontSize (int size) [slot]

Set the font size.

Sets the font size to a given value and updates the widget.

void QBigTextWidget::setFontFamily (const char * family) [slot]

Set the font family.

Sets the font family to a given value and updates the widget.

void QBigTextWidget::setFontColor (QColor color) [slot]

Set the font color.

Sets the font color to a given value and updates the widget.

void QBigTextWidget::setBgColor (QColor color) [slot]

Set the background color.

Sets the backgroun color to a given value and updates the widget.

void QBigTextWidget::setDolarColor (QColor color) [slot]

Set the color of the text in '$' scope.

Sets the dolar_color to a given value and updates the widget.

void QBigTextWidget::setText (const char * t) [slot]

Set the text to be displayed.

Sets the displayed text to a given value and updates the widget.

int QBigTextWidget::fontSize () const [inline, slot]

Returns font_size value.

const char * QBigTextWidget::fontFamily () const [inline, slot]

Returns font_family value.

QColor QBigTextWidget::fontColor () const [inline, slot]

Returns font_color value.

QColor QBigTextWidget::bgColor () const [inline, slot]

Returns bg_color value.

QColor QBigTextWidget::dolarColor () const [inline, slot]

const char * QBigTextWidget::text () const [inline, slot]

Returns widget_text value.

void QBigTextWidget::paintEvent (QPaintEvent *) [protected]

Overloaded from QWidget.

The painting of the text is where all the magic is done. In short: the text is split uzing whitespace and formatting delimiters and drawn token by token from the left edge of the widget to the right. If the token doesn't fit in the line it is drawn from the beginning of the next one.

BUG: The formatting delimiters are treaten as word delimiters and therefore a word may be split accross the lines if it contains formatting control sequences in the middle.

BUG2: The colouring information is lost at each new delimiter.


Member Data Documentation

const char* QBigTextWidget::widget_text [protected]

The text to be displayed.

int QBigTextWidget::font_size [protected]

The size of the font in points.

QString QBigTextWidget::font_family [protected]

The family of the font.

See also:
font_families.

QColor QBigTextWidget::font_color [protected]

The color of the font.

QColor QBigTextWidget::bg_color [protected]

The color of the background.

QColor QBigTextWidget::dolar_color [protected]

The color of the text in '$' scopes.


The documentation for this class was generated from the following files:
Generated at Thu Jul 13 15:38:10 2000 for Prompt Show by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999