KD Chart 2  [rev.2.5]
Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
KDChart::TextArea Class Reference

A text area in the chart with a background, a frame, etc. More...

#include <KDChartTextArea.h>

Inheritance diagram for KDChart::TextArea:
Inheritance graph
[legend]
Collaboration diagram for KDChart::TextArea:
Collaboration graph
[legend]

List of all members.

Signals

void positionChanged (TextArea *)

Public Member Functions

void alignToReferencePoint (const RelativePosition &position)
const QObjectautoReferenceArea () const
BackgroundAttributes backgroundAttributes () const
QPolygon boundingPolygon () const
bool compare (const AbstractAreaBase *other) const
 Returns true if both areas have the same settings.
virtual Qt::Orientations expandingDirections () const
 pure virtual in QLayoutItem
FrameAttributes frameAttributes () const
virtual QRect geometry () const
 pure virtual in QLayoutItem
void getFrameLeadings (int &left, int &top, int &right, int &bottom) const
virtual bool intersects (const TextLayoutItem &other, const QPointF &myPos, const QPointF &otherPos) const
virtual bool intersects (const TextLayoutItem &other, const QPoint &myPos, const QPoint &otherPos) const
virtual bool isEmpty () const
 pure virtual in QLayoutItem
virtual int marginWidth () const
virtual QSize maximumSize () const
 pure virtual in QLayoutItem
virtual QSize minimumSize () const
 pure virtual in QLayoutItem
virtual void paint (QPainter *)
void paintAll (QPainter &painter)
 Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked automatically.
virtual void paintBackground (QPainter &painter, const QRect &rectangle)
virtual void paintCtx (PaintContext *context)
 Default impl: Paint the complete item using its layouted position and size.
virtual void paintFrame (QPainter &painter, const QRect &rectangle)
virtual void paintIntoRect (QPainter &painter, const QRect &rect)
 Draws the background and frame, then calls paint().
QLayout * parentLayout ()
virtual QFont realFont () const
virtual qreal realFontSize () const
void removeFromParentLayout ()
void setAutoReferenceArea (const QObject *area)
void setBackgroundAttributes (const BackgroundAttributes &a)
void setFrameAttributes (const FrameAttributes &a)
virtual void setGeometry (const QRect &r)
 pure virtual in QLayoutItem
void setParentLayout (QLayout *lay)
virtual void setParentWidget (QWidget *widget)
 Inform the item about its widget: This enables the item, to trigger that widget's update, whenever the size of the item's contents has changed.
void setText (const QString &text)
void setTextAlignment (Qt::Alignment)
void setTextAttributes (const TextAttributes &a)
 Use this to specify the text attributes to be used for this item.
virtual QSize sizeHint () const
 pure virtual in QLayoutItem
virtual void sizeHintChanged () const
 Report changed size hint: ask the parent widget to recalculate the layout.
virtual QSize sizeHintUnrotated () const
QString text () const
Qt::Alignment textAlignment () const
TextAttributes textAttributes () const
 Returns the text attributes to be used for this item.
virtual ~TextArea ()

Static Public Member Functions

static void paintBackgroundAttributes (QPainter &painter, const QRect &rectangle, const KDChart::BackgroundAttributes &attributes)
static void paintFrameAttributes (QPainter &painter, const QRect &rectangle, const KDChart::FrameAttributes &attributes)

Protected Member Functions

virtual QRect areaGeometry () const
QRect innerRect () const
virtual void positionHasChanged ()
 TextArea ()

Protected Attributes

QWidgetmParent
QLayout * mParentLayout

Detailed Description

A text area in the chart with a background, a frame, etc.

TextArea is the base class for all text containing non-widget chart elements that have a set of background attributes and frame attributes, such as headers or footers.

Note:
This class inherits from AbstractAreaBase, TextLayoutItem, QObject. The reason for this tripple inheritance is that neither AbstractAreaBase nor TextLayoutItem are QObject.

Definition at line 47 of file KDChartTextArea.h.


Constructor & Destructor Documentation

TextArea::~TextArea ( ) [virtual]

Definition at line 57 of file KDChartTextArea.cpp.

TextArea::TextArea ( ) [protected]

Definition at line 49 of file KDChartTextArea.cpp.


Member Function Documentation

void AbstractAreaBase::alignToReferencePoint ( const RelativePosition position) [inherited]

Definition at line 81 of file KDChartAbstractAreaBase.cpp.

QRect TextArea::areaGeometry ( ) const [protected, virtual]

Implements KDChart::AbstractAreaBase.

Definition at line 102 of file KDChartTextArea.cpp.

References KDChart::TextLayoutItem::geometry().

Referenced by paintAll().

