qgv
1.3.6
Interactive Qt graphViz display
Toggle main menu visibility
Loading...
Searching...
No Matches
QGVSubGraph.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 QGVSUBGRAPH_H
19
#define QGVSUBGRAPH_H
20
21
#include <QGraphicsItem>
22
#include <QPen>
23
24
#include "
qgv.h
"
25
26
class
QGVNode
;
27
class
QGVEdge
;
28
class
QGVScene
;
29
class
QGVGraphPrivate
;
30
35
class
QGVCORE_EXPORT
QGVSubGraph :
public
QGraphicsItem {
36
public
:
37
~QGVSubGraph();
38
39
QString
name
()
const
;
40
41
QGVNode
*
addNode
(
const
QString& label);
42
QGVSubGraph*
addSubGraph
(
const
QString&
name
,
bool
cluster =
true
);
43
44
QRectF
boundingRect
()
const
;
45
void
paint
(QPainter* painter,
const
QStyleOptionGraphicsItem* option,
46
QWidget* widget = 0);
47
void
setAttribute
(
const
QString&
name
,
const
QString& value);
48
QString
getAttribute
(
const
QString&
name
)
const
;
49
void
updateLayout
();
50
51
enum
{
Type
= UserType + 4 };
52
int
type
()
const
{
return
Type
; }
53
54
private
:
55
friend
class
QGVScene
;
56
QGVSubGraph(
QGVGraphPrivate
* subGraph,
QGVScene
* scene);
57
58
double
_height, _width;
59
QPen _pen;
60
QBrush _brush;
61
62
QString _label;
63
QRectF _label_rect;
64
65
QGVScene
* _scene;
66
QGVGraphPrivate
* _sgraph;
67
QList<QGVNode*> _nodes;
68
};
69
70
#endif
// QGVSUBGRAPH_H
QGVEdge
Edge item.
Definition
QGVEdge.h:34
QGVGraphPrivate
Definition
QGVGraphPrivate.h:6
QGVNode
Node item.
Definition
QGVNode.h:34
QGVScene
GraphViz interactive scene.
Definition
QGVScene.h:36
QGVSubGraph::getAttribute
QString getAttribute(const QString &name) const
Definition
QGVSubGraph.cpp:100
QGVSubGraph::addSubGraph
QGVSubGraph * addSubGraph(const QString &name, bool cluster=true)
Definition
QGVSubGraph.cpp:59
QGVSubGraph::QGVScene
friend class QGVScene
Definition
QGVSubGraph.h:55
QGVSubGraph::paint
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition
QGVSubGraph.cpp:82
QGVSubGraph::type
int type() const
Definition
QGVSubGraph.h:52
QGVSubGraph::boundingRect
QRectF boundingRect() const
Definition
QGVSubGraph.cpp:78
QGVSubGraph::setAttribute
void setAttribute(const QString &name, const QString &value)
Definition
QGVSubGraph.cpp:94
QGVSubGraph::addNode
QGVNode * addNode(const QString &label)
Definition
QGVSubGraph.cpp:43
QGVSubGraph::updateLayout
void updateLayout()
Definition
QGVSubGraph.cpp:106
QGVSubGraph::Type
@ Type
Definition
QGVSubGraph.h:51
QGVSubGraph::name
QString name() const
Definition
QGVSubGraph.cpp:39
qgv.h
QGVCORE_EXPORT
#define QGVCORE_EXPORT
Definition
qgv.h:9
QGVCore
QGVSubGraph.h
Generated by
1.17.0