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

#include <KDChartLayoutItems.h>

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

Public Member Functions

 AbstractLayoutItem (Qt::Alignment itemAlignment={})
 
virtual void paint (QPainter *)=0
 
virtual void paintAll (QPainter &painter)
 
virtual void paintCtx (PaintContext *context)
 
QLayoutparentLayout ()
 
void removeFromParentLayout ()
 
void setParentLayout (QLayout *lay)
 
virtual void setParentWidget (QWidget *widget)
 
virtual void sizeHintChanged () const
 
- Public Member Functions inherited from QLayoutItem
 QLayoutItem (Qt::Alignment alignment)
 
virtual ~QLayoutItem ()
 
Qt::Alignment alignment () const const
 
virtual QSizePolicy::ControlTypes controlTypes () const const
 
virtual Qt::Orientations expandingDirections () const const=0
 
virtual QRect geometry () const const=0
 
virtual bool hasHeightForWidth () const const
 
virtual int heightForWidth (int) const const
 
virtual void invalidate ()
 
virtual bool isEmpty () const const=0
 
virtual QLayoutlayout ()
 
virtual QSize maximumSize () const const=0
 
virtual int minimumHeightForWidth (int w) const const
 
virtual QSize minimumSize () const const=0
 
void setAlignment (Qt::Alignment alignment)
 
virtual void setGeometry (const QRect &r)=0
 
virtual QSize sizeHint () const const=0
 
virtual QSpacerItemspacerItem ()
 
virtual QWidgetwidget ()
 

Protected Attributes

QWidgetmParent = nullptr
 
QLayoutmParentLayout = 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::TernaryAxis, KDChart::AbstractArea, and KDChart::TextArea.

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::CartesianAxis, KDChart::LeveyJenningsAxis, and KDChart::TernaryAxis.

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

Definition at line 61 of file KDChartLayoutItems.h.

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

◆ 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, and QLayoutItem::widget().

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.

References QEvent::LayoutRequest, and QCoreApplication::postEvent().

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 on Fri Apr 26 2024 00:04:57 for KD Chart API Documentation by doxygen 1.9.8