ui: Group graph nodes by file or namespace (issues #171, #439, #522)

* added buttons to enable grouping by file or namespace
* last used group settings saved to ApplicationSettings
* made groups hoverable/clickable on label only
* improved node hatching and override edge colors
* group overview lists

fortune cookie message = Seen with the eyes of love, everything gets a new meaning.
This commit is contained in:
Eberhard Graether
2018-04-09 00:09:22 +02:00
parent 20106d5ce1
commit 5303187bea
40 changed files with 956 additions and 197 deletions
@@ -61,13 +61,13 @@ QtGraphNode* QtGraphNode::getParent() const
return m_parentNode;
}
QtGraphNode* QtGraphNode::getLastParent() const
QtGraphNode* QtGraphNode::getLastParent(bool noGroups) const
{
QtGraphNode* node = const_cast<QtGraphNode*>(this);
while (true)
{
QtGraphNode* parent = dynamic_cast<QtGraphNode*>(node->parentItem());
if (!parent)
if (!parent || (noGroups && parent->isGroupNode()))
{
break;
}
@@ -76,6 +76,11 @@ QtGraphNode* QtGraphNode::getLastParent() const
return node;
}
QtGraphNode* QtGraphNode::getLastNonGroupParent() const
{
return getLastParent(true);
}
void QtGraphNode::setParent(QtGraphNode* parentNode)
{
m_parentNode = parentNode;
@@ -86,7 +91,7 @@ void QtGraphNode::setParent(QtGraphNode* parentNode)
}
}
std::list<QtGraphNode*> QtGraphNode::getSubNodes() const
const std::list<QtGraphNode*>& QtGraphNode::getSubNodes() const
{
return m_subNodes;
}
@@ -142,11 +147,6 @@ Vec4i QtGraphNode::getBoundingRect() const
return Vec4i(pos.x, pos.y, pos.x + size.x, pos.y + size.y);
}
Vec4i QtGraphNode::getParentBoundingRect() const
{
return getLastParent()->getBoundingRect();
}
void QtGraphNode::addOutEdge(QtGraphEdge* edge)
{
m_outEdges.push_back(edge);
@@ -348,7 +348,7 @@ void QtGraphNode::addSubNode(QtGraphNode* node)
if (node->getIsActive())
{
QtGraphNode* parent = this;
while (parent)
while (parent && !parent->isGroupNode())
{
parent->setZValue(-10.0f);
parent->m_text->setZValue(-9.0f);