src: various fixes
* fixed crash when hovering GraphNode while expanding/collapsing it * fixed clang warnings * fixed GraphNodeExpandToggle to show empty circle * fixed Searchbar showing empty block when nothing was parsed * made template related edges in GraphView red
This commit is contained in:
@@ -100,6 +100,16 @@ void QtGraphView::switchToNewGraphData()
|
||||
{
|
||||
m_oldGraph = m_graph;
|
||||
|
||||
for (const std::shared_ptr<QtGraphNode>& node : m_oldNodes)
|
||||
{
|
||||
node->hide();
|
||||
}
|
||||
|
||||
for (const std::shared_ptr<QtGraphEdge>& edge : m_oldEdges)
|
||||
{
|
||||
edge->hide();
|
||||
}
|
||||
|
||||
m_oldNodes = m_nodes;
|
||||
m_oldEdges = m_edges;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "qt/view/graphElements/QtGraphNodeExpandToggle.h"
|
||||
|
||||
#include "utility/logging/logging.h"
|
||||
#include "utility/messaging/type/MessageGraphNodeExpand.h"
|
||||
|
||||
#include "qt/graphics/QtRoundedRectItem.h"
|
||||
@@ -8,31 +9,29 @@
|
||||
QtGraphNodeExpandToggle::QtGraphNodeExpandToggle(bool expanded, int invisibleSubNodeCount)
|
||||
: m_allVisible(invisibleSubNodeCount == 0)
|
||||
{
|
||||
if (!expanded && !invisibleSubNodeCount)
|
||||
{
|
||||
LOG_ERROR("ExpandToggle shouldn't be visible");
|
||||
return;
|
||||
}
|
||||
|
||||
const int iconHeight = 4;
|
||||
m_icon = new QGraphicsPixmapItem(this);
|
||||
|
||||
if (!expanded && !invisibleSubNodeCount)
|
||||
QtDeviceScaledPixmap pixmap("data/gui/graph_view/images/arrow.png");
|
||||
pixmap.scaleToHeight(iconHeight);
|
||||
|
||||
if (invisibleSubNodeCount)
|
||||
{
|
||||
this->hide();
|
||||
return;
|
||||
QString numberStr = QString::number(invisibleSubNodeCount);
|
||||
m_text->setText(numberStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
QtDeviceScaledPixmap pixmap("data/gui/graph_view/images/arrow.png");
|
||||
pixmap.scaleToHeight(iconHeight);
|
||||
|
||||
if (invisibleSubNodeCount)
|
||||
{
|
||||
QString numberStr = QString::number(invisibleSubNodeCount);
|
||||
m_text->setText(numberStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
pixmap.mirror();
|
||||
}
|
||||
|
||||
m_icon->setPixmap(pixmap.pixmap());
|
||||
pixmap.mirror();
|
||||
}
|
||||
|
||||
m_icon->setPixmap(pixmap.pixmap());
|
||||
}
|
||||
|
||||
QtGraphNodeExpandToggle::~QtGraphNodeExpandToggle()
|
||||
|
||||
Reference in New Issue
Block a user