diff --git a/src/widgets/DisassemblerGraphView.cpp b/src/widgets/DisassemblerGraphView.cpp index 892509a4..0d4da857 100644 --- a/src/widgets/DisassemblerGraphView.cpp +++ b/src/widgets/DisassemblerGraphView.cpp @@ -118,10 +118,16 @@ DisassemblerGraphView::DisassemblerGraphView(QWidget *parent) connect(mMenu, SIGNAL(copy()), this, SLOT(copySelection())); - header = new QTextEdit(viewport()); + header = new QTextEdit(); header->setFixedHeight(30); header->setReadOnly(true); header->setLineWrapMode(QTextEdit::NoWrap); + + // Add header as widget to layout so it stretches to the layout width + layout()->setContentsMargins(0, 0, 0, 0); + layout()->setAlignment(Qt::AlignTop); + layout()->addWidget(header); + highlighter = new SyntaxHighlighter(header->document()); } diff --git a/src/widgets/GraphWidget.cpp b/src/widgets/GraphWidget.cpp index 6963ca4b..4a8f8e5c 100644 --- a/src/widgets/GraphWidget.cpp +++ b/src/widgets/GraphWidget.cpp @@ -26,7 +26,6 @@ GraphWidget::GraphWidget(MainWindow *main, OverviewWidget *overview, QAction *ac toggleOverview(visibility); if (visibility) { Core()->setMemoryWidgetPriority(CutterCore::MemoryWidgetType::Graph); - this->graphView->header->setFixedWidth(width()); } }); @@ -40,7 +39,6 @@ GraphWidget::GraphWidget(MainWindow *main, OverviewWidget *overview, QAction *ac if (type == CutterCore::MemoryWidgetType::Graph && !emptyGraph) { this->raise(); this->graphView->setFocus(); - this->graphView->header->setFixedWidth(width()); } }); }