KD Chart API Documentation 3.1
Loading...
Searching...
No Matches
KDChartTextArea.cpp
Go to the documentation of this file.
1/****************************************************************************
2**
3** This file is part of the KD Chart library.
4**
5** SPDX-FileCopyrightText: 2001 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6**
7** SPDX-License-Identifier: MIT
8**
9****************************************************************************/
10
11#include "KDChartTextArea.h"
12#include "KDChartTextArea_p.h"
13
14#include <qglobal.h>
15
16#include <QPainter>
17#include <QRect>
18
19#include <KDABLibFakes>
20
21using namespace KDChart;
22
23TextArea::Private::Private()
24 : AbstractAreaBase::Private()
25{
26 // this block left empty intentionally
27}
28
29TextArea::Private::~Private()
30{
31 // this block left empty intentionally
32}
33
35 : QObject()
38{
39 // this block left empty intentionally
40}
41
43{
44 // this block left empty intentionally
45}
46
47void TextArea::init()
48{
49 // this block left empty intentionally
50}
51
52void TextArea::paintIntoRect(QPainter &painter, const QRect &rect)
53{
54 const QRect oldGeometry(geometry());
55 if (oldGeometry != rect)
56 setGeometry(rect);
57 painter.translate(rect.left(), rect.top());
58 paintAll(painter);
59 painter.translate(-rect.left(), -rect.top());
60 if (oldGeometry != rect)
62}
63
65{
66 // Paint the background and frame
67 paintBackground(painter, geometry());
68 paintFrame(painter, geometry());
69
70 // temporarily adjust the widget size, to be sure all content gets calculated
71 // to fit into the inner rectangle
74 inner.moveTo(
75 oldGeometry.left() + inner.left(),
76 oldGeometry.top() + inner.top());
77 const bool needAdjustGeometry = oldGeometry != inner;
80 paint(&painter);
83 // qDebug() << "TextAreaWidget::paintAll() done.";
84}
85
87{
88 return geometry();
89}
90
Base class for AbstractArea and AbstractAreaWidget: An area in the chart with a background,...
virtual void paintFrame(QPainter &painter, const QRect &rectangle)
virtual void paintBackground(QPainter &painter, const QRect &rectangle)
virtual void paintIntoRect(QPainter &painter, const QRect &rect)
Draws the background and frame, then calls paint().
QRect areaGeometry() const override
void positionHasChanged() override
void paintAll(QPainter &painter) override
void positionChanged(TextArea *)
void paint(QPainter *) override
void setGeometry(const QRect &r) override
QRect geometry() const override
Q_EMITQ_EMIT
T qobject_cast(QObject *object)
void translate(const QPointF &offset)
int left() const const
int top() const const

© 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 Wed May 1 2024 00:01:10 for KD Chart API Documentation by doxygen 1.9.8