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

View File

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

View File

@@ -121,16 +121,8 @@
<item> <item>
<widget class="QWidget" name="graphics-view-container"> <widget class="QWidget" name="graphics-view-container">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Ignored"/> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"/>
</property> </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> </widget>
</item> </item>
<item> <item>