KGantt

kganttconstraintgraphicsitem.h
1/*
2 * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 *
4 * This file is part of the KGantt library.
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9#ifndef KGANTTCONSTRAINTGRAPHICSITEM_H
10#define KGANTTCONSTRAINTGRAPHICSITEM_H
11
12#include <QGraphicsItem>
13
14#include "kganttconstraint.h"
15
16namespace KGantt {
17 class GraphicsScene;
18
19
20
21 /*!\class KGantt::ConstraintGraphicsItem
22 * \internal
23 */
24 class KGANTT_EXPORT ConstraintGraphicsItem : public QGraphicsItem {
25 public:
26 enum { Type = UserType + 43 };
27
28 explicit ConstraintGraphicsItem( const Constraint& c,
29 QGraphicsItem* parent = nullptr, GraphicsScene* scene = nullptr );
30 ~ConstraintGraphicsItem() override;
31
32 /*reimp*/ int type() const override;
33 /*reimp (non virtual)*/GraphicsScene* scene() const;
34
35 /*reimp*/ QString ganttToolTip() const;
36
37 /*reimp*/ QRectF boundingRect() const override;
38 /*reimp*/ void paint( QPainter* painter, const QStyleOptionGraphicsItem* option,
39 QWidget* widget = nullptr ) override;
40
41 inline const Constraint& constraint() const { return m_constraint; }
42 Constraint proxyConstraint() const;
43
44 void setStart( const QPointF& start );
45 inline QPointF start() const { return m_start; }
46 void setEnd( const QPointF& end );
47 inline QPointF end() const { return m_end; }
48
49 void updateItem( const QPointF& start,const QPointF& end );
50 private:
51 Constraint m_constraint;
52 QPointF m_start;
53 QPointF m_end;
54 };
55}
56
57#endif /* KGANTTCONSTRAINTGRAPHICSITEM_H */
58
A class used to represent a dependency.
Q_SCRIPTABLE Q_NOREPLY void start()
Global namespace.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.