Replaced QLabel with derived Label widget - for plain text formatting being configured as a default

This commit is contained in:
Nav
2022-05-03 20:00:52 +01:00
parent b6879991a2
commit d24ffd4ebc
47 changed files with 189 additions and 123 deletions

View File

@@ -10,9 +10,11 @@ namespace Bloom::Widgets
std::vector<ExcludedMemoryRegion>& excludedMemoryRegions,
InsightWorker& insightWorker,
const HexViewerWidgetSettings& settings,
QLabel* hoveredAddressLabel,
Label* hoveredAddressLabel,
QWidget* parent
): QGraphicsView(parent) {
)
: QGraphicsView(parent)
{
this->setObjectName("graphics-view");
this->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
this->setVerticalScrollBarPolicy(Qt::ScrollBarPolicy::ScrollBarAlwaysOn);

View File

@@ -2,7 +2,6 @@
#include <QGraphicsView>
#include <QWidget>
#include <QLabel>
#include <vector>
#include <QEvent>
@@ -10,6 +9,7 @@
#include "src/Insight/InsightWorker/InsightWorker.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
#include "ByteItemGraphicsScene.hpp"
#include "HexViewerWidgetSettings.hpp"
@@ -26,7 +26,7 @@ namespace Bloom::Widgets
std::vector<ExcludedMemoryRegion>& excludedMemoryRegions,
InsightWorker& insightWorker,
const HexViewerWidgetSettings& settings,
QLabel* hoveredAddressLabel,
Label* hoveredAddressLabel,
QWidget* parent
);

View File

@@ -12,7 +12,7 @@ namespace Bloom::Widgets
std::vector<ExcludedMemoryRegion>& excludedMemoryRegions,
InsightWorker& insightWorker,
const HexViewerWidgetSettings& settings,
QLabel* hoveredAddressLabel,
Label* hoveredAddressLabel,
QGraphicsView* parent
)
: QGraphicsScene(parent)

View File

@@ -4,7 +4,6 @@
#include <QGraphicsView>
#include <QScrollBar>
#include <QWidget>
#include <QLabel>
#include <QToolButton>
#include <QVBoxLayout>
#include <map>
@@ -21,6 +20,8 @@
#include "src/Insight/InsightWorker/InsightWorker.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
#include "ByteItem.hpp"
#include "ByteAddressContainer.hpp"
#include "AnnotationItem.hpp"
@@ -44,7 +45,7 @@ namespace Bloom::Widgets
std::vector<ExcludedMemoryRegion>& excludedMemoryRegions,
InsightWorker& insightWorker,
const HexViewerWidgetSettings& settings,
QLabel* hoveredAddressLabel,
Label* hoveredAddressLabel,
QGraphicsView* parent
);
@@ -91,7 +92,7 @@ namespace Bloom::Widgets
const HexViewerWidgetSettings& settings;
QGraphicsView* parent = nullptr;
QLabel* hoveredAddressLabel = nullptr;
Label* hoveredAddressLabel = nullptr;
ByteAddressContainer* byteAddressContainer = nullptr;

View File

@@ -69,7 +69,7 @@ namespace Bloom::Widgets
this->bottomBar->setContentsMargins(0, 0, 0, 0);
this->bottomBar->layout()->setContentsMargins(5, 0, 5, 0);
this->hoveredAddressLabel = this->bottomBar->findChild<QLabel*>("byte-address-label");
this->hoveredAddressLabel = this->bottomBar->findChild<Label*>("byte-address-label");
this->byteItemGraphicsViewContainer = this->container->findChild<QWidget*>("graphics-view-container");
this->byteItemGraphicsView = new ByteItemContainerGraphicsView(

View File

@@ -1,7 +1,6 @@
#pragma once
#include <QWidget>
#include <QLabel>
#include <QResizeEvent>
#include <QShowEvent>
#include <vector>
@@ -11,6 +10,7 @@
#include "src/Insight/InsightWorker/InsightWorker.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/SvgToolButton.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/TextInput.hpp"
@@ -63,7 +63,7 @@ namespace Bloom::Widgets
QWidget* byteItemGraphicsViewContainer = nullptr;
ByteItemContainerGraphicsView* byteItemGraphicsView = nullptr;
ByteItemGraphicsScene* byteItemGraphicsScene = nullptr;
QLabel* hoveredAddressLabel = nullptr;
Label* hoveredAddressLabel = nullptr;
SvgToolButton* highlightStackMemoryButton = nullptr;
SvgToolButton* highlightFocusedMemoryButton = nullptr;

View File

@@ -220,7 +220,7 @@
<number>0</number>
</property>
<item>
<widget class="QLabel" name="byte-address-label">
<widget class="Label" name="byte-address-label">
<property name="text">
<string>Relative Address (Absolute Address):</string>
</property>