KD Chart API Documentation  3.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
kdganttgraphicsview.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 KDGANTTGRAPHICSVIEW_H
12 #define KDGANTTGRAPHICSVIEW_H
13 
14 #include <QGraphicsView>
15 #include <QPrinter>
16 
17 #include "kdganttglobal.h"
18 
19 QT_BEGIN_NAMESPACE
20 class QModelIndex;
21 class QAbstractItemModel;
22 class QAbstractProxyModel;
23 class QItemSelectionModel;
24 QT_END_NAMESPACE
25 
26 namespace KDGantt {
28 class AbstractGrid;
29 class GraphicsItem;
30 class ConstraintModel;
31 class ItemDelegate;
32 
33 class KDGANTT_EXPORT GraphicsView : public QGraphicsView
34 {
35  Q_OBJECT
37 
38  Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
39 public:
40  explicit GraphicsView(QWidget *parent = nullptr);
41  ~GraphicsView() override;
42 
43  QAbstractItemModel *model() const;
44  QAbstractProxyModel *summaryHandlingModel() const;
45  ConstraintModel *constraintModel() const;
46  QModelIndex rootIndex() const;
47  QItemSelectionModel *selectionModel() const;
48  AbstractRowController *rowController() const;
49  AbstractGrid *grid() const;
50  ItemDelegate *itemDelegate() const;
51 
52  bool isReadOnly() const;
53 
54  void setHeaderContextMenuPolicy(Qt::ContextMenuPolicy);
55  Qt::ContextMenuPolicy headerContextMenuPolicy() const;
56 
57  QModelIndex indexAt(const QPoint &pos) const;
58 
59  virtual void addConstraint(const QModelIndex &from,
60  const QModelIndex &to,
61  Qt::KeyboardModifiers modifiers);
62 
63  void clearItems();
64  void updateRow(const QModelIndex &);
65  void updateScene();
66 
67 public Q_SLOTS:
68  void updateSceneRect();
69 
70 public:
71  void deleteSubtree(const QModelIndex &);
72 
73  void print(QPrinter *printer, bool drawRowLabels = true, bool drawColumnLabels = true);
74  void print(QPrinter *printer, qreal start, qreal end, bool drawRowLabels = true, bool drawColumnLabels = true);
75  void print(QPainter *painter, const QRectF &target = QRectF(), bool drawRowLabels = true, bool drawColumnLabels = true);
76  void print(QPainter *painter, qreal start, qreal end,
77  const QRectF &target = QRectF(), bool drawRowLabels = true, bool drawColumnLabels = true);
78 
79 public Q_SLOTS:
80  void setModel(QAbstractItemModel *);
81  void setSummaryHandlingModel(QAbstractProxyModel *model);
82  void setConstraintModel(ConstraintModel *);
83  void setRootIndex(const QModelIndex &);
84  void setSelectionModel(QItemSelectionModel *);
85  void setRowController(AbstractRowController *);
86  void setGrid(AbstractGrid *);
87  void setItemDelegate(ItemDelegate *delegate);
88  void setReadOnly(bool);
89 
90 Q_SIGNALS:
91  void activated(const QModelIndex &index);
92  void clicked(const QModelIndex &index);
93  void qrealClicked(const QModelIndex &index);
94  void entered(const QModelIndex &index);
95  void pressed(const QModelIndex &index);
96  void headerContextMenuRequested(const QPoint &pt);
97 
98 protected:
99  /*reimp*/ void resizeEvent(QResizeEvent *) override;
100 
101 private:
102  friend class View;
103 
104  GraphicsItem *createItem(ItemType type) const;
105 };
106 }
107 
108 #endif /* KDGANTTGRAPHICSVIEW_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.
void entered(const QModelIndex &index)
void pressed(const QModelIndex &index)
void qrealClicked(const QModelIndex &index)
void clicked(const QModelIndex &index)
void headerContextMenuRequested(const QPoint &pt)
This signal is emitted when the header has contextMenuPolicy Qt::CustomContextMenu and the widget wan...
void activated(const QModelIndex &index)
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(X)
ItemType
The values of this enum are used to represent the different types of gantt items that KDGantt underst...

© 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