qgv
1.3.6
Interactive Qt graphViz display
Toggle main menu visibility
Loading...
Searching...
No Matches
QGVEdge.h
Go to the documentation of this file.
1
/***************************************************************
2
QGVCore
3
Copyright (c) 2014, Bergont Nicolas, All rights reserved.
4
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Lesser General Public
7
License as published by the Free Software Foundation; either
8
version 3.0 of the License, or (at your option) any later version.
9
10
This library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Lesser General Public License for more details.
14
15
You should have received a copy of the GNU Lesser General Public
16
License along with this library.
17
***************************************************************/
18
#ifndef QGVEDGE_H
19
#define QGVEDGE_H
20
21
#include <QGraphicsItem>
22
#include <QPen>
23
24
#include "
qgv.h
"
25
26
class
QGVNode
;
27
class
QGVScene
;
28
class
QGVEdgePrivate
;
29
34
class
QGVCORE_EXPORT
QGVEdge :
public
QGraphicsItem {
35
public
:
36
~QGVEdge();
37
38
QString
label
()
const
;
39
QRectF
boundingRect
()
const
;
40
QPainterPath
shape
()
const
;
41
42
void
setLabel
(
const
QString&
label
);
43
44
void
paint
(QPainter* painter,
const
QStyleOptionGraphicsItem* option,
45
QWidget* widget = 0);
46
47
void
setAttribute
(
const
QString& name,
const
QString& value);
48
QString
getAttribute
(
const
QString& name)
const
;
49
50
void
updateLayout
();
51
52
enum
{
Type
= UserType + 3 };
53
int
type
()
const
{
return
Type
; }
54
55
private
:
56
QGVEdge
(
QGVEdgePrivate
* edge,
QGVScene
* scene);
57
58
QPolygonF toArrow(
const
QLineF& normal)
const
;
59
60
friend
class
QGVScene
;
61
// friend class QGVSubGraph;
62
63
QGVScene
* _scene;
64
QGVEdgePrivate
* _edge;
65
66
QPainterPath _path;
67
QPen _pen;
68
QPolygonF _head_arrow;
69
QPolygonF _tail_arrow;
70
71
QString _label;
72
QRectF _label_rect;
73
};
74
75
#endif
// QGVEDGE_H
QGVEdgePrivate
Definition
QGVEdgePrivate.h:6
QGVEdge
Edge item.
Definition
QGVEdge.h:34
QGVEdge::paint
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition
QGVEdge.cpp:55
QGVEdge::updateLayout
void updateLayout()
Definition
QGVEdge.cpp:101
QGVEdge::QGVScene
friend class QGVScene
Definition
QGVEdge.h:60
QGVEdge::Type
@ Type
Definition
QGVEdge.h:52
QGVEdge::setLabel
void setLabel(const QString &label)
Definition
QGVEdge.cpp:53
QGVEdge::type
int type() const
Definition
QGVEdge.h:53
QGVEdge::label
QString label() const
Definition
QGVEdge.cpp:37
QGVEdge::getAttribute
QString getAttribute(const QString &name) const
Definition
QGVEdge.cpp:95
QGVEdge::boundingRect
QRectF boundingRect() const
Definition
QGVEdge.cpp:39
QGVEdge::shape
QPainterPath shape() const
Definition
QGVEdge.cpp:44
QGVEdge::setAttribute
void setAttribute(const QString &name, const QString &value)
Definition
QGVEdge.cpp:89
QGVNode
Node item.
Definition
QGVNode.h:34
QGVScene
GraphViz interactive scene.
Definition
QGVScene.h:36
qgv.h
QGVCORE_EXPORT
#define QGVCORE_EXPORT
Definition
qgv.h:9
QGVCore
QGVEdge.h
Generated by
1.17.0