Newer
Older
/***************************************************************
QGVCore
Copyright (c) 2014, Bergont Nicolas, All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3.0 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library.
***************************************************************/
#include <QGraphicsItem>
#include <QPen>
class QGVEdge;
class QGVScene;
Joachim Langenbach
committed
class QGVNodePrivate;
Joachim Langenbach
committed
class QGVCORE_EXPORT QGVNode : public QGraphicsItem
QString label() const;
void setLabel(const QString &label);
QRectF boundingRect() const;
void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0);
void setAttribute(const QString &label, const QString &value);
QString getAttribute(const QString &name) const;
void setIcon(const QImage &icon);
enum { Type = UserType + 2 };
int type() const
{
return Type;
}
private:
friend class QGVScene;
friend class QGVSubGraph;
void updateLayout();
Joachim Langenbach
committed
QGVNode(QGVNodePrivate* node, QGVScene *scene);
Joachim Langenbach
committed
// Not implemented in QGVNode.cpp
// QPainterPath makeShape(Agnode_t* node) const;
// QPolygonF makeShapeHelper(Agnode_t* node) const;
Joachim Langenbach
committed
QGVNodePrivate* _node;