27 #include <KDABLibFakes> 34 :
QObject( parent ), m_diagram( diagram )
37 connect( m_diagram, SIGNAL(destroyed(
QObject*)), SLOT(slotDestroyed(
QObject*)));
38 connect( m_diagram, SIGNAL(aboutToBeDestroyed()), SLOT(slotAboutToBeDestroyed()));
39 connect( m_diagram, SIGNAL(modelsChanged()), SLOT(slotModelsChanged()));
59 void DiagramObserver::init()
67 if ( m_attributesmodel )
68 disconnect(m_attributesmodel);
70 const bool con = connect( m_diagram, SIGNAL( viewportCoordinateSystemChanged() ),
this, SLOT( slotDataChanged() ) );
73 connect( m_diagram, SIGNAL(dataHidden()), SLOT(slotDataHidden()) );
75 if ( m_diagram->model() ) {
76 connect( m_diagram->model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)),
77 SLOT(slotDataChanged(QModelIndex,QModelIndex)));
78 connect( m_diagram->model(), SIGNAL(rowsInserted(QModelIndex,
int,
int)),
79 SLOT(slotDataChanged()));
80 connect( m_diagram->model(), SIGNAL(columnsInserted(QModelIndex,
int,
int)),
81 SLOT(slotDataChanged()));
82 connect( m_diagram->model(), SIGNAL(rowsRemoved(QModelIndex,
int,
int)),
83 SLOT(slotDataChanged()));
84 connect( m_diagram->model(), SIGNAL(columnsRemoved(QModelIndex,
int,
int)),
85 SLOT(slotDataChanged()));
86 connect( m_diagram->model(), SIGNAL(modelReset()),
87 SLOT(slotDataChanged()));
88 connect( m_diagram->model(), SIGNAL(headerDataChanged(Qt::Orientation,
int,
int)),
89 SLOT(slotHeaderDataChanged(Qt::Orientation,
int,
int)));
93 connect( m_diagram->
attributesModel(), SIGNAL(attributesChanged(QModelIndex,QModelIndex)),
94 SLOT(slotAttributesChanged(QModelIndex,QModelIndex)));
95 m_model = m_diagram->model();
100 void DiagramObserver::slotDestroyed(
QObject*)
105 disconnect( m_diagram, 0,
this, 0);
110 void DiagramObserver::slotAboutToBeDestroyed()
115 void DiagramObserver::slotModelsChanged()
119 slotAttributesChanged();
122 void DiagramObserver::slotHeaderDataChanged(Qt::Orientation,
int,
int)
128 void DiagramObserver::slotDataChanged(QModelIndex,QModelIndex)
133 void DiagramObserver::slotDataChanged()
139 void DiagramObserver::slotDataHidden()
145 void DiagramObserver::slotAttributesChanged(QModelIndex,QModelIndex)
147 slotAttributesChanged();
150 void DiagramObserver::slotAttributesChanged()
void diagramAttributesChanged(AbstractDiagram *diagram)
This signal is emitted whenever the attributes of the diagram change.
DiagramObserver(AbstractDiagram *diagram, QObject *parent=0)
Constructs a new observer observing the given diagram.
~DiagramObserver() override
void diagramDestroyed(AbstractDiagram *diagram)
This signal is emitted immediately before the diagram is being destroyed.
virtual AttributesModel * attributesModel() const
Returns the AttributesModel, that is used by this diagram.
AbstractDiagram defines the interface for diagram classes.
void diagramDataHidden(AbstractDiagram *diagram)
This signal is emitted whenever any of the data of the diagram was set (un)hidden.
Class only listed here to document inheritance of some KDChart classes.
const AbstractDiagram * diagram() const
void diagramDataChanged(AbstractDiagram *diagram)
This signal is emitted whenever the data of the diagram changes.
void diagramAboutToBeDestroyed(AbstractDiagram *diagram)
Emitted when a diagram is being destroyed, but before its data is invalidated.