Developer Documentation
VSI::Text Class Reference

#include <Plugin-VSI/scene/text.hh>

Inheritance diagram for VSI::Text:
VSI::Button

Public Member Functions

 Text (QGraphicsItem *_parent=0)
 Constructor. More...
 
 Text (const QString &_text, QGraphicsItem *_parent=0)
 Constructor. More...
 
 ~Text ()
 Destrucotr. More...
 
virtual void setGeometry (const QRectF &_rect)
 Sets the geometry. More...
 
QPainterPath shape () const
 Returns the shape for proper repainting/event handling. More...
 
virtual void paint (QPainter *_painter, const QStyleOptionGraphicsItem *_option, QWidget *_widget=0)
 Background painting. More...
 
virtual QRectF boundingRect () const
 Bounding rectangle. More...
 
QBrush backgroundBrush ()
 Returns the current background brush. More...
 
virtual void setBackgroundBrush (QBrush _brush)
 Sets the background brush. More...
 
QPen backgroundPen ()
 Returns the current background pen. More...
 
virtual void setBackgroundPen (QPen _pen)
 Sets the background pen. More...
 
void setBackground (bool _leftOut, bool _rightOut)
 Enables background painting. More...
 
void clearBackground ()
 Disables backgorund painting. More...
 
void setHorizontalStretch (bool _stretch)
 Should this widget be stretchable in horizontal direction. More...
 
void setAlignment (Qt::Alignment _alignment)
 Placement of the text in a stretched widget. More...
 
void setText (QString _text)
 Set displayed text. More...
 
QString text ()
 Get displayed text. More...
 

Protected Member Functions

virtual QSizeF sizeHint (Qt::SizeHint _which, const QSizeF &_constraint=QSizeF()) const
 

Private Attributes

QString text_
 
bool backgroundSet_
 
QBrush backgroundBrush_
 
QPen backgroundPen_
 
bool leftOut_
 
bool rightOut_
 
Qt::Alignment alignment_
 
bool hStretch_
 

Detailed Description

Layoutable text widget implementation with an optional background. The background can have convex or concave sides.

Definition at line 67 of file text.hh.

Constructor & Destructor Documentation

◆ Text() [1/2]

VSI::Text::Text ( QGraphicsItem *  _parent = 0)
explicit

Constructor.

Definition at line 66 of file text.cc.

◆ Text() [2/2]

VSI::Text::Text ( const QString &  _text,
QGraphicsItem *  _parent = 0 
)

Constructor.

Definition at line 80 of file text.cc.

◆ ~Text()

VSI::Text::~Text ( )

Destrucotr.

Destructor.

Definition at line 95 of file text.cc.

Member Function Documentation

◆ backgroundBrush()

QBrush VSI::Text::backgroundBrush ( )
inline

Returns the current background brush.

Definition at line 94 of file text.hh.

◆ backgroundPen()

QPen VSI::Text::backgroundPen ( )
inline

Returns the current background pen.

Definition at line 100 of file text.hh.

◆ boundingRect()

QRectF VSI::Text::boundingRect ( ) const
virtual

Bounding rectangle.

Bounding rect.

Reimplemented in VSI::Button.

Definition at line 342 of file text.cc.

◆ clearBackground()

void VSI::Text::clearBackground ( )

Disables backgorund painting.

Definition at line 333 of file text.cc.

◆ paint()

void VSI::Text::paint ( QPainter *  _painter,
const QStyleOptionGraphicsItem *  _option,
QWidget *  _widget = 0 
)
virtual

Background painting.

Reimplemented in VSI::Button.

Definition at line 185 of file text.cc.

◆ setAlignment()

void VSI::Text::setAlignment ( Qt::Alignment  _alignment)

Placement of the text in a stretched widget.

Definition at line 311 of file text.cc.

◆ setBackground()

void VSI::Text::setBackground ( bool  _leftOut,
bool  _rightOut 
)

Enables background painting.

Definition at line 300 of file text.cc.

◆ setBackgroundBrush()

void VSI::Text::setBackgroundBrush ( QBrush  _brush)
virtual

Sets the background brush.

Reimplemented in VSI::Button.

Definition at line 379 of file text.cc.

◆ setBackgroundPen()

void VSI::Text::setBackgroundPen ( QPen  _pen)
virtual

Sets the background pen.

Reimplemented in VSI::Button.

Definition at line 388 of file text.cc.

◆ setGeometry()

void VSI::Text::setGeometry ( const QRectF &  _rect)
virtual

Sets the geometry.

Reimplemented in VSI::Button.

Definition at line 102 of file text.cc.

◆ setHorizontalStretch()

void VSI::Text::setHorizontalStretch ( bool  _stretch)

Should this widget be stretchable in horizontal direction.

Definition at line 324 of file text.cc.

◆ setText()

void VSI::Text::setText ( QString  _text)
inline

Set displayed text.

Definition at line 118 of file text.hh.

◆ shape()

QPainterPath VSI::Text::shape ( ) const

Returns the shape for proper repainting/event handling.

Definition at line 397 of file text.cc.

◆ sizeHint()

QSizeF VSI::Text::sizeHint ( Qt::SizeHint  _which,
const QSizeF &  _constraint = QSizeF() 
) const
protectedvirtual

Definition at line 138 of file text.cc.

◆ text()

QString VSI::Text::text ( )
inline

Get displayed text.

Definition at line 121 of file text.hh.

Member Data Documentation

◆ alignment_

Qt::Alignment VSI::Text::alignment_
private

Definition at line 140 of file text.hh.

◆ backgroundBrush_

QBrush VSI::Text::backgroundBrush_
private

Definition at line 134 of file text.hh.

◆ backgroundPen_

QPen VSI::Text::backgroundPen_
private

Definition at line 135 of file text.hh.

◆ backgroundSet_

bool VSI::Text::backgroundSet_
private

Definition at line 132 of file text.hh.

◆ hStretch_

bool VSI::Text::hStretch_
private

Definition at line 141 of file text.hh.

◆ leftOut_

bool VSI::Text::leftOut_
private

Definition at line 137 of file text.hh.

◆ rightOut_

bool VSI::Text::rightOut_
private

Definition at line 138 of file text.hh.

◆ text_

QString VSI::Text::text_
private

Definition at line 130 of file text.hh.


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