KD Chart 2  [rev.2.8]
KDChartDiagramObserver.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2001-2021 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 __KDCHARTDIAGRAMOBSERVER_H_
24 #define __KDCHARTDIAGRAMOBSERVER_H_
25 
26 #include "KDChartGlobal.h"
27 
28 #include <QObject>
29 #include <QPointer>
30 #include <QModelIndex>
31 
32 QT_BEGIN_NAMESPACE
33 class QAbstractItemModel;
34 QT_END_NAMESPACE
35 
36 namespace KDChart {
37 
38  class AbstractDiagram;
39 
44  class KDCHART_EXPORT DiagramObserver : public QObject
45  {
46  Q_OBJECT
47  public:
51  explicit DiagramObserver( AbstractDiagram * diagram, QObject* parent = 0 );
52  ~DiagramObserver() override;
53 
54  const AbstractDiagram* diagram() const;
55  AbstractDiagram* diagram();
56 
57  Q_SIGNALS:
69 
70  private Q_SLOTS:
71  void slotDestroyed(QObject*);
72  void slotAboutToBeDestroyed();
73  void slotHeaderDataChanged(Qt::Orientation,int,int);
74  void slotDataChanged(QModelIndex,QModelIndex);
75  void slotDataChanged();
76  void slotDataHidden();
77  void slotAttributesChanged();
78  void slotAttributesChanged(QModelIndex,QModelIndex);
79  void slotModelsChanged();
80 
81  private:
82  void init();
83 
84  AbstractDiagram* m_diagram;
85  QPointer<QAbstractItemModel> m_model;
86  QPointer<QAbstractItemModel> m_attributesmodel;
87  };
88 }
89 
90 #endif // KDChartDiagramObserver_H
KDChart::DiagramObserver
A DiagramObserver watches the associated diagram for changes and deletion and emits corresponsing sig...
Definition: KDChartDiagramObserver.h:45
KDChart::DiagramObserver::diagramDataChanged
void diagramDataChanged(AbstractDiagram *diagram)
This signal is emitted whenever the data of the diagram changes.
KDChart::DiagramObserver::diagramDataHidden
void diagramDataHidden(AbstractDiagram *diagram)
This signal is emitted whenever any of the data of the diagram was set (un)hidden.
KDChart
Definition: KDChartAbstractCartesianDiagram.h:30
KDChart::DiagramObserver::diagramAttributesChanged
void diagramAttributesChanged(AbstractDiagram *diagram)
This signal is emitted whenever the attributes of the diagram change.
KDChart::DiagramObserver::diagramDestroyed
void diagramDestroyed(AbstractDiagram *diagram)
This signal is emitted immediately before the diagram is being destroyed.
KDChartGlobal.h
KDChart::AbstractDiagram
AbstractDiagram defines the interface for diagram classes.
Definition: KDChartAbstractDiagram.h:51
QObject
KDChart::DiagramObserver::diagramAboutToBeDestroyed
void diagramAboutToBeDestroyed(AbstractDiagram *diagram)
Emitted when a diagram is being destroyed, but before its data is invalidated.

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/