Removed unnecessary VBoxLayout from byte item container in the hex viewier widget

This commit is contained in:
Nav
2021-12-15 22:11:07 +00:00
parent 3152b30319
commit bc7f7dae56
3 changed files with 12 additions and 15 deletions

View File

@@ -61,19 +61,15 @@ HexViewerWidget::HexViewerWidget(
this->hoveredAddressLabel = this->bottomBar->findChild<QLabel*>("byte-address-label");
auto* byteItemGraphicsViewContainer = this->container->findChild<QWidget*>("graphics-view-container");
auto* byteItemGraphicsViewLayout = byteItemGraphicsViewContainer->findChild<QVBoxLayout*>(
"byte-item-container-layout"
);
this->byteItemGraphicsViewContainer = this->container->findChild<QWidget*>("graphics-view-container");
this->byteItemGraphicsView = new ByteItemContainerGraphicsView(
targetMemoryDescriptor,
insightWorker,
this->settings,
this->hoveredAddressLabel,
byteItemGraphicsViewContainer
this->byteItemGraphicsViewContainer
);
this->byteItemGraphicsScene = this->byteItemGraphicsView->getScene();
byteItemGraphicsViewLayout->insertWidget(0, this->byteItemGraphicsView);
this->setStackMemoryHighlightingEnabled(true);
this->setHoveredRowAndColumnHighlightingEnabled(true);
@@ -130,6 +126,12 @@ void HexViewerWidget::resizeEvent(QResizeEvent* event) {
this->width(),
this->height()
);
this->byteItemGraphicsView->setFixedSize(this->byteItemGraphicsViewContainer->size());
}
void HexViewerWidget::showEvent(QShowEvent* event) {
this->byteItemGraphicsView->setFixedSize(this->byteItemGraphicsViewContainer->size());
}
void HexViewerWidget::onTargetStateChanged(Targets::TargetState newState) {

View File

@@ -9,6 +9,7 @@
#include <QSize>
#include <QString>
#include <QEvent>
#include <QShowEvent>
#include <optional>
#include "src/Targets/TargetMemory.hpp"
@@ -42,6 +43,7 @@ namespace Bloom::Widgets
protected:
void resizeEvent(QResizeEvent* event) override;
void showEvent(QShowEvent* event) override;
private:
const Targets::TargetMemoryDescriptor& targetMemoryDescriptor;
@@ -53,6 +55,7 @@ namespace Bloom::Widgets
QWidget* toolBar = nullptr;
QWidget* bottomBar = nullptr;
QWidget* byteItemGraphicsViewContainer = nullptr;
ByteItemContainerGraphicsView* byteItemGraphicsView = nullptr;
ByteItemGraphicsScene* byteItemGraphicsScene = nullptr;
QLabel* hoveredAddressLabel = nullptr;

View File

@@ -121,16 +121,8 @@
<item>
<widget class="QWidget" name="graphics-view-container">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Ignored"/>
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"/>
</property>
<layout class="QVBoxLayout" name="byte-item-container-layout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
</layout>
</widget>
</item>
<item>