KD Chart API Documentation 3.1
Loading...
Searching...
No Matches
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
19QT_BEGIN_NAMESPACE
20class QModelIndex;
25
26namespace KDGantt {
27class AbstractRowController;
28class AbstractGrid;
29class GraphicsItem;
30class ConstraintModel;
31class ItemDelegate;
32
33class KDGANTT_EXPORT GraphicsView : public QGraphicsView
34{
35 Q_OBJECT
37
38 Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
39public:
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
67public Q_SLOTS:
68 void updateSceneRect();
69
70public:
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
79public 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
90Q_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
98protected:
99 /*reimp*/ void resizeEvent(QResizeEvent *) override;
100
101private:
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.
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)
T qobject_cast(QObject *object)

© 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 on Wed May 1 2024 00:01:11 for KD Chart API Documentation by doxygen 1.9.8