Tidying unused constants & redundant code

This commit is contained in:
Nav
2021-12-30 18:10:55 +00:00
parent 3b4284be5f
commit 3d273a8a79
4 changed files with 1 additions and 13 deletions

View File

@@ -2,8 +2,6 @@
#include <QPainter>
#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;

View File

@@ -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

View File

@@ -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;

View File

@@ -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());
}