Fix infinite refreshing, due to initial setCheckState triggering slotItemChanged
[kdepim.git] / kdgantt2 / kdganttgraphicsview_p.h
blobe98953119b40aa9f946ba5e4d5543763ffac1d5e
1 /****************************************************************************
2 ** Copyright (C) 2001-2006 Klarälvdalens Datakonsult AB. All rights reserved.
3 **
4 ** This file is part of the KD Gantt library.
5 **
6 ** This file may be distributed and/or modified under the terms of the
7 ** GNU General Public License version 2 as published by the Free Software
8 ** Foundation and appearing in the file LICENSE.GPL included in the
9 ** packaging of this file.
11 ** Licensees holding valid commercial KD Gantt licenses may use this file in
12 ** accordance with the KD Gantt Commercial License Agreement provided with
13 ** the Software.
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.
18 ** See http://www.kdab.net/kdgantt for
19 ** information about KD Gantt Commercial License Agreements.
21 ** Contact info@kdab.net if any conditions of this
22 ** licensing are not clear to you.
24 **********************************************************************/
25 #ifndef KDGANTTGRAPHICSVIEW_P_H
26 #define KDGANTTGRAPHICSVIEW_P_H
28 #include "kdganttgraphicsview.h"
29 #include "kdganttgraphicsscene.h"
30 #include "kdganttdatetimegrid.h"
32 #include <QPointer>
34 namespace KDGantt {
35 class HeaderWidget : public QWidget {
36 Q_OBJECT
37 public:
38 explicit HeaderWidget( GraphicsView* parent );
39 virtual ~HeaderWidget();
41 GraphicsView* view() const { return qobject_cast<GraphicsView*>( parent() );}
43 public Q_SLOTS:
44 void scrollTo( int );
45 protected:
46 /*reimp*/ void paintEvent( QPaintEvent* ev );
47 #ifndef QT_NO_CONTEXTMENU
48 /*reimp*/ void contextMenuEvent( QContextMenuEvent* ev );
49 #endif
50 private:
51 qreal m_offset;
54 class GraphicsView::Private {
55 Q_DISABLE_COPY( Private )
56 public:
57 explicit Private(GraphicsView* _q);
59 void updateHeaderGeometry();
61 void slotGridChanged();
62 void slotHorizontalScrollValueChanged( int val );
64 /* slots for QAbstractItemModel signals */
65 void slotColumnsInserted( const QModelIndex& parent, int start, int end );
66 void slotColumnsRemoved( const QModelIndex& parent, int start, int end );
67 void slotDataChanged( const QModelIndex& topLeft, const QModelIndex& bottomRight );
68 void slotLayoutChanged();
69 void slotModelReset();
70 void slotRowsInserted( const QModelIndex& parent, int start, int end );
71 void slotRowsAboutToBeRemoved( const QModelIndex& parent, int start, int end );
72 void slotRowsRemoved( const QModelIndex& parent, int start, int end );
74 void slotItemClicked( const QModelIndex& idx );
75 void slotItemDoubleClicked( const QModelIndex& idx );
77 void slotHeaderContextMenuRequested( const QPoint& pt );
79 GraphicsView* q;
80 AbstractRowController* rowcontroller;
81 HeaderWidget headerwidget;
82 GraphicsScene scene;
86 #endif /* KDGANTTGRAPHICSVIEW_P_H */