KD Chart API Documentation  3.1
kdganttview.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** This file is part of the KD Chart library.
4 **
5 ** SPDX-FileCopyrightText: 2001 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: MIT
8 **
9 ****************************************************************************/
10 
11 #ifndef KDGANTTVIEW_H
12 #define KDGANTTVIEW_H
13 
14 #include "kdganttglobal.h"
15 #include <QModelIndex>
16 #include <QWidget>
17 
18 QT_BEGIN_NAMESPACE
19 class QAbstractItemModel;
20 class QAbstractProxyModel;
21 class QAbstractItemView;
22 class QItemSelectionModel;
23 class QPrinter;
24 class QSplitter;
25 QT_END_NAMESPACE
26 
27 namespace KDGantt {
28 class ItemDelegate;
29 class Constraint;
30 class ConstraintModel;
31 class AbstractGrid;
32 class GraphicsView;
33 class AbstractRowController;
34 
35 class KDGANTT_EXPORT View : public QWidget
36 {
37  Q_OBJECT
39 
40 public:
41  explicit View(QWidget *parent = nullptr);
42  ~View() override;
43 
44  QAbstractItemModel *model() const;
45  QItemSelectionModel *selectionModel() const;
46  ItemDelegate *itemDelegate() const;
47  ConstraintModel *constraintModel() const;
48  AbstractGrid *grid() const;
49  QModelIndex rootIndex() const;
50 
51  QModelIndex indexAt(const QPoint &pos) const;
52 
53  void setLeftView(QAbstractItemView *);
54  const QAbstractItemView *leftView() const;
55  QAbstractItemView *leftView();
56 
57  const QSplitter *splitter() const;
58  QSplitter *splitter();
59 
60  void setRowController(AbstractRowController *);
61  AbstractRowController *rowController();
62  const AbstractRowController *rowController() const;
63 
64  void setGraphicsView(GraphicsView *);
65  const GraphicsView *graphicsView() const;
66  GraphicsView *graphicsView();
67  const QAbstractProxyModel *ganttProxyModel() const;
68  QAbstractProxyModel *ganttProxyModel();
69 
70  void ensureVisible(const QModelIndex &index);
71 
72  void print(QPrinter *printer, bool drawRowLabels = true, bool drawColumnLabels = true);
73  void print(QPrinter *printer, qreal start, qreal end, bool drawRowLabels = true, bool drawColumnLabels = true);
74  void print(QPainter *painter, const QRectF &target = QRectF(), bool drawRowLabels = true, bool drawColumnLabels = true);
75  void print(QPainter *painter, qreal start, qreal end,
76  const QRectF &target = QRectF(), bool drawRowLabels = true, bool drawColumnLabels = true);
77 
78 public Q_SLOTS:
79  void setModel(QAbstractItemModel *model);
80  void setRootIndex(const QModelIndex &idx);
81  void setSelectionModel(QItemSelectionModel *smodel);
82  void setItemDelegate(ItemDelegate *);
83  void setConstraintModel(ConstraintModel *);
84  void setGrid(AbstractGrid *);
85  void expandAll(QModelIndex index = QModelIndex());
86  void collapseAll(QModelIndex index = QModelIndex());
87 
88 protected:
89  /*reimp*/ void resizeEvent(QResizeEvent *) override;
90 };
91 }
92 
93 #endif /* KDGANTTVIEW_H */
Abstract baseclass for grids.
Abstract baseclass for row controllers.
The ConstraintModel keeps track of the interdependencies between gantt items in a View.
The GraphicsView class provides a model/view implementation of a gantt chart.
Class used to render gantt items in a KDGantt::GraphicsView.
This widget that consists of a QTreeView and a GraphicsView.
Definition: kdganttview.h:36
Contains KDGantt macros.
#define KDGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC_QWIDGET(X)

© 2001 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/
Generated by doxygen 1.9.1