const QObject * KDChart::TextLayoutItem::autoReferenceArea ( ) const [inherited]
BackgroundAttributes AbstractAreaBase::backgroundAttributes ( ) const [inherited]

Definition at line 111 of file KDChartAbstractAreaBase.cpp.

References d.

Referenced by KDChart::AbstractAreaBase::compare(), and updateCommonBrush().

QPolygon KDChart::TextLayoutItem::boundingPolygon ( ) const [inherited]
bool AbstractAreaBase::compare ( const AbstractAreaBase other) const [inherited]

Returns true if both areas have the same settings.

Definition at line 71 of file KDChartAbstractAreaBase.cpp.

References KDChart::AbstractAreaBase::backgroundAttributes(), and KDChart::AbstractAreaBase::frameAttributes().

Qt::Orientations KDChart::TextLayoutItem::expandingDirections ( ) const [virtual, inherited]

pure virtual in QLayoutItem

Definition at line 298 of file KDChartLayoutItems.cpp.

FrameAttributes AbstractAreaBase::frameAttributes ( ) const [inherited]
QRect KDChart::TextLayoutItem::geometry ( ) const [virtual, inherited]

pure virtual in QLayoutItem

Definition at line 303 of file KDChartLayoutItems.cpp.

Referenced by areaGeometry(), paintAll(), and paintIntoRect().

void AbstractAreaBase::getFrameLeadings ( int &  left,
int &  top,
int &  right,
int &  bottom 
) const [inherited]
QRect AbstractAreaBase::innerRect ( ) const [protected, inherited]
bool KDChart::TextLayoutItem::intersects ( const TextLayoutItem other,
const QPointF &  myPos,
const QPointF &  otherPos 
) const [virtual, inherited]

Definition at line 398 of file KDChartLayoutItems.cpp.

Referenced by KDChart::CartesianAxis::paintCtx().

bool KDChart::TextLayoutItem::intersects ( const TextLayoutItem other,
const QPoint &  myPos,
const QPoint &  otherPos 
) const [virtual, inherited]
bool KDChart::TextLayoutItem::isEmpty ( ) const [virtual, inherited]

pure virtual in QLayoutItem

Definition at line 308 of file KDChartLayoutItems.cpp.

int KDChart::TextLayoutItem::marginWidth ( ) const [virtual, inherited]

Definition at line 479 of file KDChartLayoutItems.cpp.

Referenced by KDChart::CartesianAxis::paintCtx().

QSize KDChart::TextLayoutItem::maximumSize ( ) const [virtual, inherited]

pure virtual in QLayoutItem

Definition at line 313 of file KDChartLayoutItems.cpp.

QSize KDChart::TextLayoutItem::minimumSize ( ) const [virtual, inherited]

pure virtual in QLayoutItem

Definition at line 318 of file KDChartLayoutItems.cpp.

void KDChart::TextLayoutItem::paint ( QPainter *  painter) [virtual, inherited]
void TextArea::paintAll ( QPainter &  painter) [virtual]

Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked automatically.

Reimplemented from KDChart::AbstractLayoutItem.

Definition at line 80 of file KDChartTextArea.cpp.

References areaGeometry(), KDChart::TextLayoutItem::geometry(), KDChart::AbstractAreaBase::innerRect(), KDChart::TextLayoutItem::paint(), KDChart::AbstractAreaBase::paintBackground(), KDChart::AbstractAreaBase::paintFrame(), and KDChart::TextLayoutItem::setGeometry().

Referenced by paintIntoRect().

void AbstractAreaBase::paintBackground ( QPainter &  painter,
const QRect &  rectangle 
) [virtual, inherited]
void AbstractAreaBase::paintBackgroundAttributes ( QPainter &  painter,
const QRect &  rectangle,
const KDChart::BackgroundAttributes attributes 
) [static, inherited]
void KDChart::AbstractLayoutItem::paintCtx ( PaintContext context) [virtual, inherited]

Default impl: Paint the complete item using its layouted position and size.

Reimplemented in KDChart::CartesianAxis, KDChart::LeveyJenningsAxis, and KDChart::TernaryAxis.

Definition at line 72 of file KDChartLayoutItems.cpp.

References KDChart::PaintContext::painter().

void AbstractAreaBase::paintFrame ( QPainter &  painter,
const QRect &  rectangle 
) [virtual, inherited]
void AbstractAreaBase::paintFrameAttributes ( QPainter &  painter,
const QRect &  rectangle,
const KDChart::FrameAttributes attributes 
) [static, inherited]
void TextArea::paintIntoRect ( QPainter &  painter,
const QRect &  rect 
) [virtual]

Draws the background and frame, then calls paint().

In most cases there is no need to overwrite this method in a derived class, but you would overwrite TextLayoutItem::paint() instead.

Definition at line 68 of file KDChartTextArea.cpp.

