A header or even footer displaying text above or below charts. More...
#include <KDChartHeaderFooter.h>
Public Types | |
enum | HeaderFooterType { Header, Footer } |
Signals | |
void | destroyedHeaderFooter (HeaderFooter *) |
void | positionChanged (TextArea *) |
void | positionChanged (HeaderFooter *) |
Public Member Functions | |
void | alignToReferencePoint (const RelativePosition &position) |
const QObject * | autoReferenceArea () const |
BackgroundAttributes | backgroundAttributes () const |
virtual HeaderFooter * | clone () const |
Creates an exact copy of this header/footer. | |
bool | compare (const HeaderFooter &other) const |
bool | compare (const AbstractAreaBase *other) const |
Returns true if both areas have the same settings. | |
virtual Qt::Orientations | expandingDirections () const |
pure virtual in QLayoutItem | |
FrameAttributes | frameAttributes () const |
virtual QRect | geometry () const |
pure virtual in QLayoutItem | |
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 |
virtual bool | isEmpty () const |
pure virtual in QLayoutItem | |
virtual QSize | maximumSize () const |
pure virtual in QLayoutItem | |
virtual QSize | minimumSize () const |
pure virtual in QLayoutItem | |
virtual void | paint (QPainter *) |
void | paintAll (QPainter &painter) |
Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked automatically. | |
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. | |
virtual void | paintFrame (QPainter &painter, const QRect &rectangle) |
virtual void | paintIntoRect (QPainter &painter, const QRect &rect) |
Draws the background and frame, then calls paint(). | |
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) |
virtual void | setGeometry (const QRect &r) |
pure virtual in QLayoutItem | |
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. | |
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. | |
void | setType (HeaderFooterType type) |
virtual QSize | sizeHint () const |
pure virtual in QLayoutItem | |
virtual QSize | sizeHintAndRotatedCorners (QPoint &topLeftPt, QPoint &topRightPt, QPoint &bottomRightPt, QPoint &bottomLeftPt) const |
virtual void | sizeHintChanged () const |
Report changed size hint: ask the parent widget to recalculate the layout. | |
virtual QSize | sizeHintUnrotated () const |
QString | text () const |
Qt::Alignment | textAlignment () const |
TextAttributes | textAttributes () const |
Returns the text attributes to be used for this item. | |
HeaderFooterType | type () const |
virtual | ~HeaderFooter () |
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 | |
virtual QRect | areaGeometry () const |
virtual QRect | areaGeometry () const =0 |
QRect | innerRect () const |
virtual void | positionHasChanged () |
virtual void | positionHasChanged () |
Protected Attributes | |
QWidget * | mParent |
QLayout * | mParentLayout |
A header or even footer displaying text above or below charts.
Definition at line 37 of file KDChartHeaderFooter.h.
Definition at line 52 of file KDChartHeaderFooter.h.
HeaderFooter::HeaderFooter | ( | Chart * | parent = 0 |
) |
Definition at line 53 of file KDChartHeaderFooter.cpp.
References setParent().
Referenced by clone().
HeaderFooter::~HeaderFooter | ( | ) | [virtual] |
Definition at line 60 of file KDChartHeaderFooter.cpp.
References destroyedHeaderFooter().
void AbstractAreaBase::alignToReferencePoint | ( | const RelativePosition & | position | ) | [inherited] |
Definition at line 88 of file KDChartAbstractAreaBase.cpp.
QRect TextArea::areaGeometry | ( | ) | const [protected, virtual, inherited] |
Definition at line 102 of file KDChartTextArea.cpp.
References KDChart::TextLayoutItem::geometry().
Referenced by KDChart::TextArea::paintAll().
virtual QRect KDChart::AbstractAreaBase::areaGeometry | ( | ) | const [protected, pure virtual, inherited] |
Implemented in KDChart::AbstractAreaWidget.
Referenced by KDChart::AbstractAreaBase::innerRect().
const QObject * KDChart::TextLayoutItem::autoReferenceArea | ( | ) | const [inherited] |
Definition at line 242 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextBubbleLayoutItem::autoReferenceArea(), compare(), and setParent().
BackgroundAttributes AbstractAreaBase::backgroundAttributes | ( | ) | const [inherited] |
Definition at line 118 of file KDChartAbstractAreaBase.cpp.
References d.
Referenced by KDChart::AbstractAreaBase::compare(), and updateCommonBrush().
HeaderFooter * HeaderFooter::clone | ( | ) | const [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().
bool AbstractAreaBase::compare | ( | const AbstractAreaBase * | other | ) | const [inherited] |
Returns true if both areas have the same settings.
Definition at line 73 of file KDChartAbstractAreaBase.cpp.
References KDChart::AbstractAreaBase::backgroundAttributes(), and KDChart::AbstractAreaBase::frameAttributes().
void KDChart::HeaderFooter::destroyedHeaderFooter | ( | HeaderFooter * | ) | [signal] |
Referenced by ~HeaderFooter().
Qt::Orientations KDChart::TextLayoutItem::expandingDirections | ( | ) | const [virtual, inherited] |
pure virtual in QLayoutItem
Definition at line 301 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextBubbleLayoutItem::expandingDirections().
FrameAttributes AbstractAreaBase::frameAttributes | ( | ) | const [inherited] |
Definition at line 104 of file KDChartAbstractAreaBase.cpp.
References d.
Referenced by KDChart::Legend::clone(), KDChart::AbstractAreaBase::compare(), and updateCommonBrush().
QRect KDChart::TextLayoutItem::geometry | ( | ) | const [virtual, inherited] |
pure virtual in QLayoutItem
Definition at line 306 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextArea::areaGeometry(), KDChart::TextBubbleLayoutItem::geometry(), KDChart::TextLayoutItem::paint(), KDChart::TextArea::paintAll(), KDChart::CartesianAxis::paintCtx(), and KDChart::TextArea::paintIntoRect().
void AbstractAreaBase::getFrameLeadings | ( | int & | left, | |
int & | top, | |||
int & | right, | |||
int & | bottom | |||
) | const [inherited] |
Definition at line 210 of file KDChartAbstractAreaBase.cpp.
References d.
Referenced by KDChart::AbstractAreaBase::innerRect(), and KDChart::AbstractAreaWidget::paintAll().
QRect AbstractAreaBase::innerRect | ( | ) | const [protected, inherited] |
Definition at line 226 of file KDChartAbstractAreaBase.cpp.
References KDChart::AbstractAreaBase::areaGeometry(), and KDChart::AbstractAreaBase::getFrameLeadings().
Referenced by KDChart::TextArea::paintAll(), and KDChart::AbstractArea::paintAll().
bool KDChart::TextLayoutItem::intersects | ( | const TextLayoutItem & | other, | |
const QPointF & | myPos, | |||
const QPointF & | otherPos | |||
) | const [virtual, inherited] |
Definition at line 462 of file KDChartLayoutItems.cpp.
Referenced by KDChart::CartesianAxis::paintCtx().
bool KDChart::TextLayoutItem::intersects | ( | const TextLayoutItem & | other, | |
const QPoint & | myPos, | |||
const QPoint & | otherPos | |||
) | const [virtual, inherited] |
Definition at line 467 of file KDChartLayoutItems.cpp.
References PI, and KDChart::TextAttributes::rotation().
bool KDChart::TextLayoutItem::isEmpty | ( | ) | const [virtual, inherited] |
pure virtual in QLayoutItem
Definition at line 311 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextBubbleLayoutItem::isEmpty().
QSize KDChart::TextLayoutItem::maximumSize | ( | ) | const [virtual, inherited] |
pure virtual in QLayoutItem
Definition at line 316 of file KDChartLayoutItems.cpp.
References KDChart::TextLayoutItem::sizeHint().
Referenced by KDChart::TextBubbleLayoutItem::maximumSize().
QSize KDChart::TextLayoutItem::minimumSize | ( | ) | const [virtual, inherited] |
pure virtual in QLayoutItem
Definition at line 321 of file KDChartLayoutItems.cpp.
References KDChart::TextLayoutItem::sizeHint().
Referenced by KDChart::TextBubbleLayoutItem::minimumSize().
void KDChart::TextLayoutItem::paint | ( | QPainter * | painter | ) | [virtual, inherited] |
Implements KDChart::AbstractLayoutItem.
Definition at line 615 of file KDChartLayoutItems.cpp.
References KDChart::TextAttributes::autoShrink(), KDChart::TextLayoutItem::geometry(), KDChart::TextAttributes::pen(), KDChart::TextLayoutItem::realFont(), rotatedRect(), KDChart::TextAttributes::rotation(), and KDChart::PrintingParameters::scalePen().
Referenced by KDChart::TextBubbleLayoutItem::paint(), KDChart::TextArea::paintAll(), and KDChart::CartesianAxis::paintCtx().
void TextArea::paintAll | ( | QPainter & | painter | ) | [virtual, inherited] |
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 KDChart::TextArea::paintIntoRect().
void AbstractAreaBase::paintBackground | ( | QPainter & | painter, | |
const QRect & | rectangle | |||
) | [virtual, inherited] |
Definition at line 194 of file KDChartAbstractAreaBase.cpp.
References d, and KDChart::AbstractAreaBase::paintBackgroundAttributes().
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and KDChart::AbstractArea::paintAll().
void AbstractAreaBase::paintBackgroundAttributes | ( | QPainter & | painter, | |
const QRect & | rectangle, | |||
const KDChart::BackgroundAttributes & | attributes | |||
) | [static, inherited] |
Definition at line 125 of file KDChartAbstractAreaBase.cpp.
References KDChart::BackgroundAttributes::BackgroundPixmapModeCentered, KDChart::BackgroundAttributes::BackgroundPixmapModeScaled, KDChart::BackgroundAttributes::BackgroundPixmapModeStretched, KDChart::BackgroundAttributes::brush(), KDChart::BackgroundAttributes::isVisible(), KDChart::BackgroundAttributes::pixmap(), and KDChart::BackgroundAttributes::pixmapMode().
Referenced by KDChart::AbstractAreaBase::paintBackground().
void KDChart::AbstractLayoutItem::paintCtx | ( | PaintContext * | context | ) | [virtual, inherited] |
Default impl: Paint the complete item using its layouted position and size.
Reimplemented in KDChart::CartesianAxis, KDChart::LeveyJenningsAxis, and KDChart::TernaryAxis.
Definition at line 75 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::paint(), and KDChart::PaintContext::painter().
void AbstractAreaBase::paintFrame | ( | QPainter & | painter, | |
const QRect & | rectangle | |||
) | [virtual, inherited] |
Definition at line 202 of file KDChartAbstractAreaBase.cpp.
References d, and KDChart::AbstractAreaBase::paintFrameAttributes().
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and KDChart::AbstractArea::paintAll().
void AbstractAreaBase::paintFrameAttributes | ( | QPainter & | painter, | |
const QRect & | rectangle, | |||
const KDChart::FrameAttributes & | attributes | |||
) | [static, inherited] |
Definition at line 175 of file KDChartAbstractAreaBase.cpp.
References KDChart::FrameAttributes::isVisible(), KDChart::FrameAttributes::pen(), and KDChart::PrintingParameters::scalePen().
Referenced by KDChart::AbstractAreaBase::paintFrame().
void TextArea::paintIntoRect | ( | QPainter & | painter, | |
const QRect & | rect | |||
) | [virtual, inherited] |
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 76 of file KDChartLayoutItems.h.
Position HeaderFooter::position | ( | ) | const |
Definition at line 130 of file KDChartHeaderFooter.cpp.
References d.
void KDChart::TextArea::positionChanged | ( | TextArea * | ) | [signal, inherited] |
Referenced by KDChart::TextArea::positionHasChanged().
void KDChart::HeaderFooter::positionChanged | ( | HeaderFooter * | ) | [signal] |
Referenced by setPosition(), and setType().
void TextArea::positionHasChanged | ( | ) | [protected, virtual, inherited] |
Definition at line 107 of file KDChartTextArea.cpp.
References KDChart::TextArea::positionChanged().
void AbstractAreaBase::positionHasChanged | ( | ) | [protected, virtual, inherited] |
Reimplemented in KDChart::AbstractAreaWidget.
Definition at line 238 of file KDChartAbstractAreaBase.cpp.
Referenced by KDChart::AbstractAreaBase::setBackgroundAttributes(), and KDChart::AbstractAreaBase::setFrameAttributes().
QFont KDChart::TextLayoutItem::realFont | ( | ) | const [virtual, inherited] |
Definition at line 439 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextLayoutItem::paint(), and KDChart::CartesianAxis::paintCtx().
qreal KDChart::TextLayoutItem::realFontSize | ( | ) | const [virtual, inherited] |
Definition at line 419 of file KDChartLayoutItems.cpp.
References KDChart::TextAttributes::calculatedFontSize().
void KDChart::AbstractLayoutItem::removeFromParentLayout | ( | ) | [inherited] |
Definition at line 80 of file KDChartLayoutItems.h.
Referenced by KDChart::Chart::takeCoordinatePlane().
void KDChart::TextLayoutItem::setAutoReferenceArea | ( | const QObject * | area | ) | [inherited] |
Definition at line 235 of file KDChartLayoutItems.cpp.
References KDChart::TextLayoutItem::sizeHint().
Referenced by KDChart::TextBubbleLayoutItem::setAutoReferenceArea(), and setParent().
void AbstractAreaBase::setBackgroundAttributes | ( | const BackgroundAttributes & | a | ) | [inherited] |
Definition at line 109 of file KDChartAbstractAreaBase.cpp.
References d, and KDChart::AbstractAreaBase::positionHasChanged().
void AbstractAreaBase::setFrameAttributes | ( | const FrameAttributes & | a | ) | [inherited] |
Definition at line 95 of file KDChartAbstractAreaBase.cpp.
References d, and KDChart::AbstractAreaBase::positionHasChanged().
Referenced by KDChart::Legend::clone().
void KDChart::TextLayoutItem::setGeometry | ( | const QRect & | r | ) | [virtual, inherited] |
pure virtual in QLayoutItem
Definition at line 326 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(), KDChart::TextLayoutItem::setAutoReferenceArea(), and KDChart::AbstractLayoutItem::setParentWidget().
Referenced by KDChart::Widget::addHeaderFooter(), KDChart::Chart::addHeaderFooter(), HeaderFooter(), KDChart::Widget::replaceHeaderFooter(), and KDChart::Chart::takeHeaderFooter().
void KDChart::AbstractLayoutItem::setParentLayout | ( | QLayout * | lay | ) | [inherited] |
Definition at line 72 of file KDChartLayoutItems.h.
void KDChart::AbstractLayoutItem::setParentWidget | ( | QWidget * | widget | ) | [virtual, inherited] |
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 62 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::mParent.
Referenced by setParent(), and KDChart::AbstractCartesianDiagram::takeAxis().
void HeaderFooter::setPosition | ( | Position | position | ) |
Definition at line 124 of file KDChartHeaderFooter.cpp.
References d, and positionChanged().
Referenced by KDChart::Widget::addHeaderFooter(), and clone().
void KDChart::TextLayoutItem::setText | ( | const QString & | text | ) | [inherited] |
Definition at line 247 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::mParent, and KDChart::TextLayoutItem::sizeHint().
Referenced by KDChart::Widget::addHeaderFooter(), clone(), KDChart::CartesianAxis::paintCtx(), and KDChart::TextBubbleLayoutItem::setText().
void KDChart::TextLayoutItem::setTextAlignment | ( | Qt::Alignment | alignment | ) | [inherited] |
Definition at line 261 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::mParent.
void KDChart::TextLayoutItem::setTextAttributes | ( | const TextAttributes & | a | ) | [inherited] |
Use this to specify the text attributes to be used for this item.
Definition at line 280 of file KDChartLayoutItems.cpp.
References KDChart::TextAttributes::font(), KDChart::AbstractLayoutItem::mParent, and KDChart::TextLayoutItem::sizeHint().
Referenced by clone(), and KDChart::TextBubbleLayoutItem::setTextAttributes().
void HeaderFooter::setType | ( | HeaderFooterType | type | ) |
Definition at line 113 of file KDChartHeaderFooter.cpp.
References d, and positionChanged().
Referenced by KDChart::Widget::addHeaderFooter(), and clone().
QSize KDChart::TextLayoutItem::sizeHint | ( | ) | const [virtual, inherited] |
pure virtual in QLayoutItem
Definition at line 510 of file KDChartLayoutItems.cpp.
References KDChart::TextLayoutItem::sizeHintAndRotatedCorners().
Referenced by KDChart::TextLayoutItem::maximumSize(), KDChart::TextLayoutItem::minimumSize(), KDChart::CartesianAxis::paintCtx(), KDChart::TextLayoutItem::setAutoReferenceArea(), KDChart::TextLayoutItem::setText(), KDChart::TextLayoutItem::setTextAttributes(), and KDChart::TextBubbleLayoutItem::sizeHint().
QSize KDChart::TextLayoutItem::sizeHintAndRotatedCorners | ( | QPoint & | topLeftPt, | |
QPoint & | topRightPt, | |||
QPoint & | bottomRightPt, | |||
QPoint & | bottomLeftPt | |||
) | const [virtual, inherited] |
Definition at line 516 of file KDChartLayoutItems.cpp.
References KDChart::TextAttributes::rotation(), and KDChart::AbstractLayoutItem::sizeHintChanged().
Referenced by KDChart::CartesianAxis::paintCtx(), and KDChart::TextLayoutItem::sizeHint().
void KDChart::AbstractLayoutItem::sizeHintChanged | ( | ) | const [virtual, inherited] |
Report changed size hint: ask the parent widget to recalculate the layout.
Definition at line 84 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::mParent.
Referenced by KDChart::TextLayoutItem::sizeHintAndRotatedCorners().
QSize KDChart::TextLayoutItem::sizeHintUnrotated | ( | ) | const [virtual, inherited] |
Definition at line 541 of file KDChartLayoutItems.cpp.
Referenced by KDChart::CartesianAxis::paintCtx().
QString KDChart::TextLayoutItem::text | ( | ) | const [inherited] |
Definition at line 256 of file KDChartLayoutItems.cpp.
Referenced by clone(), compare(), KDChart::CartesianAxis::paintCtx(), and KDChart::TextBubbleLayoutItem::text().
Qt::Alignment KDChart::TextLayoutItem::textAlignment | ( | ) | const [inherited] |
Definition at line 270 of file KDChartLayoutItems.cpp.
KDChart::TextAttributes KDChart::TextLayoutItem::textAttributes | ( | ) | const [inherited] |
Returns the text attributes to be used for this item.
Definition at line 295 of file KDChartLayoutItems.cpp.
Referenced by clone(), compare(), and KDChart::TextBubbleLayoutItem::textAttributes().
HeaderFooter::HeaderFooterType HeaderFooter::type | ( | ) | const |
Definition at line 119 of file KDChartHeaderFooter.cpp.
References d.
QWidget* KDChart::AbstractLayoutItem::mParent [protected, inherited] |
QLayout* KDChart::AbstractLayoutItem::mParentLayout [protected, inherited] |
Definition at line 91 of file KDChartLayoutItems.h.
Referenced by KDChart::AutoSpacerLayoutItem::paint().