2019-01-24 17:13:04 +00:00
|
|
|
#include "MainWindow.h"
|
|
|
|
#include "OverviewWidget.h"
|
|
|
|
#include "OverviewView.h"
|
|
|
|
|
|
|
|
OverviewWidget::OverviewWidget(MainWindow *main, QAction *action) :
|
|
|
|
CutterDockWidget(main, action)
|
|
|
|
{
|
|
|
|
this->setWindowTitle("Graph Overview");
|
|
|
|
this->setObjectName("Graph Overview");
|
|
|
|
this->setAllowedAreas(Qt::AllDockWidgetAreas);
|
|
|
|
this->graphView = new OverviewView(this);
|
|
|
|
this->setWidget(graphView);
|
|
|
|
refreshDeferrer = createRefreshDeferrer([this]() {
|
|
|
|
updateContents();
|
|
|
|
});
|
|
|
|
|
|
|
|
connect(this, &QDockWidget::visibilityChanged, this, [ = ](bool visibility) {
|
|
|
|
if (visibility) {
|
|
|
|
Core()->setMemoryWidgetPriority(CutterCore::MemoryWidgetType::Graph);
|
|
|
|
updateContents();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
OverviewWidget::~OverviewWidget() {}
|
|
|
|
|
2019-01-24 18:04:39 +00:00
|
|
|
void OverviewWidget::resizeEvent(QResizeEvent *event)
|
|
|
|
{
|
|
|
|
graphView->refreshView();
|
|
|
|
QDockWidget::resizeEvent(event);
|
2019-02-07 20:39:37 +00:00
|
|
|
emit resized();
|
2019-01-24 18:04:39 +00:00
|
|
|
}
|
|
|
|
|
2019-01-24 17:13:04 +00:00
|
|
|
void OverviewWidget::updateContents()
|
|
|
|
{
|
|
|
|
if (!refreshDeferrer->attemptRefresh(nullptr)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
graphView->refreshView();
|
|
|
|
}
|