From 3d273a8a7910afad795fa1a7eb404d4328b43f67 Mon Sep 17 00:00:00 2001 From: Nav Date: Thu, 30 Dec 2021 18:10:55 +0000 Subject: [PATCH] Tidying unused constants & redundant code --- .../Widgets/TargetWidgets/DIP/PinBodyWidget.cpp | 8 -------- .../InsightWindow/Widgets/TargetWidgets/DIP/PinWidget.hpp | 3 --- .../InsightWindow/Widgets/TargetWidgets/QFP/PinWidget.hpp | 1 - .../Widgets/TargetWidgets/TargetPinBodyWidget.cpp | 2 +- 4 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/PinBodyWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/PinBodyWidget.cpp index 42d8f475..2cbc24bf 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/PinBodyWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/PinBodyWidget.cpp @@ -2,8 +2,6 @@ #include -#include "src/Logger/Logger.hpp" - using namespace Bloom::Widgets::InsightTargetWidgets::Dip; using namespace Bloom::Targets; @@ -18,12 +16,6 @@ void PinBodyWidget::paintEvent(QPaintEvent* event) { } void PinBodyWidget::drawWidget(QPainter& painter) { - auto parentWidget = this->parentWidget(); - - if (parentWidget == nullptr) { - Logger::error("PinBodyWidget requires a parent widget"); - } - painter.setRenderHints(QPainter::RenderHint::Antialiasing | QPainter::RenderHint::SmoothPixmapTransform, true); auto pinWidth = PinBodyWidget::WIDTH; auto pinHeight = PinBodyWidget::HEIGHT; diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/PinWidget.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/PinWidget.hpp index f390ae29..59183741 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/PinWidget.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/PinWidget.hpp @@ -29,10 +29,7 @@ namespace Bloom::Widgets::InsightTargetWidgets::Dip static constexpr int PIN_LABEL_SPACING = 2; static constexpr int PIN_LABEL_LONG_LINE_LENGTH = 25; static constexpr int PIN_LABEL_SHORT_LINE_LENGTH = 5; - static constexpr int MAXIMUM_LABEL_COUNT = 3; static constexpr int LABEL_HEIGHT = 20; - static constexpr int MAXIMUM_PIN_NUMBER_LABEL_WIDTH = 26; - static constexpr int MAXIMUM_PIN_DIRECTION_LABEL_WIDTH = 24; static constexpr int MAXIMUM_LABEL_WIDTH = 42; static constexpr int MAXIMUM_LABEL_HEIGHT = 20; static constexpr int MAXIMUM_HEIGHT = PinBodyWidget::HEIGHT + PinWidget::PIN_LABEL_SPACING diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/QFP/PinWidget.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/QFP/PinWidget.hpp index 56f8e982..f9efcbd6 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/QFP/PinWidget.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/QFP/PinWidget.hpp @@ -26,7 +26,6 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp public: static constexpr int PIN_WIDGET_LAYOUT_PADDING = 46; static constexpr int WIDTH_SPACING = 4; - static constexpr int MAXIMUM_LABEL_COUNT = 3; static constexpr int PIN_LABEL_LONG_LINE_LENGTH = 25; static constexpr int PIN_LABEL_SHORT_LINE_LENGTH = 5; static constexpr int PIN_LABEL_SPACING = 2; diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/TargetPinBodyWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/TargetPinBodyWidget.cpp index a8e1148a..22403cb1 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/TargetPinBodyWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/TargetPinBodyWidget.cpp @@ -6,7 +6,7 @@ using namespace Bloom::Widgets::InsightTargetWidgets; using namespace Bloom::Targets; TargetPinBodyWidget::TargetPinBodyWidget(QWidget* parent, Targets::TargetPinDescriptor pinDescriptor) -:QWidget(parent), pinDescriptor(std::move(pinDescriptor)) { +: QWidget(parent), pinDescriptor(std::move(pinDescriptor)) { this->setObjectName("target-pin-body"); this->setToolTip(QString::fromStdString(this->pinDescriptor.name).toUpper()); }