From 01cbeaf636962d976c85028f8f9e0b2afa4a5c69 Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Tue, 26 May 2015 20:42:37 +0200 Subject: [PATCH] Alwas make the first BasicBlock visible --- src/gui/widgets/FunctionWidget.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/FunctionWidget.cxx b/src/gui/widgets/FunctionWidget.cxx index c9c28d1..0d931ad 100644 --- a/src/gui/widgets/FunctionWidget.cxx +++ b/src/gui/widgets/FunctionWidget.cxx @@ -41,8 +41,8 @@ void FunctionWidget::showEvent(QShowEvent* event) { } std::map _blocks; - local__add_basic_block(block, mainwindow, - manager, _blocks, scene, 3*start_address, 100); + BasicBlockWidget* firstblock = local__add_basic_block(block, mainwindow, + manager, _blocks, scene, 3*start_address, 100); QGraphicsView * view = new QGraphicsView(scene); view->setDragMode(QGraphicsView::ScrollHandDrag); @@ -54,6 +54,7 @@ void FunctionWidget::showEvent(QShowEvent* event) { t->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); addTab(t, "Listing"); + view->ensureVisible(firstblock); layouted = true; } } -- 2.39.5