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

A header or footer displaying text above or below charts. More...

#include <KDChartHeaderFooter.h>

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

Public Types

enum  HeaderFooterType {
  Header,
  Footer
}
 

Signals

void destroyedHeaderFooter (HeaderFooter *)
 
void positionChanged (HeaderFooter *)
 
void positionChanged (TextArea *)
 

Public Member Functions

void alignToReferencePoint (const RelativePosition &position)
 
const QObjectautoReferenceArea () const
 
BackgroundAttributes backgroundAttributes () const
 
QPolygon boundingPolygon () const
 
virtual HeaderFooterclone () const
 Creates an exact copy of this header/footer. More...
 
bool compare (const HeaderFooter &other) const
 
bool compare (const AbstractAreaBase *other) const
 Returns true if both areas have the same settings. More...
 
Qt::Orientations expandingDirections () const override
 pure virtual in QLayoutItem More...
 
FrameAttributes frameAttributes () const
 
QRect geometry () const override
 pure virtual in QLayoutItem More...
 
void getFrameLeadings (int &left, int &top, int &right, int &bottom) const
 
 HeaderFooter (Chart *parent=0)
 
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
 
void paintAll (QPainter &painter) override
 Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked automatically. More...
 
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. More...
 
virtual void paintFrame (QPainter &painter, const QRect &rectangle)
 
virtual void paintIntoRect (QPainter &painter, const QRect &rect)
 Draws the background and frame, then calls paint(). More...
 
QLayout * parentLayout ()
 
Position position () const
 
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)
 
void setGeometry (const QRect &r) override
 pure virtual in QLayoutItem More...
 
void setParent (QObject *parent)
 
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 setPosition (Position position)
 
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...
 
void setType (HeaderFooterType type)
 
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...
 
HeaderFooterType type () const
 
 ~HeaderFooter () override
 

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

QRect areaGeometry () const override
 
QRect innerRect () const
 
void positionHasChanged () override
 

Protected Attributes

QWidgetmParent
 
QLayout * mParentLayout
 

Detailed Description

A header or footer displaying text above or below charts.

Definition at line 37 of file KDChartHeaderFooter.h.

Member Enumeration Documentation

Enumerator
Header 
Footer 

Definition at line 51 of file KDChartHeaderFooter.h.

Constructor & Destructor Documentation

HeaderFooter::HeaderFooter ( Chart parent = 0)

Definition at line 53 of file KDChartHeaderFooter.cpp.

References setParent().

Referenced by clone().

HeaderFooter::~HeaderFooter ( )
override

Definition at line 60 of file KDChartHeaderFooter.cpp.

References destroyedHeaderFooter().

Member Function Documentation

void AbstractAreaBase::alignToReferencePoint ( const RelativePosition position)
inherited

Definition at line 81 of file KDChartAbstractAreaBase.cpp.

QRect TextArea::areaGeometry ( ) const
overrideprotectedvirtualinherited
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
HeaderFooter * HeaderFooter::clone ( ) const
virtual
bool HeaderFooter::compare ( const HeaderFooter other) const
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().

Referenced by KDChart::Legend::compare().

void KDChart::HeaderFooter::destroyedHeaderFooter ( HeaderFooter )
signal

Referenced by ~HeaderFooter().

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

pure virtual in QLayoutItem

Definition at line 298 of file KDChartLayoutItems.cpp.

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

FrameAttributes AbstractAreaBase::frameAttributes ( ) const
inherited
QRect KDChart::TextLayoutItem::geometry ( ) const
overrideinherited
void AbstractAreaBase::getFrameLeadings ( int &  left,
int &  top,
int &  right,
int &  bottom 
) const
inherited
QRect AbstractAreaBase::innerRect ( ) const
protectedinherited
bool KDChart::TextLayoutItem::intersects ( const TextLayoutItem other,
const QPointF &  myPos,
const QPointF &  otherPos 
) const
virtualinherited

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
virtualinherited
bool KDChart::TextLayoutItem::isEmpty ( ) const
overrideinherited

pure virtual in QLayoutItem

Definition at line 308 of file KDChartLayoutItems.cpp.

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

