KChart

KChartTextArea.h
1/*
2 * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 *
4 * This file is part of the KD Chart library.
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9#ifndef KCHART_TEXT_AREA_H
10#define KCHART_TEXT_AREA_H
11
12#include <QObject>
13
14#include "KChartGlobal.h"
15#include "KChartAbstractAreaBase.h"
16#include "KChartLayoutItems.h"
17
18namespace KChart {
19
20
21/**
22 * @class TextArea KChartTextArea.h
23 * @brief A text area in the chart with a background, a frame, etc.
24 *
25 * TextArea is the base class for all text containing non-widget chart elements
26 * that have a set of background attributes and frame attributes, such as
27 * headers or footers.
28 *
29 * @note This class inherits AbstractAreaBase, TextLayoutItem, and QObject.
30 * The reason for this triple inheritance is that neither AbstractAreaBase nor
31 * TextLayoutItem inherit QObject.
32 */
33class KCHART_EXPORT TextArea : public QObject, public AbstractAreaBase, public TextLayoutItem
34{
35 Q_OBJECT
36
37 Q_DISABLE_COPY( TextArea )
38 KCHART_DECLARE_PRIVATE_DERIVED( TextArea )
39
40
41public:
42 ~TextArea() override;
43
44// virtual TextArea * clone() const = 0;
45 /**
46 * @brief Draws the background and frame, then calls paint().
47 *
48 * In most cases there is no need to overwrite this method in a derived
49 * class, but you would overwrite TextLayoutItem::paint() instead.
50 */
51 virtual void paintIntoRect( QPainter& painter, const QRect& rect );
52
53 /**
54 * Call paintAll, if you want the background and the frame to be drawn
55 * before the normal paint() is invoked automatically.
56 */
57 void paintAll( QPainter& painter ) override;
58
59protected:
60 TextArea();
61 QRect areaGeometry() const override;
62 void positionHasChanged() override;
63
64Q_SIGNALS:
65 void positionChanged( KChart::TextArea * );
66
67 //KCHART_DECLARE_PRIVATE_DERIVED(TextArea)
68}; // End of class TextArea
69
70}
71#endif // KCHART_TEXT_AREA_H
Contains KChart macros.
Base class for AbstractArea and AbstractAreaWidget: An area in the chart with a background,...
A text area in the chart with a background, a frame, etc.
Layout item showing a text.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 4 2024 12:04:17 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.