1 /****************************************************************************
2 ** Copyright (C) 2001-2006 Klarälvdalens Datakonsult AB. All rights reserved.
4 ** This file is part of the KD Gantt library.
6 ** This file may be used under the terms of the GNU General Public
7 ** License versions 2.0 or 3.0 as published by the Free Software
8 ** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
9 ** included in the packaging of this file. Alternatively you may (at
10 ** your option) use any later version of the GNU General Public
11 ** License if such license has been publicly approved by
12 ** Klarälvdalens Datakonsult AB (or its successors, if any).
14 ** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
15 ** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
16 ** A PARTICULAR PURPOSE. Klarälvdalens Datakonsult AB reserves all rights
17 ** not expressly granted herein.
19 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22 **********************************************************************/
27 #include "kdganttglobal.h"
29 class QAbstractItemModel
;
30 class QAbstractProxyModel
;
31 class QAbstractItemView
;
33 class QItemSelectionModel
;
38 class ConstraintModel
;
41 class AbstractRowController
;
44 class KDGANTT_EXPORT View
: public QWidget
{
46 KDGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC_QWIDGET(View
)
47 Q_PRIVATE_SLOT( d
, void slotCollapsed(const QModelIndex
&) )
48 Q_PRIVATE_SLOT( d
, void slotExpanded(const QModelIndex
&) )
49 Q_PRIVATE_SLOT( d
, void slotVerticalScrollValueChanged( int ) )
50 Q_PRIVATE_SLOT( d
, void slotLeftWidgetVerticalRangeChanged( int, int ) )
51 Q_PRIVATE_SLOT( d
, void slotGfxViewVerticalRangeChanged( int, int ) )
53 explicit View(QWidget
* parent
=0);
56 QAbstractItemModel
* model() const;
57 QItemSelectionModel
* selectionModel() const;
58 ItemDelegate
* itemDelegate() const;
59 ConstraintModel
* constraintModel() const;
60 AbstractGrid
* grid() const;
61 QModelIndex
rootIndex() const;
63 QModelIndex
indexAt( const QPoint
& pos
) const;
65 void setLeftView( QAbstractItemView
* );
66 const QAbstractItemView
* leftView() const;
67 QAbstractItemView
* leftView();
69 void setRowController( AbstractRowController
* );
70 AbstractRowController
* rowController();
71 const AbstractRowController
* rowController() const;
73 const GraphicsView
* graphicsView() const;
74 GraphicsView
* graphicsView();
75 const QAbstractProxyModel
* ganttProxyModel() const;
76 QAbstractProxyModel
* ganttProxyModel();
78 void print( QPainter
* painter
, const QRectF
& target
= QRectF(), const QRectF
& source
= QRectF(), bool drawRowLabels
=true, bool drawHeader
=true);
81 void setModel(QAbstractItemModel
* model
);
82 void setRootIndex( const QModelIndex
& idx
);
83 void setSelectionModel( QItemSelectionModel
* smodel
);
84 void setItemDelegate( ItemDelegate
* );
85 void setConstraintModel( ConstraintModel
* );
86 void setGrid( AbstractGrid
* );
89 /*reimp*/ void resizeEvent(QResizeEvent
*);
93 #endif /* KDGANTTVIEW_H */