qgv
1.3.6
Interactive Qt graphViz display
Toggle main menu visibility
Loading...
Searching...
No Matches
QGVNode.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 QGVNODE_H
19
#define QGVNODE_H
20
21
#include <QGraphicsItem>
22
#include <QPen>
23
24
#include "
qgv.h
"
25
26
class
QGVEdge
;
27
class
QGVScene
;
28
class
QGVNodePrivate
;
29
34
class
QGVCORE_EXPORT
QGVNode :
public
QGraphicsItem {
35
public
:
36
~QGVNode();
37
38
QString
label
()
const
;
39
void
setLabel
(
const
QString&
label
);
40
41
QRectF
boundingRect
()
const
;
42
void
paint
(QPainter* painter,
const
QStyleOptionGraphicsItem* option,
43
QWidget* widget = 0);
44
void
setAttribute
(
const
QString&
label
,
const
QString& value);
45
QString
getAttribute
(
const
QString& name)
const
;
46
47
QString
posToAttributeString
()
const
;
48
49
void
setIcon
(
const
QImage& icon);
50
51
enum
{
Type
= UserType + 2 };
52
int
type
()
const
{
return
Type
; }
53
54
void
updateLayout();
55
56
protected
:
57
QVariant itemChange(GraphicsItemChange change,
const
QVariant& value);
58
59
private
:
60
friend
class
QGVScene
;
61
friend
class
QGVSubGraph
;
62
QGVNode(
QGVNodePrivate
* node,
QGVScene
* scene);
63
64
// Not implemented in QGVNode.cpp
65
// QPainterPath makeShape(Agnode_t* node) const;
66
// QPolygonF makeShapeHelper(Agnode_t* node) const;
67
68
QPainterPath _path;
69
QPen _pen;
70
QBrush _brush;
71
QImage _icon;
72
73
QGVScene
* _scene;
74
QGVNodePrivate
* _node;
75
};
76
77
#endif
// QGVNODE_H
QGVEdge
Edge item.
Definition
QGVEdge.h:34
QGVNodePrivate
Definition
QGVNodePrivate.h:6
QGVNode::type
int type() const
Definition
QGVNode.h:52
QGVNode::paint
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition
QGVNode.cpp:45
QGVNode::QGVScene
friend class QGVScene
Definition
QGVNode.h:60
QGVNode::label
QString label() const
Definition
QGVNode.cpp:39
QGVNode::setIcon
void setIcon(const QImage &icon)
Definition
QGVNode.cpp:100
QGVNode::boundingRect
QRectF boundingRect() const
Definition
QGVNode.cpp:43
QGVNode::posToAttributeString
QString posToAttributeString() const
Definition
QGVNode.cpp:92
QGVNode::setAttribute
void setAttribute(const QString &label, const QString &value)
Definition
QGVNode.cpp:80
QGVNode::getAttribute
QString getAttribute(const QString &name) const
Definition
QGVNode.cpp:86
QGVNode::setLabel
void setLabel(const QString &label)
Definition
QGVNode.cpp:41
QGVNode::QGVSubGraph
friend class QGVSubGraph
Definition
QGVNode.h:61
QGVNode::Type
@ Type
Definition
QGVNode.h:51
QGVScene
GraphViz interactive scene.
Definition
QGVScene.h:36
qgv.h
QGVCORE_EXPORT
#define QGVCORE_EXPORT
Definition
qgv.h:9
QGVCore
QGVNode.h
Generated by
1.17.0