KD Chart 2  [rev.2.7]
KDChartAbstractAreaBase.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2001-2020 Klaralvdalens Datakonsult AB. All rights reserved.
3 **
4 ** This file is part of the KD Chart library.
5 **
6 ** Licensees holding valid commercial KD Chart licenses may use this file in
7 ** accordance with the KD Chart Commercial License Agreement provided with
8 ** the Software.
9 **
10 **
11 ** This file may be distributed and/or modified under the terms of the
12 ** GNU General Public License version 2 and version 3 as published by the
13 ** Free Software Foundation and appearing in the file LICENSE.GPL.txt included.
14 **
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 **
18 ** Contact info@kdab.com if any conditions of this licensing are not
19 ** clear to you.
20 **
21 **********************************************************************/
22 
23 #ifndef KDCHARTABSTRACTAREABASE_H
24 #define KDCHARTABSTRACTAREABASE_H
25 
26 #include <QPointF>
27 #include <QSizeF>
28 #include <QRectF>
29 
30 #include "KDChartGlobal.h"
31 #include "KDChartLayoutItems.h"
34 
35 
36 QT_BEGIN_NAMESPACE
37 class QPainter;
38 class QString;
39 QT_END_NAMESPACE
40 
41 namespace KDChart {
42  class TextAttributes;
43  class BackgroundAttributes;
44  class FrameAttributes;
45  class PaintContext;
46 
47 
65 class KDCHART_EXPORT AbstractAreaBase
66 {
67  Q_DISABLE_COPY( AbstractAreaBase )
69 
70 protected:
72  virtual ~AbstractAreaBase() ;
73 
74 public:
78  bool compare( const AbstractAreaBase* other ) const;
79 
80  void alignToReferencePoint( const RelativePosition& position );
81 
82  void setFrameAttributes( const FrameAttributes &a );
83  FrameAttributes frameAttributes() const;
84 
85  void setBackgroundAttributes( const BackgroundAttributes &a );
86  BackgroundAttributes backgroundAttributes() const;
87 
88  virtual void paintBackground( QPainter& painter, const QRect& rectangle );
89  virtual void paintFrame( QPainter& painter, const QRect& rectangle );
90 
91  static void paintBackgroundAttributes( QPainter& painter, const QRect& rectangle,
92  const KDChart::BackgroundAttributes& attributes );
93  static void paintFrameAttributes( QPainter& painter, const QRect& rectangle,
94  const KDChart::FrameAttributes& attributes );
95 
101  void getFrameLeadings(int& left, int& top, int& right, int& bottom ) const;
102 
103 
104 protected:
110  QRect innerRect() const;
111 
117  virtual QRect areaGeometry() const = 0;
118 
125  virtual void positionHasChanged();
126 
127 }; // End of class AbstractAreaBase
128 
129 }
130 #endif // KDCHARTABSTRACTAREABASE_H
A set of attributes for frames around items.
#define KDCHART_DECLARE_PRIVATE_BASE_POLYMORPHIC(X)
Definition: KDChartGlobal.h:82
Base class for AbstractArea and AbstractAreaWidget: An area in the chart with a background, a frame, etc.
Defines relative position information: reference area, position in this area (reference position)...
Set of attributes usable for background pixmaps.

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/