KChart

KChartDiagramObserver.h
1/*
2 * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 *
4 * This file is part of the KD Chart library.
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9#ifndef __KCHARTDIAGRAMOBSERVER_H_
10#define __KCHARTDIAGRAMOBSERVER_H_
11
12#include "KChartGlobal.h"
13
14#include <QObject>
15#include <QPointer>
16#include <QModelIndex>
17
18QT_BEGIN_NAMESPACE
20QT_END_NAMESPACE
21
22namespace KChart {
23
24 class AbstractDiagram;
25
26 /**
27 * \brief A DiagramObserver watches the associated diagram for
28 * changes and deletion and emits corresponding signals.
29 */
30 class KCHART_EXPORT DiagramObserver : public QObject
31 {
32 Q_OBJECT
33 public:
34 /**
35 * Constructs a new observer observing the given diagram.
36 */
37 explicit DiagramObserver( AbstractDiagram * diagram, QObject* parent = nullptr );
38 ~DiagramObserver() override;
39
40 const AbstractDiagram* diagram() const;
41 AbstractDiagram* diagram();
42
43 Q_SIGNALS:
44 /** This signal is emitted immediately before the diagram is
45 * being destroyed. */
47 /** Emitted when a diagram is being destroyed, but before its data is invalidated **/
49 /** This signal is emitted whenever the data of the diagram changes. */
51 /** This signal is emitted whenever any of the data of the diagram was set (un)hidden. */
53 /** This signal is emitted whenever the attributes of the diagram change. */
55
56 private Q_SLOTS:
57 void slotDestroyed(QObject*);
58 void slotAboutToBeDestroyed();
59 void slotHeaderDataChanged(Qt::Orientation,int,int);
60 void slotDataChanged(QModelIndex,QModelIndex);
61 void slotDataChanged();
62 void slotDataHidden();
63 void slotAttributesChanged();
64 void slotAttributesChanged(QModelIndex,QModelIndex);
65 void slotModelsChanged();
66
67 private:
68 void init();
69
70 AbstractDiagram* m_diagram;
72 QPointer<QAbstractItemModel> m_attributesmodel;
73 };
74}
75
76#endif // KChartDiagramObserver_H
Contains KChart macros.
AbstractDiagram defines the interface for diagram classes.
A DiagramObserver watches the associated diagram for changes and deletion and emits corresponding sig...
void diagramDestroyed(KChart::AbstractDiagram *diagram)
This signal is emitted immediately before the diagram is being destroyed.
void diagramDataChanged(KChart::AbstractDiagram *diagram)
This signal is emitted whenever the data of the diagram changes.
void diagramDataHidden(KChart::AbstractDiagram *diagram)
This signal is emitted whenever any of the data of the diagram was set (un)hidden.
void diagramAboutToBeDestroyed(KChart::AbstractDiagram *diagram)
Emitted when a diagram is being destroyed, but before its data is invalidated.
void diagramAttributesChanged(KChart::AbstractDiagram *diagram)
This signal is emitted whenever the attributes of the diagram change.
Orientation
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.