KD Chart 2
[rev.2.7]
|
A header or footer displaying text above or below charts. More...
#include <KDChartHeaderFooter.h>
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 QObject * | autoReferenceArea () const |
BackgroundAttributes | backgroundAttributes () const |
QPolygon | boundingPolygon () const |
virtual HeaderFooter * | clone () 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 | |
QWidget * | mParent |
QLayout * | mParentLayout |
A header or footer displaying text above or below charts.
Definition at line 37 of file KDChartHeaderFooter.h.
Enumerator | |
---|---|
Header | |
Footer |
Definition at line 51 of file KDChartHeaderFooter.h.
HeaderFooter::HeaderFooter | ( | Chart * | parent = 0 | ) |
Definition at line 53 of file KDChartHeaderFooter.cpp.
References setParent().
Referenced by clone().
|
override |
Definition at line 60 of file KDChartHeaderFooter.cpp.
References destroyedHeaderFooter().
|
inherited |
Definition at line 81 of file KDChartAbstractAreaBase.cpp.
|
overrideprotectedvirtualinherited |
Implements KDChart::AbstractAreaBase.
Definition at line 102 of file KDChartTextArea.cpp.
References KDChart::TextLayoutItem::geometry().
Referenced by KDChart::TextArea::paintAll().
|
inherited |
Definition at line 239 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextBubbleLayoutItem::autoReferenceArea(), compare(), and setParent().
|
inherited |
Definition at line 111 of file KDChartAbstractAreaBase.cpp.
References d.
Referenced by KDChart::AbstractAreaBase::compare(), and updateCommonBrush().
|
inherited |
Definition at line 392 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextLayoutItem::intersects(), and KDChart::CartesianAxis::paintCtx().
|
virtual |
Creates an exact copy of this header/footer.
Definition at line 93 of file KDChartHeaderFooter.cpp.
References d, HeaderFooter(), position(), setPosition(), KDChart::TextLayoutItem::setText(), KDChart::TextLayoutItem::setTextAttributes(), setType(), KDChart::TextLayoutItem::text(), KDChart::TextLayoutItem::textAttributes(), and type().
bool HeaderFooter::compare | ( | const HeaderFooter & | other | ) | const |
Definition at line 103 of file KDChartHeaderFooter.cpp.
References KDChart::TextLayoutItem::autoReferenceArea(), position(), KDChart::TextLayoutItem::text(), KDChart::TextLayoutItem::textAttributes(), and type().
|
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().
|
signal |
Referenced by ~HeaderFooter().
|
overrideinherited |
pure virtual in QLayoutItem
Definition at line 298 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextBubbleLayoutItem::expandingDirections().
|
inherited |
Definition at line 97 of file KDChartAbstractAreaBase.cpp.
References d.
Referenced by KDChart::Legend::clone(), KDChart::AbstractAreaBase::compare(), and updateCommonBrush().
|
overrideinherited |
pure virtual in QLayoutItem
Definition at line 303 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextArea::areaGeometry(), KDChart::TextBubbleLayoutItem::geometry(), KDChart::TextArea::paintAll(), KDChart::TextArea::paintIntoRect(), and rotatedRect().
|
inherited |
Definition at line 213 of file KDChartAbstractAreaBase.cpp.
References d.
Referenced by KDChart::AbstractAreaBase::innerRect(), and KDChart::AbstractAreaWidget::paintAll().
|
protectedinherited |
Definition at line 225 of file KDChartAbstractAreaBase.cpp.
References KDChart::AbstractAreaBase::areaGeometry(), and KDChart::AbstractAreaBase::getFrameLeadings().
Referenced by KDChart::AbstractArea::paintAll(), and KDChart::TextArea::paintAll().
|
virtualinherited |
Definition at line 398 of file KDChartLayoutItems.cpp.
Referenced by KDChart::CartesianAxis::paintCtx().
|
virtualinherited |
Definition at line 403 of file KDChartLayoutItems.cpp.
References KDChart::TextLayoutItem::boundingPolygon().
|
overrideinherited |
pure virtual in QLayoutItem
Definition at line 308 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextBubbleLayoutItem::isEmpty().
|
virtualinherited |
Definition at line 447 of file KDChartLayoutItems.cpp.
References KDChart::TextAttributes::rotation().
Referenced by KDChart::CartesianAxis::paintCtx().
|
overrideinherited |
pure virtual in QLayoutItem
Definition at line 313 of file KDChartLayoutItems.cpp.
References KDChart::TextLayoutItem::sizeHint().
Referenced by KDChart::TextBubbleLayoutItem::maximumSize().
|
overrideinherited |
pure virtual in QLayoutItem
Definition at line 318 of file KDChartLayoutItems.cpp.
References KDChart::TextLayoutItem::sizeHint().
Referenced by KDChart::TextBubbleLayoutItem::minimumSize().
|
overridevirtualinherited |
Implements KDChart::AbstractLayoutItem.
Definition at line 490 of file KDChartLayoutItems.cpp.
References KDChart::TextAttributes::autoShrink(), KDChart::TextAttributes::pen(), KDChart::TextLayoutItem::realFont(), KDChart::TextAttributes::rotation(), KDChart::PrintingParameters::scalePen(), and KDChart::TextAttributes::textDocument().
Referenced by KDChart::TextBubbleLayoutItem::paint(), KDChart::TextArea::paintAll(), and KDChart::CartesianAxis::paintCtx().
|
overridevirtualinherited |
Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked automatically.
Reimplemented from KDChart::AbstractLayoutItem.
Definition at line 80 of file KDChartTextArea.cpp.
References KDChart::TextArea::areaGeometry(), KDChart::TextLayoutItem::geometry(), KDChart::AbstractAreaBase::innerRect(), KDChart::TextLayoutItem::paint(), KDChart::AbstractAreaBase::paintBackground(), KDChart::AbstractAreaBase::paintFrame(), and KDChart::TextLayoutItem::setGeometry().
Referenced by findSharingAxisDiagrams(), and KDChart::TextArea::paintIntoRect().
|
virtualinherited |
Definition at line 189 of file KDChartAbstractAreaBase.cpp.
References d, and KDChart::AbstractAreaBase::paintBackgroundAttributes().
Referenced by KDChart::AbstractArea::paintAll(), KDChart::TextArea::paintAll(), and KDChart::AbstractAreaWidget::paintAll().
|
staticinherited |
Definition at line 118 of file KDChartAbstractAreaBase.cpp.
References KDChart::BackgroundAttributes::BackgroundPixmapModeCentered, KDChart::BackgroundAttributes::BackgroundPixmapModeNone, KDChart::BackgroundAttributes::BackgroundPixmapModeScaled, KDChart::BackgroundAttributes::BackgroundPixmapModeStretched, KDChart::BackgroundAttributes::brush(), KDChart::BackgroundAttributes::isVisible(), KDChart::BackgroundAttributes::pixmap(), and KDChart::BackgroundAttributes::pixmapMode().
Referenced by findSharingAxisDiagrams(), and KDChart::AbstractAreaBase::paintBackground().
|
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().
|
virtualinherited |
Definition at line 205 of file KDChartAbstractAreaBase.cpp.
References d, and KDChart::AbstractAreaBase::paintFrameAttributes().
Referenced by KDChart::AbstractArea::paintAll(), KDChart::TextArea::paintAll(), and KDChart::AbstractAreaWidget::paintAll().
|
staticinherited |
Definition at line 168 of file KDChartAbstractAreaBase.cpp.
References KDChart::FrameAttributes::cornerRadius(), KDChart::FrameAttributes::isVisible(), KDChart::FrameAttributes::pen(), and KDChart::PrintingParameters::scalePen().
Referenced by findSharingAxisDiagrams(), and KDChart::AbstractAreaBase::paintFrame().
|
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().
|
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().
|
signal |
Referenced by setPosition(), and setType().
|
signalinherited |
Referenced by KDChart::TextArea::positionHasChanged().
|
overrideprotectedvirtualinherited |
Reimplemented from KDChart::AbstractAreaBase.
Definition at line 107 of file KDChartTextArea.cpp.
References KDChart::TextArea::positionChanged().
|
virtualinherited |
Definition at line 386 of file KDChartLayoutItems.cpp.
Referenced by KDChart::CartesianAxis::maximumSize(), KDChart::TextLayoutItem::paint(), KDChart::CartesianAxis::paintCtx(), rotatedRect(), and KDChart::TextLayoutItem::sizeHintUnrotated().
|
virtualinherited |
Definition at line 369 of file KDChartLayoutItems.cpp.
References KDChart::TextAttributes::calculatedFontSize().
|
inherited |
Definition at line 81 of file KDChartLayoutItems.h.
Referenced by findSharingAxisDiagrams(), KDChart::Chart::takeCoordinatePlane(), and KDChart::Chart::takeHeaderFooter().
|
inherited |
Definition at line 232 of file KDChartLayoutItems.cpp.
References KDChart::TextLayoutItem::sizeHint().
Referenced by KDChart::TextBubbleLayoutItem::setAutoReferenceArea(), and setParent().
|
inherited |
Definition at line 102 of file KDChartAbstractAreaBase.cpp.
References d, and KDChart::AbstractAreaBase::positionHasChanged().
|
inherited |
Definition at line 88 of file KDChartAbstractAreaBase.cpp.
References d, and KDChart::AbstractAreaBase::positionHasChanged().
Referenced by KDChart::Legend::clone(), and KDChart::Legend::~Legend().
|
overrideinherited |
pure virtual in QLayoutItem
Definition at line 323 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextArea::paintAll(), KDChart::CartesianAxis::paintCtx(), KDChart::TextArea::paintIntoRect(), and KDChart::TextBubbleLayoutItem::setGeometry().
void HeaderFooter::setParent | ( | QObject * | parent | ) |
Definition at line 65 of file KDChartHeaderFooter.cpp.
References KDChart::TextLayoutItem::autoReferenceArea(), KDChartEnums::MeasureCalculationModeAbsolute, KDChartEnums::MeasureOrientationMinimum, KDChart::TextLayoutItem::setAutoReferenceArea(), KDChart::Measure::setCalculationMode(), KDChart::TextAttributes::setFont(), KDChart::TextAttributes::setFontSize(), KDChart::TextAttributes::setMinimalFontSize(), KDChart::AbstractLayoutItem::setParentWidget(), KDChart::TextAttributes::setPen(), KDChart::Measure::setRelativeMode(), KDChart::TextLayoutItem::setTextAttributes(), and KDChart::Measure::setValue().
Referenced by KDChart::Widget::addHeaderFooter(), HeaderFooter(), and KDChart::Widget::replaceHeaderFooter().
|
inherited |
Definition at line 73 of file KDChartLayoutItems.h.
Referenced by KDChart::Chart::addHeaderFooter(), findSharingAxisDiagrams(), and KDChart::Chart::takeHeaderFooter().
|
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().
|
inherited |
Definition at line 244 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::mParent, KDChart::TextLayoutItem::sizeHint(), and KDChart::TextLayoutItem::text().
Referenced by KDChart::Widget::addHeaderFooter(), clone(), KDChart::CartesianAxis::paintCtx(), and KDChart::TextBubbleLayoutItem::setText().
|
inherited |
Definition at line 258 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::mParent.
|
inherited |
Use this to specify the text attributes to be used for this item.
Definition at line 277 of file KDChartLayoutItems.cpp.
References KDChart::TextAttributes::font(), KDChart::AbstractLayoutItem::mParent, and KDChart::TextLayoutItem::sizeHint().
Referenced by KDChart::Chart::addHeaderFooter(), clone(), KDChart::CartesianAxis::paintCtx(), setParent(), and KDChart::TextBubbleLayoutItem::setTextAttributes().
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().
|
overrideinherited |
pure virtual in QLayoutItem
Definition at line 411 of file KDChartLayoutItems.cpp.
References KDChart::TextAttributes::rotation(), and KDChart::AbstractLayoutItem::sizeHintChanged().
Referenced by KDChart::TextLayoutItem::maximumSize(), KDChart::CartesianAxis::maximumSize(), KDChart::TextLayoutItem::minimumSize(), KDChart::LeveyJenningsAxis::paintAsAbscissa(), KDChart::CartesianAxis::paintCtx(), KDChart::TextLayoutItem::setAutoReferenceArea(), KDChart::TextLayoutItem::setText(), KDChart::TextLayoutItem::setTextAttributes(), KDChart::TextBubbleLayoutItem::sizeHint(), and KDChart::CartesianAxis::titleSize().
|
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().
|
virtualinherited |
Definition at line 425 of file KDChartLayoutItems.cpp.
References KDChart::GlobalMeasureScaling::paintDevice(), and KDChart::TextLayoutItem::realFont().
|
inherited |
Definition at line 253 of file KDChartLayoutItems.cpp.
Referenced by clone(), compare(), KDChart::TextLayoutItem::setText(), and KDChart::TextBubbleLayoutItem::text().
|
inherited |
Definition at line 267 of file KDChartLayoutItems.cpp.
|
inherited |
Returns the text attributes to be used for this item.
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().
|
protectedinherited |
|
protectedinherited |
Definition at line 92 of file KDChartLayoutItems.h.
Referenced by KDChart::AutoSpacerLayoutItem::paint().