KD Chart 2  [rev.2.7]
Public Member Functions | Protected Attributes | List of all members
KDChart::TextLayoutItem Class Reference

Layout item showing a text. More...

#include <KDChartLayoutItems.h>

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

Public Member Functions

const QObjectautoReferenceArea () const
 
QPolygon boundingPolygon () const
 
Qt::Orientations expandingDirections () const override
 pure virtual in QLayoutItem More...
 
QRect geometry () const override
 pure virtual in QLayoutItem More...
 
virtual bool intersects (const TextLayoutItem &other, const QPoint &myPos, const QPoint &otherPos) const
 
virtual bool intersects (const TextLayoutItem &other, const QPointF &myPos, const QPointF &otherPos) const
 
bool isEmpty () const override
 pure virtual in QLayoutItem More...
 
virtual int marginWidth () const
 
QSize maximumSize () const override
 pure virtual in QLayoutItem More...
 
QSize minimumSize () const override
 pure virtual in QLayoutItem More...
 
void paint (QPainter *) override
 
virtual void paintAll (QPainter &painter)
 Default impl: just call paint. More...
 
virtual void paintCtx (PaintContext *context)
 Default impl: Paint the complete item using its layouted position and size. More...
 
QLayout * parentLayout ()
 
virtual QFont realFont () const
 
virtual qreal realFontSize () const
 
void removeFromParentLayout ()
 
void setAutoReferenceArea (const QObject *area)
 
void setGeometry (const QRect &r) override
 pure virtual in QLayoutItem More...
 
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. More...
 
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. More...
 
QSize sizeHint () const override
 pure virtual in QLayoutItem More...
 
virtual void sizeHintChanged () const
 Report changed size hint: ask the parent widget to recalculate the layout. More...
 
virtual QSize sizeHintUnrotated () const
 
QString text () const
 
Qt::Alignment textAlignment () const
 
TextAttributes textAttributes () const
 Returns the text attributes to be used for this item. More...
 
 TextLayoutItem ()
 
 TextLayoutItem (const QString &text, const TextAttributes &attributes, const QObject *autoReferenceArea, KDChartEnums::MeasureOrientation autoReferenceOrientation, Qt::Alignment alignment=0)
 

Protected Attributes

QWidgetmParent
 
QLayout * mParentLayout
 

Detailed Description

Layout item showing a text.

Definition at line 99 of file KDChartLayoutItems.h.

Constructor & Destructor Documentation

◆ TextLayoutItem() [1/2]

KDChart::TextLayoutItem::TextLayoutItem ( )

Definition at line 218 of file KDChartLayoutItems.cpp.

◆ TextLayoutItem() [2/2]

KDChart::TextLayoutItem::TextLayoutItem ( const QString &  text,
const TextAttributes attributes,
const QObject autoReferenceArea,
KDChartEnums::MeasureOrientation  autoReferenceOrientation,
Qt::Alignment  alignment = 0 
)

Definition at line 201 of file KDChartLayoutItems.cpp.

Member Function Documentation

◆ autoReferenceArea()

const QObject * KDChart::TextLayoutItem::autoReferenceArea ( ) const

◆ boundingPolygon()

QPolygon KDChart::TextLayoutItem::boundingPolygon ( ) const

Definition at line 392 of file KDChartLayoutItems.cpp.

Referenced by intersects(), and KDChart::CartesianAxis::paintCtx().

◆ expandingDirections()

Qt::Orientations KDChart::TextLayoutItem::expandingDirections ( ) const
override

pure virtual in QLayoutItem

Definition at line 298 of file KDChartLayoutItems.cpp.

◆ geometry()

QRect KDChart::TextLayoutItem::geometry ( ) const
override

◆ intersects() [1/2]

bool KDChart::TextLayoutItem::intersects ( const TextLayoutItem other,
const QPoint &  myPos,
const QPoint &  otherPos 
) const
virtual

Definition at line 403 of file KDChartLayoutItems.cpp.

References boundingPolygon().

◆ intersects() [2/2]

bool KDChart::TextLayoutItem::intersects ( const TextLayoutItem other,
const QPointF &  myPos,
const QPointF &  otherPos 
) const
virtual

Definition at line 398 of file KDChartLayoutItems.cpp.

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

