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 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
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 **********************************************************************/
29 #include "kdganttglobal.h"
31 class QAbstractItemModel
;
32 class QAbstractProxyModel
;
33 class QAbstractItemView
;
35 class QItemSelectionModel
;
42 class ConstraintModel
;
45 class AbstractRowController
;
47 class KDGANTT_EXPORT View
: public QWidget
{
49 KDGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC_QWIDGET(View
)
50 Q_PRIVATE_SLOT( d
, void slotCollapsed(const QModelIndex
&) )
51 Q_PRIVATE_SLOT( d
, void slotExpanded(const QModelIndex
&) )
52 Q_PRIVATE_SLOT( d
, void slotVerticalScrollValueChanged( int ) )
53 Q_PRIVATE_SLOT( d
, void slotLeftWidgetVerticalRangeChanged( int, int ) )
54 Q_PRIVATE_SLOT( d
, void slotGfxViewVerticalRangeChanged( int, int ) )
58 explicit View(QWidget
* parent
=0);
61 QAbstractItemModel
* model() const;
62 QItemSelectionModel
* selectionModel() const;
63 ItemDelegate
* itemDelegate() const;
64 ConstraintModel
* constraintModel() const;
65 AbstractGrid
* grid() const;
66 QModelIndex
rootIndex() const;
68 QModelIndex
indexAt( const QPoint
& pos
) const;
70 void setLeftView( QAbstractItemView
* );
71 const QAbstractItemView
* leftView() const;
72 QAbstractItemView
* leftView();
74 const QSplitter
* splitter() const;
75 QSplitter
* splitter();
77 void setRowController( AbstractRowController
* );
78 AbstractRowController
* rowController();
79 const AbstractRowController
* rowController() const;
81 const GraphicsView
* graphicsView() const;
82 GraphicsView
* graphicsView();
83 const QAbstractProxyModel
* ganttProxyModel() const;
84 QAbstractProxyModel
* ganttProxyModel();
86 void print( QPrinter
* printer
, bool drawRowLabels
=true );
87 void print( QPrinter
* printer
, qreal start
, qreal end
, bool drawRowLabels
=true );
88 void print( QPainter
* painter
, const QRectF
& target
= QRectF(), bool drawRowLabels
=true);
89 void print( QPainter
* painter
, qreal start
, qreal end
,
90 const QRectF
& target
= QRectF(), bool drawRowLabels
=true);
93 void setModel(QAbstractItemModel
* model
);
94 void setRootIndex( const QModelIndex
& idx
);
95 void setSelectionModel( QItemSelectionModel
* smodel
);
96 void setItemDelegate( ItemDelegate
* );
97 void setConstraintModel( ConstraintModel
* );
98 void setGrid( AbstractGrid
* );
101 /*reimp*/ void resizeEvent(QResizeEvent
*);
105 #endif /* KDGANTTVIEW_H */