KChart

KChartAbstractAreaWidget.h
1 /*
2  * Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3  *
4  * This file is part of the KD Chart library.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <https://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef KCHARTABSTRACTAREAWIDGET_H
21 #define KCHARTABSTRACTAREAWIDGET_H
22 
23 #include <QWidget>
24 #include <QPaintEvent>
25 #include <QPainter>
26 #include <QRect>
27 
28 #include "KChartAbstractAreaBase.h"
29 
30 namespace KChart {
31 
32 
41 class KCHART_EXPORT AbstractAreaWidget : public QWidget, public AbstractAreaBase
42 {
43  Q_OBJECT
44 
45  Q_DISABLE_COPY( AbstractAreaWidget )
46  KCHART_DECLARE_PRIVATE_DERIVED_QWIDGET( AbstractAreaWidget )
47 
48 public:
49  explicit AbstractAreaWidget( QWidget* parent = nullptr );
50 
58  void paintEvent( QPaintEvent* event ) override;
59 
66  virtual void paintIntoRect( QPainter& painter, const QRect& rect );
67 
79  virtual void paint( QPainter* painter ) = 0;
80 
85  void paintAll( QPainter& painter );
86 
90  virtual void forceRebuild();
91 
97  virtual void needSizeHint();
98  virtual void resizeLayout( const QSize& );
99 
100 Q_SIGNALS:
101  void positionChanged( AbstractAreaWidget * );
102 
103 protected:
104  virtual ~AbstractAreaWidget() ;
105  QRect areaGeometry() const override;
106  void positionHasChanged() override;
107 };
108 
109 }
110 #endif // KCHARTABSTRACTAREAWIDGET_H
Class only listed here to document inheritance of some KChart classes.
Base class for AbstractArea and AbstractAreaWidget: An area in the chart with a background, a frame, etc.
An area in the chart with a background, a frame, etc.
Global namespace.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Sep 18 2020 22:36:21 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.