Alwas make the first BasicBlock visible
authorChristoph Egger <christoph@christoph-egger.org>
Tue, 26 May 2015 18:42:37 +0000 (20:42 +0200)
committerChristoph Egger <christoph@christoph-egger.org>
Tue, 26 May 2015 18:42:37 +0000 (20:42 +0200)
src/gui/widgets/FunctionWidget.cxx

index c9c28d169a2c36bacb4d904c12de6f0e29ac6b49..0d931adc202b29d049baadfbdc5e13db856be56d 100644 (file)
@@ -41,8 +41,8 @@ void FunctionWidget::showEvent(QShowEvent* event) {
                }
 
                std::map<uint64_t, BasicBlockWidget*> _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;
        }
 }