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 QPointF &myPos, const QPointF &otherPos) const
 
virtual bool intersects (const TextLayoutItem &other, const QPoint &myPos, const QPoint &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

KDChart::TextLayoutItem::TextLayoutItem ( )

Definition at line 218 of file KDChartLayoutItems.cpp.

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

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

Definition at line 392 of file KDChartLayoutItems.cpp.

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

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

pure virtual in QLayoutItem

Definition at line 298 of file KDChartLayoutItems.cpp.

Referenced by KDChart::TextBubbleLayoutItem::expandingDirections().

QRect KDChart::TextLayoutItem::geometry ( ) const
override
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().

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

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

pure virtual in QLayoutItem

Definition at line 308 of file KDChartLayoutItems.cpp.

Referenced by KDChart::TextBubbleLayoutItem::isEmpty().

int KDChart::TextLayoutItem::marginWidth ( ) const
virtual
QSize KDChart::TextLayoutItem::maximumSize ( ) const
override

pure virtual in QLayoutItem

Definition at line 313 of file KDChartLayoutItems.cpp.

References sizeHint().

Referenced by KDChart::TextBubbleLayoutItem::maximumSize().

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

pure virtual in QLayoutItem

Definition at line 318 of file KDChartLayoutItems.cpp.

References sizeHint().

Referenced by KDChart::TextBubbleLayoutItem::minimumSize().

void KDChart::TextLayoutItem::paint ( QPainter *  painter)
overridevirtual
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::AbstractArea, KDChart::TextArea, and KDChart::TernaryAxis.

Definition at line 64 of file KDChartLayoutItems.cpp.

References KDChart::AbstractLayoutItem::paint().

Referenced by findSharingAxisDiagrams().

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

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::AbstractLayoutItem::paint(), and KDChart::PaintContext::painter().

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

Definition at line 77 of file KDChartLayoutItems.h.

QFont KDChart::TextLayoutItem::realFont ( ) const
virtual
qreal KDChart::TextLayoutItem::realFontSize ( ) const
virtual
void KDChart::AbstractLayoutItem::removeFromParentLayout ( )
inherited
void KDChart::TextLayoutItem::setAutoReferenceArea ( const QObject area)
void KDChart::TextLayoutItem::setGeometry ( const QRect &  r)
override
void KDChart::AbstractLayoutItem::setParentLayout ( QLayout *  lay)
inherited
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(), KDChart::AbstractCartesianDiagram::takeAxis(), and updateToplevelLayout().

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

Definition at line 258 of file KDChartLayoutItems.cpp.

References KDChart::AbstractLayoutItem::mParent.

void KDChart::TextLayoutItem::setTextAttributes ( const TextAttributes a)
QSize KDChart::TextLayoutItem::sizeHint ( ) const
override
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.

References KDChart::AbstractLayoutItem::mParent.

Referenced by sizeHint().

QSize KDChart::TextLayoutItem::sizeHintUnrotated ( ) const
virtual
QString KDChart::TextLayoutItem::text ( ) const
Qt::Alignment KDChart::TextLayoutItem::textAlignment ( ) const

Definition at line 267 of file KDChartLayoutItems.cpp.

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

Member Data Documentation

QWidget* KDChart::AbstractLayoutItem::mParent
protectedinherited
QLayout* KDChart::AbstractLayoutItem::mParentLayout
protectedinherited

Definition at line 92 of file KDChartLayoutItems.h.

Referenced by KDChart::AutoSpacerLayoutItem::paint().


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/