cutter/src/widgets/GraphWidget.cpp

29 lines
858 B
C++
Raw Normal View History

#include "MainWindow.h"
#include "GraphWidget.h"
#include "DisassemblerGraphView.h"
GraphWidget::GraphWidget(MainWindow *main, QAction *action) :
CutterDockWidget(main, action)
{
this->setObjectName("Graph");
this->setAllowedAreas(Qt::AllDockWidgetAreas);
this->graphView = new DisassemblerGraphView(this);
this->setWidget(graphView);
2018-03-21 20:32:32 +00:00
connect(this, &QDockWidget::visibilityChanged, this, [](bool visibility) {
if (visibility) {
Core()->setMemoryWidgetPriority(CutterCore::MemoryWidgetType::Graph);
}
});
2018-03-21 20:32:32 +00:00
connect(Core(), &CutterCore::raisePrioritizedMemoryWidget,
this, [ = ](CutterCore::MemoryWidgetType type) {
if (type == CutterCore::MemoryWidgetType::Graph) {
this->raise();
this->graphView->setFocus();
}
});
}
GraphWidget::~GraphWidget() {}