KChart

KChartDiagramObserver.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 __KCHARTDIAGRAMOBSERVER_H_
21 #define __KCHARTDIAGRAMOBSERVER_H_
22 
23 #include "KChartGlobal.h"
24 
25 #include <QObject>
26 #include <QPointer>
27 #include <QModelIndex>
28 
29 QT_BEGIN_NAMESPACE
30 class QAbstractItemModel;
31 QT_END_NAMESPACE
32 
33 namespace KChart {
34 
35  class AbstractDiagram;
36 
41  class KCHART_EXPORT DiagramObserver : public QObject
42  {
43  Q_OBJECT
44  public:
48  explicit DiagramObserver( AbstractDiagram * diagram, QObject* parent = nullptr );
49  ~DiagramObserver();
50 
51  const AbstractDiagram* diagram() const;
52  AbstractDiagram* diagram();
53 
54  Q_SIGNALS:
57  void diagramDestroyed( AbstractDiagram* diagram );
59  void diagramAboutToBeDestroyed( AbstractDiagram* diagram );
61  void diagramDataChanged( AbstractDiagram* diagram );
63  void diagramDataHidden( AbstractDiagram* diagram );
65  void diagramAttributesChanged( AbstractDiagram* diagram );
66 
67  private Q_SLOTS:
68  void slotDestroyed(QObject*);
69  void slotAboutToBeDestroyed();
70  void slotHeaderDataChanged(Qt::Orientation,int,int);
71  void slotDataChanged(QModelIndex,QModelIndex);
72  void slotDataChanged();
73  void slotDataHidden();
74  void slotAttributesChanged();
75  void slotAttributesChanged(QModelIndex,QModelIndex);
76  void slotModelsChanged();
77 
78  private:
79  void init();
80 
81  AbstractDiagram* m_diagram;
83  QPointer<QAbstractItemModel> m_attributesmodel;
84  };
85 }
86 
87 #endif // KChartDiagramObserver_H
AbstractDiagram defines the interface for diagram classes.
Class only listed here to document inheritance of some KChart classes.
Contains KChart macros.
A DiagramObserver watches the associated diagram for changes and deletion and emits corresponsing sig...
QCA_EXPORT void init()
Orientation
Global namespace.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Sep 17 2020 22:36:39 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.