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

@@ -1,6 +1,8 @@
#include "AboutWindow.hpp"
#include <QtUiTools>
#include "UiLoader.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
#include "src/Exceptions/Exception.hpp"
#include "src/Helpers/Paths.hpp"
@@ -30,12 +32,12 @@ namespace Bloom
throw Exception("Failed to open AboutWindow QSS file");
}
auto uiLoader = QUiLoader();
auto uiLoader = UiLoader(this);
this->windowWidget = uiLoader.load(&aboutWindowUiFile, parent);
this->windowWidget->setStyleSheet(aboutWindowStylesheet.readAll());
this->windowWidget->setFixedSize(400, 300);
auto versionLabel = this->windowWidget->findChild<QLabel*>("version-label");
auto versionLabel = this->windowWidget->findChild<Widgets::Label*>("version-label");
if (versionLabel != nullptr) {
versionLabel->setText("Bloom v" + QString::fromStdString(Application::VERSION.toString()));

View File

@@ -95,7 +95,7 @@ namespace Bloom
this->ioContainerWidget = this->windowContainer->findChild<InsightTargetWidgets::TargetPackageWidgetContainer*>(
"io-container"
);
this->ioUnavailableWidget = this->windowContainer->findChild<QLabel*>("io-inspection-unavailable");
this->ioUnavailableWidget = this->windowContainer->findChild<Label*>("io-inspection-unavailable");
auto* fileMenu = this->mainMenuBar->findChild<QMenu*>("file-menu");
auto* helpMenu = this->mainMenuBar->findChild<QMenu*>("help-menu");
@@ -124,10 +124,10 @@ namespace Bloom
this->eepromInspectionButton = this->container->findChild<QToolButton*>("eeprom-inspection-btn");
this->footer = this->windowContainer->findChild<QWidget*>("footer");
this->targetStatusLabel = this->footer->findChild<QLabel*>("target-state");
this->programCounterValueLabel = this->footer->findChild<QLabel*>("target-program-counter-value");
this->targetNameLabel = this->footer->findChild<QLabel*>("target-name");
this->targetIdLabel = this->footer->findChild<QLabel*>("target-id");
this->targetStatusLabel = this->footer->findChild<Label*>("target-state");
this->programCounterValueLabel = this->footer->findChild<Label*>("target-program-counter-value");
this->targetNameLabel = this->footer->findChild<Label*>("target-name");
this->targetIdLabel = this->footer->findChild<Label*>("target-id");
this->variantMenu = this->footer->findChild<QMenu*>("target-variant-menu");
const auto windowSize = this->size();

View File

@@ -2,7 +2,6 @@
#include <QtCore>
#include <QMainWindow>
#include <QLabel>
#include <QEvent>
#include <memory>
#include <optional>
@@ -17,6 +16,7 @@
#include "Widgets/PanelWidget.hpp"
#include "Widgets/Label.hpp"
#include "Widgets/SvgToolButton.hpp"
#include "Widgets/TargetWidgets/TargetPackageWidgetContainer.hpp"
#include "Widgets/TargetWidgets/TargetPackageWidget.hpp"
@@ -77,8 +77,8 @@ namespace Bloom
QWidget* layoutContainer = nullptr;
QWidget* container = nullptr;
QMenu* variantMenu = nullptr;
QLabel* targetNameLabel = nullptr;
QLabel* targetIdLabel = nullptr;
Widgets::Label* targetNameLabel = nullptr;
Widgets::Label* targetIdLabel = nullptr;
AboutWindow* aboutWindowWidget = nullptr;
QWidget* header = nullptr;
@@ -89,7 +89,7 @@ namespace Bloom
Widgets::TargetRegistersPaneWidget* targetRegistersSidePane = nullptr;
QToolButton* targetRegistersButton = nullptr;
QLabel* ioUnavailableWidget = nullptr;
Widgets::Label* ioUnavailableWidget = nullptr;
Widgets::InsightTargetWidgets::TargetPackageWidgetContainer* ioContainerWidget = nullptr;
Widgets::InsightTargetWidgets::TargetPackageWidget* targetPackageWidget = nullptr;
@@ -105,8 +105,8 @@ namespace Bloom
QToolButton* eepromInspectionButton = nullptr;
QWidget* footer = nullptr;
QLabel* targetStatusLabel = nullptr;
QLabel* programCounterValueLabel = nullptr;
Widgets::Label* targetStatusLabel = nullptr;
Widgets::Label* programCounterValueLabel = nullptr;
std::map<QString, Targets::TargetVariant> supportedVariantsByName;
const Targets::TargetVariant* selectedVariant = nullptr;

View File

@@ -12,14 +12,17 @@
</widget>
</item>
<item alignment="Qt::AlignHCenter">
<widget class="QLabel" name="version-label">
<widget class="Label" name="version-label">
<property name="text">
<string>Bloom</string>
</property>
</widget>
</item>
<item alignment="Qt::AlignHCenter">
<widget class="QLabel" name="link-label">
<widget class="Label" name="link-label">
<property name="textFormat">
<enum>Qt::TextFormat::RichText</enum>
</property>
<property name="text">
<string><![CDATA[
<a style="color: #3F86A0;" href="https://bloom.oscillate.io/">https://bloom.oscillate.io</a>
@@ -31,7 +34,7 @@
</widget>
</item>
<item alignment="Qt::AlignHCenter">
<widget class="QLabel" name="author-label">
<widget class="Label" name="author-label">
<property name="text">
<string>Nav Mohammed</string>
</property>
@@ -45,7 +48,10 @@
</spacer>
</item>
<item alignment="Qt::AlignHCenter">
<widget class="QLabel" name="os-link-label">
<widget class="Label" name="os-link-label">
<property name="textFormat">
<enum>Qt::TextFormat::RichText</enum>
</property>
<property name="text">
<string><![CDATA[
<span>Powered by <a style="color: #3F86A0;" href="https://bloom.oscillate.io/powered-by">open-source software</a></span>

View File

@@ -229,7 +229,7 @@
</property>
<layout class="QHBoxLayout">
<item alignment="Qt::AlignHCenter">
<widget class="QLabel" name="io-inspection-unavailable">
<widget class="Label" name="io-inspection-unavailable">
<property name="visible"><bool>false</bool></property>
<property name="alignment">
<enum>Qt::AlignCenter</enum>
@@ -331,7 +331,7 @@
</widget>
</item>
<item alignment="Qt::AlignLeft">
<widget class="QLabel" name="ram-inspection-btn-label">
<widget class="Label" name="ram-inspection-btn-label">
<property name="text">
<string>RAM</string>
</property>
@@ -382,7 +382,7 @@
</widget>
</item>
<item alignment="Qt::AlignLeft">
<widget class="QLabel" name="eeprom-inspection-btn-label">
<widget class="Label" name="eeprom-inspection-btn-label">
<property name="text">
<string>EEPROM</string>
</property>
@@ -418,7 +418,7 @@
<property name="margin"><number>0</number></property>
<item>
<widget class="QLabel" name="target-state">
<widget class="Label" name="target-state">
<property name="toolTip">
<string>Target State</string>
</property>
@@ -432,7 +432,7 @@
</spacer>
</item>
<item>
<widget class="QLabel" name="target-program-counter-value">
<widget class="Label" name="target-program-counter-value">
<property name="text">
<string>-</string>
</property>
@@ -442,14 +442,14 @@
</widget>
</item>
<item>
<widget class="QLabel" name="target-name">
<widget class="Label" name="target-name">
<property name="toolTip">
<string>Target Name</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="target-id">
<widget class="Label" name="target-id">
<property name="toolTip">
<string>Target ID</string>
</property>

View File

@@ -4,6 +4,7 @@
// Custom widgets
#include "Widgets/PanelWidget.hpp"
#include "Widgets/Label.hpp"
#include "Widgets/RotatableLabel.hpp"
#include "Widgets/LabeledSeparator.hpp"
#include "Widgets/TextInput.hpp"
@@ -27,6 +28,15 @@ namespace Bloom
return widget;
}
},
{
"Label",
[this] (QWidget* parent, const QString& name) {
auto* widget = new Label(parent);
widget->setObjectName(name);
widget->setStyleSheet(parent->styleSheet());
return widget;
}
},
{
"RotatableLabel",
[this] (QWidget* parent, const QString& name) {

View File

@@ -15,7 +15,9 @@ namespace Bloom::Widgets
const QString& windowTitle,
const QString& errorMessage,
QWidget* parent
): QDialog(parent) {
)
: QDialog(parent)
{
this->setObjectName("error-dialogue");
this->setAttribute(Qt::WA_DeleteOnClose, true);
this->setWindowTitle(windowTitle);
@@ -45,7 +47,7 @@ namespace Bloom::Widgets
auto uiLoader = UiLoader(this);
this->container = uiLoader.load(&dialogueUiFile, this);
this->errorMessageDescriptionLabel = this->container->findChild<QLabel*>(
this->errorMessageDescriptionLabel = this->container->findChild<Label*>(
"error-message-description-label"
);
this->okButton = this->container->findChild<QPushButton*>("ok-btn");

View File

@@ -1,10 +1,11 @@
#pragma once
#include <QDialog>
#include <QLabel>
#include <QPushButton>
#include <QShowEvent>
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
namespace Bloom::Widgets
{
class ErrorDialogue: public QDialog
@@ -19,7 +20,7 @@ namespace Bloom::Widgets
private:
QWidget* container = nullptr;
QLabel* errorMessageDescriptionLabel = nullptr;
Label* errorMessageDescriptionLabel = nullptr;
QPushButton* okButton = nullptr;
};
}

View File

@@ -36,7 +36,7 @@
</spacer>
</item>
<item alignment="Qt::AlignVCenter">
<widget class="QLabel" name="error-message-description-label">
<widget class="Label" name="error-message-description-label">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"/>
</property>

View File

@@ -0,0 +1,24 @@
#pragma once
#include <QLabel>
namespace Bloom::Widgets
{
class Label: public QLabel
{
Q_OBJECT
public:
explicit Label(QWidget* parent = nullptr)
: QLabel(parent)
{
this->setTextFormat(Qt::TextFormat::PlainText);
};
Label(const QString& text, QWidget* parent = nullptr)
: Label(parent)
{
this->setText(text);
};
};
}

View File

@@ -1,19 +1,23 @@
#pragma once
#include <QLabel>
#include <QSize>
#include "Label.hpp"
namespace Bloom::Widgets
{
class RotatableLabel: public QLabel
class RotatableLabel: public Label
{
Q_OBJECT
public:
RotatableLabel(const QString& text, QWidget* parent): QLabel(text, parent) {};
RotatableLabel(const QString& text, QWidget* parent)
: Label(text, parent)
{};
RotatableLabel(int angleDegrees, const QString& text, QWidget* parent)
: QLabel(text, parent),
angle(angleDegrees)
: Label(text, parent)
, angle(angleDegrees)
{};
void setAngle(int angleDegrees) {

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>

View File

@@ -12,7 +12,9 @@ namespace Bloom::Widgets
const ExcludedMemoryRegion& region,
const Targets::TargetMemoryDescriptor& memoryDescriptor,
QWidget* parent
): memoryRegion(region), RegionItem(region, memoryDescriptor, parent) {
)
: memoryRegion(region), RegionItem(region, memoryDescriptor, parent)
{
auto formUiFile = QFile(
QString::fromStdString(Paths::compiledResourcesPath()
+ "/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane"

View File

@@ -14,7 +14,9 @@ namespace Bloom::Widgets
const FocusedMemoryRegion& region,
const Targets::TargetMemoryDescriptor& memoryDescriptor,
QWidget* parent
): memoryRegion(region), RegionItem(region, memoryDescriptor, parent) {
)
: memoryRegion(region), RegionItem(region, memoryDescriptor, parent)
{
auto formUiFile = QFile(
QString::fromStdString(Paths::compiledResourcesPath()
+ "/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane"

View File

@@ -11,7 +11,10 @@ namespace Bloom::Widgets
const MemoryRegion& region,
const Targets::TargetMemoryDescriptor& memoryDescriptor,
QWidget* parent
): memoryDescriptor(memoryDescriptor), ClickableWidget(parent) {
)
: memoryDescriptor(memoryDescriptor)
, ClickableWidget(parent)
{
this->setObjectName("region-item");
this->setFixedHeight(50);
this->layout->setContentsMargins(5, 5, 5, 0);

View File

@@ -1,12 +1,13 @@
#pragma once
#include <QVBoxLayout>
#include <QLabel>
#include <QComboBox>
#include <map>
#include <QString>
#include <QStringList>
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/ClickableWidget.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/TextInput.hpp"
@@ -75,10 +76,10 @@ namespace Bloom::Widgets
private:
QVBoxLayout* layout = new QVBoxLayout(this);
QLabel* nameLabel = new QLabel(this);
QLabel* typeLabel = new QLabel(this);
QLabel* addressRangeLabel = new QLabel(this);
QLabel* timeLabel = new QLabel(this);
Label* nameLabel = new Label(this);
Label* typeLabel = new Label(this);
Label* addressRangeLabel = new Label(this);
Label* timeLabel = new Label(this);
static inline const std::map<QString, AddressRangeTypeOption> addressRangeTypeOptionsByName = std::map<
QString, AddressRangeTypeOption

View File

@@ -23,7 +23,7 @@
<item>
<layout class="QHBoxLayout" name="name-row">
<item alignment="Qt::AlignVCenter">
<widget class="QLabel" name="name-label">
<widget class="Label" name="name-label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"/>
</property>
@@ -97,7 +97,7 @@
</spacer>
</item>
<item>
<widget class="QLabel" name="address-range-description-label">
<widget class="Label" name="address-range-description-label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"/>
</property>
@@ -124,7 +124,7 @@
<item>
<layout class="QHBoxLayout" name="address-type-row">
<item alignment="Qt::AlignVCenter">
<widget class="QLabel" name="address-type-label">
<widget class="Label" name="address-type-label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"/>
</property>
@@ -187,7 +187,7 @@
<item>
<layout class="QHBoxLayout" name="start-address-row">
<item alignment="Qt::AlignVCenter">
<widget class="QLabel" name="start-address-label">
<widget class="Label" name="start-address-label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"/>
</property>
@@ -247,7 +247,7 @@
<item>
<layout class="QHBoxLayout" name="end-address-row">
<item alignment="Qt::AlignVCenter">
<widget class="QLabel" name="end-address-label">
<widget class="Label" name="end-address-label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"/>
</property>
@@ -291,7 +291,7 @@
</spacer>
</item>
<item alignment="Qt::AlignVCenter">
<widget class="QLabel" name="size-label">
<widget class="Label" name="size-label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"/>
</property>

View File

@@ -23,7 +23,7 @@
<item>
<layout class="QHBoxLayout" name="name-row">
<item alignment="Qt::AlignVCenter">
<widget class="QLabel" name="name-label">
<widget class="Label" name="name-label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"/>
</property>
@@ -97,7 +97,7 @@
</spacer>
</item>
<item>
<widget class="QLabel" name="address-range-description-label">
<widget class="Label" name="address-range-description-label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"/>
</property>
@@ -124,7 +124,7 @@
<item>
<layout class="QHBoxLayout" name="address-type-row">
<item alignment="Qt::AlignVCenter">
<widget class="QLabel" name="address-type-label">
<widget class="Label" name="address-type-label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"/>
</property>
@@ -187,7 +187,7 @@
<item>
<layout class="QHBoxLayout" name="start-address-row">
<item alignment="Qt::AlignVCenter">
<widget class="QLabel" name="start-address-label">
<widget class="Label" name="start-address-label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"/>
</property>
@@ -247,7 +247,7 @@
<item>
<layout class="QHBoxLayout" name="end-address-row">
<item alignment="Qt::AlignVCenter">
<widget class="QLabel" name="end-address-label">
<widget class="Label" name="end-address-label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"/>
</property>
@@ -291,7 +291,7 @@
</spacer>
</item>
<item alignment="Qt::AlignVCenter">
<widget class="QLabel" name="size-label">
<widget class="Label" name="size-label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"/>
</property>
@@ -371,7 +371,7 @@
</spacer>
</item>
<item>
<widget class="QLabel" name="value-annotations-description-label">
<widget class="Label" name="value-annotations-description-label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"/>
</property>
@@ -396,7 +396,7 @@
</spacer>
</item>
<item>
<widget class="QLabel" name="integer-width-notice-label">
<widget class="Label" name="integer-width-notice-label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"/>
</property>
@@ -423,7 +423,7 @@
<item>
<layout class="QHBoxLayout" name="data-type-row">
<item alignment="Qt::AlignVCenter">
<widget class="QLabel" name="data-type-label">
<widget class="Label" name="data-type-label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"/>
</property>
@@ -486,7 +486,7 @@
<item>
<layout class="QHBoxLayout" name="endianness-row">
<item alignment="Qt::AlignVCenter">
<widget class="QLabel" name="endianness-label">
<widget class="Label" name="endianness-label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"/>
</property>

View File

@@ -165,7 +165,7 @@
<item alignment="Qt::AlignLeft">
<layout class="QStackedLayout" name="stacked-form-layout">
<item>
<widget class="QLabel" name="stacked-form-placeholder-label">
<widget class="Label" name="stacked-form-placeholder-label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"/>
</property>

View File

@@ -1,10 +1,10 @@
#include "TargetMemoryInspectionPane.hpp"
#include <QHBoxLayout>
#include <QLabel>
#include <QToolButton>
#include "src/Insight/UserInterfaces/InsightWindow/UiLoader.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
#include "src/Insight/InsightWorker/Tasks/ReadTargetMemory.hpp"
#include "src/Insight/InsightWorker/Tasks/ReadStackPointer.hpp"
@@ -49,7 +49,7 @@ namespace Bloom::Widgets
this->titleBar = this->container->findChild<QWidget*>("title-bar");
this->titleBar->layout()->setContentsMargins(7, 0, 7, 0);
auto* titleLabel = this->titleBar->findChild<QLabel*>("title");
auto* titleLabel = this->titleBar->findChild<Label*>("title");
titleLabel->setText(
this->targetMemoryDescriptor.type == TargetMemoryType::EEPROM ? "Internal EEPROM" : "Internal RAM"
);

View File

@@ -27,7 +27,7 @@
<number>0</number>
</property>
<item>
<widget class="QLabel" name="title"/>
<widget class="Label" name="title"/>
</item>
<item>
<spacer name="horizontal-spacer">

View File

@@ -2,7 +2,6 @@
#include <QWidget>
#include <bitset>
#include <QLabel>
#include <QSize>
#include <QString>
#include <QEvent>

View File

@@ -29,8 +29,8 @@ namespace Bloom::Widgets
this
);
this->bitLabel = new QLabel("Bit", this);
this->bitNumberLabel = new QLabel(QString::number(this->bitNumber), this);
this->bitLabel = new Label("Bit", this);
this->bitNumberLabel = new Label(QString::number(this->bitNumber), this);
this->bitLabel->setObjectName("register-bit-label");
this->bitNumberLabel->setObjectName("register-bit-number-label");

View File

@@ -2,13 +2,13 @@
#include <QWidget>
#include <bitset>
#include <QLabel>
#include <QSize>
#include <QString>
#include <QEvent>
#include <QPaintEvent>
#include <QPainter>
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/ClickableWidget.hpp"
#include "BitBodyWidget.hpp"
@@ -49,7 +49,7 @@ namespace Bloom::Widgets
BitBodyWidget* body = nullptr;
QLabel* bitLabel = nullptr;
QLabel* bitNumberLabel = nullptr;
Label* bitLabel = nullptr;
Label* bitNumberLabel = nullptr;
};
}

View File

@@ -2,7 +2,6 @@
#include <QWidget>
#include <bitset>
#include <QLabel>
#include <QSize>
#include <QString>
#include <QEvent>

View File

@@ -2,9 +2,9 @@
#include <QDateTime>
#include <QHBoxLayout>
#include <QLabel>
#include "Item.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/SvgWidget.hpp"
#include "src/Targets/TargetMemory.hpp"
@@ -23,6 +23,6 @@ namespace Bloom::Widgets
private:
QHBoxLayout* layout = new QHBoxLayout(this);
QLabel* titleLabel = new QLabel(this);
Label* titleLabel = new Label(this);
};
}

View File

@@ -2,9 +2,9 @@
#include <QDateTime>
#include <QVBoxLayout>
#include <QLabel>
#include "Item.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
namespace Bloom::Widgets
{
@@ -21,8 +21,8 @@ namespace Bloom::Widgets
private:
QVBoxLayout* layout = new QVBoxLayout(this);
QLabel* dateLabel = new QLabel(this);
QLabel* valueLabel = new QLabel(this);
QLabel* descriptionLabel = new QLabel(this);
Label* dateLabel = new Label(this);
Label* valueLabel = new Label(this);
Label* descriptionLabel = new Label(this);
};
}

View File

@@ -7,6 +7,7 @@
#include <set>
#include "src/Insight/UserInterfaces/InsightWindow/UiLoader.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
#include "src/Helpers/Paths.hpp"
#include "src/Helpers/DateTime.hpp"
@@ -25,7 +26,11 @@ namespace Bloom::Widgets
const Targets::TargetMemoryBuffer& currentValue,
InsightWorker& insightWorker,
QWidget* parent
): QWidget(parent), registerDescriptor(registerDescriptor), insightWorker(insightWorker) {
)
: QWidget(parent)
, registerDescriptor(registerDescriptor)
, insightWorker(insightWorker)
{
this->setObjectName("target-register-history-widget");
this->setFixedWidth(300);
@@ -49,8 +54,8 @@ namespace Bloom::Widgets
this->itemContainer = this->container->findChild<QWidget*>("item-container");
this->itemContainerLayout = this->itemContainer->findChild<QVBoxLayout*>("item-container-layout");
auto titleBar = this->container->findChild<QWidget*>("title-bar");
auto title = titleBar->findChild<QLabel*>("title");
auto* titleBar = this->container->findChild<QWidget*>("title-bar");
auto* title = titleBar->findChild<Label*>("title");
titleBar->setContentsMargins(0, 0, 0, 0);
title->setFixedHeight(titleBar->height());
@@ -76,7 +81,7 @@ namespace Bloom::Widgets
auto* separatorWidget = new QWidget(this);
auto* separatorLayout = new QHBoxLayout(separatorWidget);
auto* separatorLabel = new QLabel("Select an item to restore", separatorWidget);
auto* separatorLabel = new Label("Select an item to restore", separatorWidget);
separatorWidget->setFixedHeight(40);
separatorWidget->setObjectName("separator-widget");
separatorLayout->setContentsMargins(0, 10, 0, 10);

View File

@@ -1,7 +1,6 @@
#pragma once
#include <QWidget>
#include <QLabel>
#include <QVBoxLayout>
#include <set>
#include <QSize>

View File

@@ -16,7 +16,7 @@
<property name="minimumHeight">
<number>30</number>
</property>
<widget class="QLabel" name="title">
<widget class="Label" name="title">
<property name="text"><string>Register History</string></property>
</widget>
</widget>

View File

@@ -123,7 +123,7 @@ namespace Bloom::Widgets
this->registerValueTextInput->setDisabled(true);
this->applyButton->setVisible(false);
auto* readOnlyIndicatorLabel = this->registerValueContainer->findChild<QLabel*>(
auto* readOnlyIndicatorLabel = this->registerValueContainer->findChild<Label*>(
"read-only-indicator-label"
);
readOnlyIndicatorLabel->show();

View File

@@ -1,7 +1,6 @@
#pragma once
#include <QWidget>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <set>
@@ -14,6 +13,7 @@
#include "src/Targets/TargetRegister.hpp"
#include "src/Targets/TargetState.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
#include "BitsetWidget/BitsetWidget.hpp"
#include "RegisterHistoryWidget/RegisterHistoryWidget.hpp"
@@ -47,8 +47,8 @@ namespace Bloom::Widgets
InsightWorker& insightWorker;
QWidget* container = nullptr;
QLabel* registerNameLabel = nullptr;
QLabel* registerDescriptionLabel = nullptr;
Label* registerNameLabel = nullptr;
Label* registerDescriptionLabel = nullptr;
QScrollArea* contentContainer = nullptr;
RegisterHistoryWidget* registerHistoryWidget = nullptr;

View File

@@ -70,7 +70,7 @@
<number>20</number>
</property>
<item>
<widget class="QLabel" name="register-details-name-label">
<widget class="Label" name="register-details-name-label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"/>
</property>
@@ -130,7 +130,7 @@
</spacer>
</item>
<item>
<widget class="QLabel" name="register-details-label">
<widget class="Label" name="register-details-label">
<property name="wordWrap">
<bool>true</bool>
</property>
@@ -160,7 +160,7 @@
<number>20</number>
</property>
<item>
<widget class="QLabel" name="register-details-start-address-label">
<widget class="Label" name="register-details-start-address-label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"/>
</property>
@@ -196,7 +196,7 @@
<number>20</number>
</property>
<item>
<widget class="QLabel" name="register-details-size-label">
<widget class="Label" name="register-details-size-label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"/>
</property>
@@ -232,7 +232,7 @@
<number>20</number>
</property>
<item alignment="Qt::AlignTop">
<widget class="QLabel" name="register-details-description-label">
<widget class="Label" name="register-details-description-label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"/>
</property>
@@ -294,7 +294,7 @@
<number>0</number>
</property>
<item>
<widget class="QLabel" name="read-only-indicator-label">
<widget class="Label" name="read-only-indicator-label">
<property name="visible">
<bool>false</bool>
</property>

View File

@@ -3,7 +3,6 @@
#include <QWidget>
#include <unordered_set>
#include <QVBoxLayout>
#include <QLabel>
#include <QSize>
#include <set>
@@ -11,8 +10,9 @@
#include "ItemWidget.hpp"
#include "src/Insight/InsightWorker/InsightWorker.hpp"
#include "../ClickableWidget.hpp"
#include "../SvgWidget.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/ClickableWidget.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/SvgWidget.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
namespace Bloom::Widgets
{
@@ -46,7 +46,7 @@ namespace Bloom::Widgets
ItemWidget* headerWidget = new ItemWidget(this);
SvgWidget* arrowIcon = new SvgWidget(this->headerWidget);
SvgWidget* registerGroupIcon = new SvgWidget(this->headerWidget);
QLabel* label = new QLabel(this->headerWidget);
Label* label = new Label(this->headerWidget);
QWidget* bodyWidget = new QWidget(this);
};
}

View File

@@ -3,7 +3,6 @@
#include <QWidget>
#include <unordered_set>
#include <QHBoxLayout>
#include <QLabel>
#include <QAction>
#include <QSize>
#include <QEvent>
@@ -12,6 +11,7 @@
#include "ItemWidget.hpp"
#include "src/Insight/InsightWorker/InsightWorker.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/SvgWidget.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/TargetRegisterInspectorWindow.hpp"
@@ -55,8 +55,8 @@ namespace Bloom::Widgets
InsightWorker& insightWorker;
QHBoxLayout* layout = new QHBoxLayout(this);
SvgWidget* registerIcon = new SvgWidget(this);
QLabel* nameLabel = new QLabel(this);
QLabel* valueLabel = new QLabel(this);
Label* nameLabel = new Label(this);
Label* valueLabel = new Label(this);
// Context-menu actions
QAction* openInspectionWindowAction = new QAction("Inspect", this);

View File

@@ -27,7 +27,7 @@
<number>0</number>
</property>
<item>
<widget class="QLabel" name="title">
<widget class="Label" name="title">
<property name="text"><string>Target Registers</string></property>
</widget>
</item>

View File

@@ -9,7 +9,9 @@ namespace Bloom::Widgets::InsightTargetWidgets::Dip
const TargetVariant& targetVariant,
InsightWorker& insightWorker,
QWidget* parent
): TargetPinWidget(pinDescriptor, targetVariant, insightWorker, parent) {
)
: TargetPinWidget(pinDescriptor, targetVariant, insightWorker, parent)
{
this->setFixedSize(PinWidget::MINIMUM_WIDTH, PinWidget::MAXIMUM_HEIGHT);
this->layout = new QVBoxLayout();
@@ -28,7 +30,7 @@ namespace Bloom::Widgets::InsightTargetWidgets::Dip
this->pinNameLabelText = QString::fromStdString(pinDescriptor.name).toUpper();
this->pinNameLabelText.truncate(5);
this->pinNumberLabel = new QLabel(this);
this->pinNumberLabel = new Label(this);
this->pinNumberLabel->setObjectName("target-pin-number");
this->pinNumberLabel->setText(QString::number(pinDescriptor.number));
this->pinNumberLabel->setAlignment(Qt::AlignmentFlag::AlignCenter);

View File

@@ -3,10 +3,10 @@
#include <QWidget>
#include <cstdint>
#include <QVBoxLayout>
#include <QLabel>
#include <QPainter>
#include "../TargetPinWidget.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/TargetPinWidget.hpp"
#include "PinBodyWidget.hpp"
#include "src/Targets/TargetVariant.hpp"
@@ -57,7 +57,7 @@ namespace Bloom::Widgets::InsightTargetWidgets::Dip
private:
QVBoxLayout* layout = nullptr;
QLabel* pinNumberLabel = nullptr;
Label* pinNumberLabel = nullptr;
PinBodyWidget* bodyWidget = nullptr;
};
}

View File

@@ -45,7 +45,7 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp
this->pinNameLabelText = QString::fromStdString(pinDescriptor.name).toUpper();
this->pinNameLabelText.truncate(5);
this->pinNumberLabel = new QLabel(this);
this->pinNumberLabel = new Label(this);
this->pinNumberLabel->setObjectName("target-pin-number");
auto pinNumberText = QString::number(pinDescriptor.number);
pinNumberText.truncate(5);

View File

@@ -3,9 +3,10 @@
#include <QWidget>
#include <cstdint>
#include <QBoxLayout>
#include <QLabel>
#include "../TargetPinWidget.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/TargetPinWidget.hpp"
#include "PinBodyWidget.hpp"
#include "src/Targets/TargetVariant.hpp"
@@ -55,9 +56,9 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp
private:
QBoxLayout* layout = nullptr;
QLabel* pinNumberLabel = nullptr;
QLabel* pinNameLabel = nullptr;
QLabel* pinDirectionLabel = nullptr;
Label* pinNumberLabel = nullptr;
Label* pinNameLabel = nullptr;
Label* pinDirectionLabel = nullptr;
PinBodyWidget* bodyWidget = nullptr;
};
}