KD Chart 2  [rev.2.7]
KDChartModelDataCache_p.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2001-2020 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 #include "KDChartModelDataCache_p.h"
24 
25 #include <limits>
26 
27 using namespace KDChart::ModelDataCachePrivate;
28 
29 ModelSignalMapperConnector::ModelSignalMapperConnector( ModelSignalMapper& mapper )
30  : QObject( 0 ),
31  m_mapper( mapper )
32 {
33 }
34 
35 ModelSignalMapperConnector::~ModelSignalMapperConnector()
36 {
37 }
38 
39 void ModelSignalMapperConnector::connectSignals( QAbstractItemModel* model )
40 {
41  connect( model, SIGNAL( destroyed() ), this, SLOT( resetModel() ) );
42  connect( model, SIGNAL( columnsInserted( QModelIndex, int, int ) ), this, SLOT( columnsInserted( QModelIndex, int, int ) ) );
43  connect( model, SIGNAL( columnsRemoved( QModelIndex, int, int ) ), this, SLOT( columnsRemoved( QModelIndex, int, int ) ) );
44  connect( model, SIGNAL( dataChanged( QModelIndex, QModelIndex ) ), this, SLOT( dataChanged( QModelIndex, QModelIndex ) ) );
45  connect( model, SIGNAL( layoutChanged() ), this, SLOT( layoutChanged() ) );
46  connect( model, SIGNAL( modelReset() ), this, SLOT( modelReset() ) );
47  connect( model, SIGNAL( rowsInserted( QModelIndex, int, int ) ), this, SLOT( rowsInserted( QModelIndex, int, int )) );
48  connect( model, SIGNAL( rowsRemoved( QModelIndex, int, int ) ), this, SLOT( rowsRemoved( QModelIndex, int, int ) ) );
49 }
50 
51 void ModelSignalMapperConnector::disconnectSignals( QAbstractItemModel* model )
52 {
53  disconnect( model, SIGNAL( destroyed() ), this, SLOT( resetModel() ) );
54  disconnect( model, SIGNAL( columnsInserted( QModelIndex, int, int ) ), this, SLOT( columnsInserted( QModelIndex, int, int ) ) );
55  disconnect( model, SIGNAL( columnsRemoved( QModelIndex, int, int ) ), this, SLOT( columnsRemoved( QModelIndex, int, int ) ) );
56  disconnect( model, SIGNAL( dataChanged( QModelIndex, QModelIndex ) ), this, SLOT( dataChanged( QModelIndex, QModelIndex ) ) );
57  disconnect( model, SIGNAL( layoutChanged() ), this, SLOT( layoutChanged() ) );
58  disconnect( model, SIGNAL( modelReset() ), this, SLOT( modelReset() ) );
59  disconnect( model, SIGNAL( rowsInserted( QModelIndex, int, int ) ), this, SLOT( rowsInserted( QModelIndex, int, int )) );
60  disconnect( model, SIGNAL( rowsRemoved( QModelIndex, int, int ) ), this, SLOT( rowsRemoved( QModelIndex, int, int ) ) );
61 }
62 
63 void ModelSignalMapperConnector::resetModel()
64 {
65  m_mapper.resetModel();
66 }
67 
68 void ModelSignalMapperConnector::columnsInserted( const QModelIndex& parent, int start, int end )
69 {
70  m_mapper.columnsInserted( parent, start, end );
71 }
72 
73 void ModelSignalMapperConnector::columnsRemoved( const QModelIndex& parent, int start, int end )
74 {
75  m_mapper.columnsRemoved( parent, start, end );
76 }
77 
78 void ModelSignalMapperConnector::dataChanged( const QModelIndex& topLeft, const QModelIndex& bottomRight )
79 {
80  m_mapper.dataChanged( topLeft, bottomRight );
81 }
82 
83 void ModelSignalMapperConnector::layoutChanged()
84 {
85  m_mapper.layoutChanged();
86 }
87 
88 void ModelSignalMapperConnector::modelReset()
89 {
90  m_mapper.modelReset();
91 }
92 
93 void ModelSignalMapperConnector::rowsInserted( const QModelIndex& parent, int start, int end )
94 {
95  m_mapper.rowsInserted( parent, start, end );
96 }
97 
98 void ModelSignalMapperConnector::rowsRemoved( const QModelIndex& parent, int start, int end )
99 {
100  m_mapper.rowsRemoved( parent, start, end );
101 }
Class only listed here to document inheritance of some KDChart classes.

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/