ui: show tooltips when hovering nodes and edges

This commit is contained in:
Eberhard Graether
2015-09-24 16:18:23 +02:00
parent b8c95c5a20
commit ae27d8025b
10 changed files with 43 additions and 22 deletions
+3
View File
@@ -246,6 +246,9 @@ void QtGraphView::doRefreshView()
utility::setWidgetBackgroundColor(QtViewWidgetWrapper::getWidgetOfView(this), backgroundColor);
utility::setWidgetBackgroundColor(getView(), backgroundColor);
std::string css = utility::getStyleSheet("data/gui/graph_view/graph_view.css");
getView()->setStyleSheet(css.c_str());
}
std::shared_ptr<QtGraphNode> QtGraphView::findNodeRecursive(const std::list<std::shared_ptr<QtGraphNode>>& nodes, Id tokenId)
@@ -117,6 +117,15 @@ void QtGraphEdge::updateLine()
}
}
if (m_data)
{
m_child->setToolTip(QString::fromStdString(m_data->getTypeString()));
}
else
{
m_child->setToolTip(QString::fromStdString(Edge::getTypeString(Edge::EDGE_AGGREGATION)));
}
this->setZValue(style.zValue); // Used to draw edges always on top of nodes.
}
@@ -19,6 +19,8 @@ QtGraphNodeBundle::QtGraphNodeBundle(Id tokenId, size_t nodeCount, std::string n
m_circle->setNumber(nodeCount);
this->setAcceptHoverEvents(true);
this->setToolTip("bundle");
}
QtGraphNodeBundle::~QtGraphNodeBundle()
@@ -19,6 +19,8 @@ QtGraphNodeData::QtGraphNodeData(const Node* data, bool hasParent, bool childVis
{
this->setName(data->getName());
}
this->setToolTip(QString::fromStdString(data->getTypeString()));
}
QtGraphNodeData::~QtGraphNodeData()