int KDChart::TextLayoutItem::marginWidth ( ) const
virtualinherited
QSize KDChart::TextLayoutItem::maximumSize ( ) const
overrideinherited

pure virtual in QLayoutItem

Definition at line 313 of file KDChartLayoutItems.cpp.

References KDChart::TextLayoutItem::sizeHint().

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

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

pure virtual in QLayoutItem

Definition at line 318 of file KDChartLayoutItems.cpp.

References KDChart::TextLayoutItem::sizeHint().

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

void KDChart::TextLayoutItem::paint ( QPainter *  painter)
overridevirtualinherited
void TextArea::paintAll ( QPainter &  painter)
overridevirtualinherited
void AbstractAreaBase::paintBackground ( QPainter &  painter,
const QRect &  rectangle 
)
virtualinherited
void AbstractAreaBase::paintBackgroundAttributes ( QPainter &  painter,
const QRect &  rectangle,
const KDChart::BackgroundAttributes attributes 
)
staticinherited
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().

void AbstractAreaBase::paintFrame ( QPainter &  painter,
const QRect &  rectangle 
)
virtualinherited
void AbstractAreaBase::paintFrameAttributes ( QPainter &  painter,
const QRect &  rectangle,
const KDChart::FrameAttributes attributes 
)
staticinherited
void TextArea::paintIntoRect ( QPainter &  painter,
const QRect &  rect 
)
virtualinherited

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(), KDChart::TextArea::paintAll(), and KDChart::TextLayoutItem::setGeometry().

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

Definition at line 77 of file KDChartLayoutItems.h.

Position HeaderFooter::position ( ) const

Definition at line 134 of file KDChartHeaderFooter.cpp.

References d.

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

void KDChart::HeaderFooter::positionChanged ( HeaderFooter )
signal

Referenced by setPosition(), and setType().

void KDChart::TextArea::positionChanged ( TextArea )
signalinherited
void TextArea::positionHasChanged ( )
overrideprotectedvirtualinherited

Reimplemented from KDChart::AbstractAreaBase.

Definition at line 107 of file KDChartTextArea.cpp.

References KDChart::TextArea::positionChanged().

QFont KDChart::TextLayoutItem::realFont ( ) const
virtualinherited
qreal KDChart::TextLayoutItem::realFontSize ( ) const
virtualinherited
void KDChart::AbstractLayoutItem::removeFromParentLayout ( )
inherited
void KDChart::TextLayoutItem::setAutoReferenceArea ( const QObject area)
inherited
void AbstractAreaBase::setBackgroundAttributes ( const BackgroundAttributes a)
inherited
void AbstractAreaBase::setFrameAttributes ( const FrameAttributes a)
inherited
void KDChart::TextLayoutItem::setGeometry ( const QRect &  r)
overrideinherited
void HeaderFooter::setParent ( QObject parent)
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 setParent(), KDChart::AbstractCartesianDiagram::takeAxis(), and updateToplevelLayout().

void HeaderFooter::setPosition ( Position  position)

Definition at line 126 of file KDChartHeaderFooter.cpp.

References d, position(), and positionChanged().

Referenced by KDChart::Widget::addHeaderFooter(), and clone().

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

Definition at line 258 of file KDChartLayoutItems.cpp.

References KDChart::AbstractLayoutItem::mParent.

void KDChart::TextLayoutItem::setTextAttributes ( const TextAttributes a)
inherited
void HeaderFooter::setType ( HeaderFooterType  type)

Definition at line 113 of file KDChartHeaderFooter.cpp.

References d, positionChanged(), and type().

Referenced by KDChart::Widget::addHeaderFooter(), and clone().

QSize KDChart::TextLayoutItem::sizeHint ( ) const
overrideinherited
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 KDChart::TextLayoutItem::sizeHint().

QSize KDChart::TextLayoutItem::sizeHintUnrotated ( ) const
virtualinherited
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(), clone(), compare(), and KDChart::TextBubbleLayoutItem::textAttributes().

HeaderFooter::HeaderFooterType HeaderFooter::type ( ) const

Definition at line 121 of file KDChartHeaderFooter.cpp.

References d.

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

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/