References KDChart::TextLayoutItem::geometry(), paintAll(), and KDChart::TextLayoutItem::setGeometry().

QLayout* KDChart::AbstractLayoutItem::parentLayout ( ) [inherited]

Definition at line 78 of file KDChartLayoutItems.h.

void KDChart::TextArea::positionChanged ( TextArea ) [signal]

Referenced by positionHasChanged().

void TextArea::positionHasChanged ( ) [protected, virtual]

Reimplemented from KDChart::AbstractAreaBase.

Definition at line 107 of file KDChartTextArea.cpp.

References positionChanged().

QFont KDChart::TextLayoutItem::realFont ( ) const [virtual, inherited]

Definition at line 386 of file KDChartLayoutItems.cpp.

Referenced by KDChart::CartesianAxis::paintCtx().

qreal KDChart::TextLayoutItem::realFontSize ( ) const [virtual, inherited]

Definition at line 369 of file KDChartLayoutItems.cpp.

void KDChart::AbstractLayoutItem::removeFromParentLayout ( ) [inherited]

Definition at line 82 of file KDChartLayoutItems.h.

Referenced by KDChart::Chart::takeCoordinatePlane().

void KDChart::TextLayoutItem::setAutoReferenceArea ( const QObject area) [inherited]

Definition at line 232 of file KDChartLayoutItems.cpp.

Referenced by KDChart::HeaderFooter::setParent().

void AbstractAreaBase::setBackgroundAttributes ( const BackgroundAttributes a) [inherited]
void AbstractAreaBase::setFrameAttributes ( const FrameAttributes a) [inherited]
void KDChart::TextLayoutItem::setGeometry ( const QRect &  r) [virtual, inherited]

pure virtual in QLayoutItem

Definition at line 323 of file KDChartLayoutItems.cpp.

Referenced by paintAll(), KDChart::CartesianAxis::paintCtx(), and paintIntoRect().

void KDChart::AbstractLayoutItem::setParentLayout ( QLayout *  lay) [inherited]

Definition at line 74 of file KDChartLayoutItems.h.

void KDChart::AbstractLayoutItem::setParentWidget ( QWidget widget) [virtual, inherited]

Inform the item about its widget: This enables the item, to trigger that widget's update, whenever the size of the item's contents has changed.

Thus, you need to call setParentWidget on every item, that has a non-fixed size.

Definition at line 59 of file KDChartLayoutItems.cpp.

References KDChart::AbstractLayoutItem::mParent.

Referenced by KDChart::HeaderFooter::setParent(), and KDChart::AbstractCartesianDiagram::takeAxis().

void KDChart::TextLayoutItem::setText ( const QString &  text) [inherited]
void KDChart::TextLayoutItem::setTextAlignment ( Qt::Alignment  alignment) [inherited]

Definition at line 258 of file KDChartLayoutItems.cpp.

void KDChart::TextLayoutItem::setTextAttributes ( const TextAttributes a) [inherited]

Use this to specify the text attributes to be used for this item.

See also:
textAttributes

Definition at line 277 of file KDChartLayoutItems.cpp.

References KDChart::TextAttributes::font().

Referenced by KDChart::Chart::addHeaderFooter(), KDChart::HeaderFooter::clone(), and KDChart::CartesianAxis::paintCtx().

QSize KDChart::TextLayoutItem::sizeHint ( ) const [virtual, inherited]
void KDChart::AbstractLayoutItem::sizeHintChanged ( ) const [virtual, inherited]

Report changed size hint: ask the parent widget to recalculate the layout.

Definition at line 81 of file KDChartLayoutItems.cpp.

QSize KDChart::TextLayoutItem::sizeHintUnrotated ( ) const [virtual, inherited]

Definition at line 457 of file KDChartLayoutItems.cpp.

QString KDChart::TextLayoutItem::text ( ) const [inherited]
Qt::Alignment KDChart::TextLayoutItem::textAlignment ( ) const [inherited]

Definition at line 267 of file KDChartLayoutItems.cpp.

KDChart::TextAttributes KDChart::TextLayoutItem::textAttributes ( ) const [inherited]

Returns the text attributes to be used for this item.

See also:
setTextAttributes

Definition at line 292 of file KDChartLayoutItems.cpp.

Referenced by KDChart::Chart::addHeaderFooter(), KDChart::HeaderFooter::clone(), and KDChart::HeaderFooter::compare().


Member Data Documentation

Definition at line 92 of file KDChartLayoutItems.h.

Referenced by KDChart::AbstractLayoutItem::setParentWidget().

QLayout* KDChart::AbstractLayoutItem::mParentLayout [protected, inherited]

Definition at line 93 of file KDChartLayoutItems.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/
http://www.kdab.com/products/kd-chart/