KD Chart 2  [rev.2.5.1]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
KDChartDiagramObserver.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2001-2013 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();
53 
54  const AbstractDiagram* diagram() const;
55  AbstractDiagram* diagram();
56 
57  Q_SIGNALS:
60  void diagramDestroyed( AbstractDiagram* diagram );
62  void diagramAboutToBeDestroyed( AbstractDiagram* diagram );
64  void diagramDataChanged( AbstractDiagram* diagram );
66  void diagramDataHidden( AbstractDiagram* diagram );
68  void diagramAttributesChanged( AbstractDiagram* diagram );
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

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/
http://www.kdab.com/products/kd-chart/