◆ isEmpty()

bool KDChart::TextLayoutItem::isEmpty ( ) const
override

pure virtual in QLayoutItem

Definition at line 308 of file KDChartLayoutItems.cpp.

◆ marginWidth()

int KDChart::TextLayoutItem::marginWidth ( ) const
virtual

Definition at line 447 of file KDChartLayoutItems.cpp.

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

◆ maximumSize()

QSize KDChart::TextLayoutItem::maximumSize ( ) const
override

pure virtual in QLayoutItem

Definition at line 313 of file KDChartLayoutItems.cpp.

◆ minimumSize()

QSize KDChart::TextLayoutItem::minimumSize ( ) const
override

pure virtual in QLayoutItem

Definition at line 318 of file KDChartLayoutItems.cpp.

◆ paint()

void KDChart::TextLayoutItem::paint ( QPainter *  painter)
overridevirtual

◆ paintAll()

void KDChart::AbstractLayoutItem::paintAll ( QPainter &  painter)
virtualinherited

Default impl: just call paint.

Derived classes like KDChart::AbstractArea are providing additional action here.

Reimplemented in KDChart::TextArea, KDChart::AbstractArea, and KDChart::TernaryAxis.

Definition at line 64 of file KDChartLayoutItems.cpp.

◆ paintCtx()

void KDChart::AbstractLayoutItem::paintCtx ( PaintContext context)
virtualinherited

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

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

Definition at line 72 of file KDChartLayoutItems.cpp.

References KDChart::PaintContext::painter().

◆ parentLayout()

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

Definition at line 77 of file KDChartLayoutItems.h.

◆ realFont()

QFont KDChart::TextLayoutItem::realFont ( ) const
virtual

Definition at line 386 of file KDChartLayoutItems.cpp.

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

◆ realFontSize()

qreal KDChart::TextLayoutItem::realFontSize ( ) const
virtual

Definition at line 369 of file KDChartLayoutItems.cpp.

◆ removeFromParentLayout()

void KDChart::AbstractLayoutItem::removeFromParentLayout ( )
inherited

◆ setAutoReferenceArea()

void KDChart::TextLayoutItem::setAutoReferenceArea ( const QObject area)

Definition at line 232 of file KDChartLayoutItems.cpp.

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

◆ setGeometry()

void KDChart::TextLayoutItem::setGeometry ( const QRect &  r)
override

◆ setParentLayout()

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

◆ setParentWidget()

void KDChart::AbstractLayoutItem::setParentWidget ( QWidget widget)
virtualinherited

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().

◆ setText()

void KDChart::TextLayoutItem::setText ( const QString &  text)

◆ setTextAlignment()

void KDChart::TextLayoutItem::setTextAlignment ( Qt::Alignment  alignment)

Definition at line 258 of file KDChartLayoutItems.cpp.

◆ setTextAttributes()

void KDChart::TextLayoutItem::setTextAttributes ( const TextAttributes a)

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().

◆ sizeHint()

QSize KDChart::TextLayoutItem::sizeHint ( ) const
override

◆ sizeHintChanged()

void KDChart::AbstractLayoutItem::sizeHintChanged ( ) const
virtualinherited

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

Definition at line 81 of file KDChartLayoutItems.cpp.

◆ sizeHintUnrotated()

QSize KDChart::TextLayoutItem::sizeHintUnrotated ( ) const
virtual

Definition at line 425 of file KDChartLayoutItems.cpp.

◆ text()

QString KDChart::TextLayoutItem::text ( ) const

◆ textAlignment()

Qt::Alignment KDChart::TextLayoutItem::textAlignment ( ) const

Definition at line 267 of file KDChartLayoutItems.cpp.

◆ textAttributes()

KDChart::TextAttributes KDChart::TextLayoutItem::textAttributes ( ) const

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

◆ mParent

QWidget* KDChart::AbstractLayoutItem::mParent
protectedinherited

Definition at line 91 of file KDChartLayoutItems.h.

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

◆ mParentLayout

QLayout* KDChart::AbstractLayoutItem::mParentLayout
protectedinherited

Definition at line 92 of file KDChartLayoutItems.h.


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

Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/

https://www.kdab.com/development-resources/qt-tools/kd-chart/