ui: Show namespace label on left side of graph nodes

* Added arrow indicating namespace and package name on left side of node
* Show namespace label when hovering arrow
* Activate namespace when clicking label
* New design for namespace nodes
This commit is contained in:
Eberhard Graether
2016-11-28 16:28:52 +01:00
parent 1b15933819
commit e9cadbed8d
18 changed files with 397 additions and 73 deletions
@@ -0,0 +1,40 @@
#ifndef QT_GRAPH_NODE_QUALIFIER_H
#define QT_GRAPH_NODE_QUALIFIER_H
#include <QGraphicsPolygonItem>
#include <QGraphicsRectItem>
#include "qt/view/graphElements/QtGraphNode.h"
class QtGraphNodeQualifier
: public QtGraphNode
{
public:
QtGraphNodeQualifier(const NameHierarchy& name);
virtual ~QtGraphNodeQualifier();
// QtGraphNode implementation
virtual bool isQualifierNode() const;
virtual bool setPosition(const Vec2i& pos);
virtual void onClick();
virtual void updateStyle();
protected:
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent* event);
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent* event);
private:
const NameHierarchy m_qualifierName;
QGraphicsRectItem* m_background;
QGraphicsRectItem* m_leftBorder;
QGraphicsPolygonItem* m_rightArrow;
QGraphicsPolygonItem* m_rightArrowSmall;
QGraphicsSimpleTextItem* m_name;
Vec2i m_pos;
};
#endif // QT_GRAPH_NODE_QUALIFIER_H