Files
BloomPatched/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/QFP/PinBodyWidget.cpp
Nav 6edfb7376a Tidied structure of all classes within the entire code base
Also some other small bits of tidying
2021-10-31 11:36:28 +00:00

32 lines
874 B
C++

#include "PinBodyWidget.hpp"
#include <QPainter>
#include <QEvent>
using namespace Bloom::Widgets::InsightTargetWidgets::Qfp;
using namespace Bloom::Targets;
void PinBodyWidget::paintEvent(QPaintEvent* event) {
auto painter = QPainter(this);
this->drawWidget(painter);
}
void PinBodyWidget::drawWidget(QPainter& painter) {
painter.setRenderHints(QPainter::RenderHint::Antialiasing | QPainter::RenderHint::SmoothPixmapTransform, true);
auto pinWidth = this->isVertical ? PinBodyWidget::WIDTH : PinBodyWidget::HEIGHT;
auto pinHeight = this->isVertical ? PinBodyWidget::HEIGHT : PinBodyWidget::WIDTH;
this->setFixedSize(pinWidth, pinHeight);
auto pinColor = this->getBodyColor();
painter.setPen(Qt::PenStyle::NoPen);
painter.setBrush(pinColor);
painter.drawRect(
0,
0,
pinWidth,
pinHeight
);
}