KD Chart 2  [rev.2.7]
kdganttview.h
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 #ifndef KDGANTTVIEW_H
24 #define KDGANTTVIEW_H
25 
26 #include <QWidget>
27 #include <QModelIndex>
28 #include "kdganttglobal.h"
29 
30 QT_BEGIN_NAMESPACE
31 class QAbstractItemModel;
33 class QAbstractItemView;
34 class QItemSelectionModel;
35 class QPrinter;
36 class QSplitter;
37 QT_END_NAMESPACE
38 
39 namespace KDGantt {
40  class ItemDelegate;
41  class Constraint;
42  class ConstraintModel;
43  class AbstractGrid;
44  class GraphicsView;
45  class AbstractRowController;
46 
47  class KDGANTT_EXPORT View : public QWidget {
48  Q_OBJECT
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 ) )
55 
56  public:
57 
58  explicit View(QWidget* parent=0);
59  ~View() override;
60 
61  QAbstractItemModel* model() const;
62  QItemSelectionModel* selectionModel() const;
63  ItemDelegate* itemDelegate() const;
64  ConstraintModel* constraintModel() const;
65  AbstractGrid* grid() const;
66  QModelIndex rootIndex() const;
67 
68  QModelIndex indexAt( const QPoint& pos ) const;
69 
70  void setLeftView( QAbstractItemView* );
71  const QAbstractItemView* leftView() const;
72  QAbstractItemView* leftView();
73 
74  const QSplitter* splitter() const;
75  QSplitter* splitter();
76 
77  void setRowController( AbstractRowController* );
78  AbstractRowController* rowController();
79  const AbstractRowController* rowController() const;
80 
81  void setGraphicsView( GraphicsView* );
82  const GraphicsView* graphicsView() const;
83  GraphicsView* graphicsView();
84  const QAbstractProxyModel* ganttProxyModel() const;
85  QAbstractProxyModel* ganttProxyModel();
86 
87  void ensureVisible(const QModelIndex& index);
88 
89  void print( QPrinter* printer, bool drawRowLabels=true, bool drawColumnLabels=true );
90  void print( QPrinter* printer, qreal start, qreal end, bool drawRowLabels=true, bool drawColumnLabels=true );
91  void print( QPainter* painter, const QRectF& target = QRectF(), bool drawRowLabels=true, bool drawColumnLabels=true);
92  void print( QPainter* painter, qreal start, qreal end,
93  const QRectF& target = QRectF(), bool drawRowLabels=true, bool drawColumnLabels=true);
94 
95  public Q_SLOTS:
96  void setModel(QAbstractItemModel* model);
97  void setRootIndex( const QModelIndex& idx );
98  void setSelectionModel( QItemSelectionModel* smodel );
99  void setItemDelegate( ItemDelegate* );
100  void setConstraintModel( ConstraintModel* );
101  void setGrid( AbstractGrid* );
102  void expandAll( QModelIndex index = QModelIndex() );
103  void collapseAll( QModelIndex index = QModelIndex() );
104 
105  protected:
106  /*reimp*/ void resizeEvent(QResizeEvent*) override;
107  };
108 }
109 
110 #endif /* KDGANTTVIEW_H */
#define KDGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC_QWIDGET(X)
Abstract baseclass for grids. A grid is used to convert between QModelIndex&#39;es and gantt chart values...
Class used to render gantt items in a KDGantt::GraphicsView.
Class only listed here to document inheritance of some KDChart classes.
Class only listed here to document inheritance of some KDChart classes.
The GraphicsView class provides a model/view implementation of a gantt chart.
This widget that consists of a QTreeView and a GraphicsView.
Definition: kdganttview.h:47
Class only listed here to document inheritance of some KDChart classes.
Abstract baseclass for row controllers. A row controller is used by the GraphicsView to nagivate the ...

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/