KD Chart API Documentation  3.1
Public Member Functions | Protected Attributes | List of all members
KDChart::AbstractLayoutItem Class Referenceabstract

#include <KDChartLayoutItems.h>

Inheritance diagram for KDChart::AbstractLayoutItem:
KDChart::AbstractArea KDChart::AutoSpacerLayoutItem KDChart::HorizontalLineLayoutItem KDChart::LineLayoutItem KDChart::LineWithMarkerLayoutItem KDChart::MarkerLayoutItem KDChart::TextBubbleLayoutItem KDChart::TextLayoutItem KDChart::VerticalLineLayoutItem

Public Member Functions

 AbstractLayoutItem (Qt::Alignment itemAlignment={})
 
virtual void paint (QPainter *)=0
 
virtual void paintAll (QPainter &painter)
 
virtual void paintCtx (PaintContext *context)
 
QLayout * parentLayout ()
 
void removeFromParentLayout ()
 
void setParentLayout (QLayout *lay)
 
virtual void setParentWidget (QWidget *widget)
 
virtual void sizeHintChanged () const
 

Protected Attributes

QWidget * mParent = nullptr
 
QLayout * mParentLayout = nullptr
 

Detailed Description

Base class for all layout items of KD Chart

Definition at line 39 of file KDChartLayoutItems.h.

Constructor & Destructor Documentation

◆ AbstractLayoutItem()

KDChart::AbstractLayoutItem::AbstractLayoutItem ( Qt::Alignment  itemAlignment = {})
inline

Definition at line 42 of file KDChartLayoutItems.h.

Member Function Documentation

◆ paint()

virtual void KDChart::AbstractLayoutItem::paint ( QPainter *  )
pure virtual

◆ paintAll()

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

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 51 of file KDChartLayoutItems.cpp.

◆ paintCtx()

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

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

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

Definition at line 59 of file KDChartLayoutItems.cpp.

References KDChart::PaintContext::painter().

◆ parentLayout()

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

Definition at line 65 of file KDChartLayoutItems.h.

◆ removeFromParentLayout()

void KDChart::AbstractLayoutItem::removeFromParentLayout ( )
inline

◆ setParentLayout()

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

◆ setParentWidget()

void KDChart::AbstractLayoutItem::setParentWidget ( QWidget *  widget)
virtual

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 46 of file KDChartLayoutItems.cpp.

References mParent.

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

◆ sizeHintChanged()

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

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

Definition at line 68 of file KDChartLayoutItems.cpp.

Member Data Documentation

◆ mParent

QWidget* KDChart::AbstractLayoutItem::mParent = nullptr
protected

Definition at line 80 of file KDChartLayoutItems.h.

Referenced by setParentWidget().

◆ mParentLayout

QLayout* KDChart::AbstractLayoutItem::mParentLayout = nullptr
protected

Definition at line 81 of file KDChartLayoutItems.h.


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

© 2001 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/
Generated by doxygen 1.9.1