KDChartModelDataCache_p.cpp

Go to the documentation of this file.
00001 /****************************************************************************
00002  ** Copyright (C) 2008 Klaralvdalens Datakonsult AB.  All rights reserved.
00003  **
00004  ** This file is part of the KD Chart library.
00005  **
00006  ** This file may be distributed and/or modified under the terms of the
00007  ** GNU General Public License version 2 as published by the Free Software
00008  ** Foundation and appearing in the file LICENSE.GPL included in the
00009  ** packaging of this file.
00010  **
00011  ** Licensees holding valid commercial KD Chart licenses may use this file in
00012  ** accordance with the KD Chart Commercial License Agreement provided with
00013  ** the Software.
00014  **
00015  ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00016  ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00017  **
00018  ** See http://www.kdab.net/kdchart for
00019  **   information about KD Chart Commercial License Agreements.
00020  **
00021  ** Contact info@kdab.net if any conditions of this
00022  ** licensing are not clear to you.
00023  **
00024  **********************************************************************/
00025 
00026 #include "KDChartModelDataCache_p.h"
00027 
00028 #include <limits>
00029 
00030 using namespace KDChart::ModelDataCachePrivate;
00031 
00032 ModelSignalMapperConnector::ModelSignalMapperConnector( ModelSignalMapper& mapper )
00033     : QObject( 0 ),
00034       m_mapper( mapper )
00035 {
00036 }
00037 
00038 ModelSignalMapperConnector::~ModelSignalMapperConnector()
00039 {
00040 }
00041 
00042 void ModelSignalMapperConnector::connectSignals( QAbstractItemModel* model )
00043 {
00044     connect( model, SIGNAL( destroyed() ),                              this, SLOT( resetModel() ) );
00045     connect( model, SIGNAL( columnsInserted( QModelIndex, int, int ) ), this, SLOT( columnsInserted( QModelIndex, int, int ) ) );
00046     connect( model, SIGNAL( columnsRemoved( QModelIndex, int, int ) ),  this, SLOT( columnsRemoved( QModelIndex, int, int ) ) );
00047     connect( model, SIGNAL( dataChanged( QModelIndex, QModelIndex ) ),  this, SLOT( dataChanged( QModelIndex, QModelIndex ) ) );
00048     connect( model, SIGNAL( layoutChanged() ),                          this, SLOT( layoutChanged() ) );
00049     connect( model, SIGNAL( modelReset() ),                             this, SLOT( modelReset() ) );
00050     connect( model, SIGNAL( rowsInserted( QModelIndex, int, int ) ),    this, SLOT( rowsInserted( QModelIndex, int, int )) );
00051     connect( model, SIGNAL( rowsRemoved( QModelIndex, int, int ) ),     this, SLOT( rowsRemoved( QModelIndex, int, int ) ) );
00052 }
00053 
00054 void ModelSignalMapperConnector::disconnectSignals( QAbstractItemModel* model )
00055 {
00056     disconnect( model, SIGNAL( destroyed() ),                              this, SLOT( resetModel() ) );
00057     disconnect( model, SIGNAL( columnsInserted( QModelIndex, int, int ) ), this, SLOT( columnsInserted( QModelIndex, int, int ) ) );
00058     disconnect( model, SIGNAL( columnsRemoved( QModelIndex, int, int ) ),  this, SLOT( columnsRemoved( QModelIndex, int, int ) ) );
00059     disconnect( model, SIGNAL( dataChanged( QModelIndex, QModelIndex ) ),  this, SLOT( dataChanged( QModelIndex, QModelIndex ) ) );
00060     disconnect( model, SIGNAL( layoutChanged() ),                          this, SLOT( layoutChanged() ) );
00061     disconnect( model, SIGNAL( modelReset() ),                             this, SLOT( modelReset() ) );
00062     disconnect( model, SIGNAL( rowsInserted( QModelIndex, int, int ) ),    this, SLOT( rowsInserted( QModelIndex, int, int )) );
00063     disconnect( model, SIGNAL( rowsRemoved( QModelIndex, int, int ) ),     this, SLOT( rowsRemoved( QModelIndex, int, int ) ) );
00064 }
00065 
00066 void ModelSignalMapperConnector::resetModel()
00067 {
00068     m_mapper.resetModel();
00069 }
00070 
00071 void ModelSignalMapperConnector::columnsInserted( const QModelIndex& parent, int start, int end )
00072 {
00073     m_mapper.columnsInserted( parent, start, end );
00074 }
00075 
00076 void ModelSignalMapperConnector::columnsRemoved( const QModelIndex& parent, int start, int end )
00077 {
00078     m_mapper.columnsRemoved( parent, start, end );
00079 }
00080 
00081 void ModelSignalMapperConnector::dataChanged( const QModelIndex& topLeft, const QModelIndex& bottomRight )
00082 {
00083     m_mapper.dataChanged( topLeft, bottomRight );
00084 }
00085 
00086 void ModelSignalMapperConnector::layoutChanged()
00087 {
00088     m_mapper.layoutChanged();
00089 }
00090 
00091 void ModelSignalMapperConnector::modelReset()
00092 {
00093     m_mapper.modelReset();
00094 }
00095 
00096 void ModelSignalMapperConnector::rowsInserted( const QModelIndex& parent, int start, int end )
00097 {
00098     m_mapper.rowsInserted( parent, start, end );
00099 }
00100 
00101 void ModelSignalMapperConnector::rowsRemoved( const QModelIndex& parent, int start, int end )
00102 {
00103     m_mapper.rowsRemoved( parent, start, end );
00104 }

Generated on Thu Mar 4 23:19:12 2010 for KD Chart 2 by  doxygen 1.5.4