Initial commit

This commit is contained in:
Nav
2021-04-04 21:04:12 +01:00
commit a29c5e1fec
549 changed files with 441216 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
#include <QPainter>
#include <cmath>
#include "BodyWidget.hpp"
#include "src/Logger/Logger.hpp"
using namespace Bloom::InsightTargetWidgets::Qfp;
void BodyWidget::paintEvent(QPaintEvent* event) {
auto painter = QPainter(this);
this->drawWidget(painter);
}
void BodyWidget::drawWidget(QPainter& painter) {
painter.setRenderHints(QPainter::RenderHint::Antialiasing | QPainter::RenderHint::SmoothPixmapTransform, true);
auto targetBodyColor = this->getBodyColor();
auto backgroundColor = QColor("#3C3F41");
if (!this->isEnabled()) {
targetBodyColor.setAlpha(this->getDisableAlphaLevel());
}
painter.setPen(Qt::PenStyle::NoPen);
painter.setBrush(targetBodyColor);
auto containerGeometry = this->geometry();
auto targetBodyWidth = containerGeometry.width() - 16;
auto targetBodyHeight = containerGeometry.height() - 16;
auto targetBodyPoint = QPoint(
(containerGeometry.width() / 2) - (targetBodyWidth / 2),
(containerGeometry.height() / 2) - (targetBodyHeight / 2)
);
painter.drawRect(
targetBodyPoint.x(),
targetBodyPoint.y(),
targetBodyWidth,
targetBodyHeight
);
painter.setBrush(backgroundColor);
painter.drawEllipse(QRectF(
targetBodyPoint.x() + 10,
targetBodyPoint.y() + 10,
15,
15
));
}

View File

@@ -0,0 +1,42 @@
#pragma once
#include <QWidget>
namespace Bloom::InsightTargetWidgets::Qfp
{
class BodyWidget: public QWidget
{
Q_OBJECT
Q_PROPERTY(QColor bodyColor READ getBodyColor WRITE setBodyColor DESIGNABLE true)
Q_PROPERTY(int disableAlphaLevel READ getDisableAlphaLevel WRITE setDisableAlphaLevel DESIGNABLE true)
private:
QColor bodyColor = QColor("#AFB1B3");
int disableAlphaLevel = 100;
protected:
void paintEvent(QPaintEvent* event);
void drawWidget(QPainter& painter);
public:
BodyWidget(QWidget* parent): QWidget(parent) {
this->setObjectName("target-body");
}
QColor getBodyColor() const {
return this->bodyColor;
}
void setBodyColor(QColor color) {
this->bodyColor = color;
}
int getDisableAlphaLevel() const {
return this->disableAlphaLevel;
}
void setDisableAlphaLevel(int level) {
this->disableAlphaLevel = level;
}
};
}

View File

@@ -0,0 +1,91 @@
#include <QPainter>
#include <QLayout>
#include <cmath>
#include <QEvent>
#include <QMenu>
#include <QContextMenuEvent>
#include "PinBodyWidget.hpp"
#include "src/Logger/Logger.hpp"
#include "src/Exceptions/Exception.hpp"
using namespace Bloom::InsightTargetWidgets::Qfp;
using namespace Bloom::Exceptions;
void PinBodyWidget::paintEvent(QPaintEvent* event) {
auto painter = QPainter(this);
this->drawWidget(painter);
}
bool PinBodyWidget::event(QEvent* event)
{
if (this->isEnabled() && this->pinState.has_value() && this->pinState->ioDirection == TargetPinState::IoDirection::OUTPUT) {
switch (event->type()) {
case QEvent::Enter: {
this->hoverActive = true;
this->repaint();
break;
}
case QEvent::Leave: {
this->hoverActive = false;
this->repaint();
break;
}
default: {
break;
}
}
}
return QWidget::event(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 = this->isVertical ? PinBodyWidget::WIDTH : PinBodyWidget::HEIGHT;
auto pinHeight = this->isVertical ? PinBodyWidget::HEIGHT : PinBodyWidget::WIDTH;
this->setFixedSize(pinWidth, pinHeight);
auto pinColor = this->getBodyColor();
if (this->pinDescriptor.type == TargetPinType::VCC) {
pinColor = QColor("#ff3d43");
} else if (this->pinDescriptor.type == TargetPinType::GND) {
pinColor = QColor("#575757");
}
if (this->pinState.has_value()) {
if (this->pinState->ioState.has_value()
&& this->pinState->ioDirection.has_value()
&& this->pinState->ioState.value() == TargetPinState::IoState::HIGH
) {
pinColor = this->pinState->ioDirection.value() == TargetPinState::IoDirection::OUTPUT ?
QColor("#3D7F96") : QColor("#A47E3E");
}
}
if (!this->hoverActive) {
pinColor.setAlpha(225);
}
if (!this->isEnabled()) {
pinColor.setAlpha(this->getDisableAlphaLevel());
}
painter.setPen(Qt::PenStyle::NoPen);
painter.setBrush(pinColor);
painter.drawRect(
0,
0,
pinWidth,
pinHeight
);
}

View File

@@ -0,0 +1,80 @@
#pragma once
#include <QWidget>
#include <QMouseEvent>
#include "src/Targets/TargetPinDescriptor.hpp"
namespace Bloom::InsightTargetWidgets::Qfp
{
using Targets::TargetPinDescriptor;
using Targets::TargetPinType;
using Targets::TargetPinState;
class PinBodyWidget: public QWidget
{
Q_OBJECT
Q_PROPERTY(QColor bodyColor READ getBodyColor WRITE setBodyColor DESIGNABLE true)
Q_PROPERTY(int disableAlphaLevel READ getDisableAlphaLevel WRITE setDisableAlphaLevel DESIGNABLE true)
private:
TargetPinDescriptor pinDescriptor;
std::optional<TargetPinState> pinState;
QColor bodyColor = QColor("#AFB1B3");
int disableAlphaLevel = 100;
bool isVertical = false;
protected:
bool hoverActive = false;
void paintEvent(QPaintEvent* event) override;
void drawWidget(QPainter& painter);
bool event(QEvent* event) override;
void mouseReleaseEvent(QMouseEvent* event) override {
if (event->button() == Qt::MouseButton::LeftButton) {
emit this->clicked();
}
QWidget::mouseReleaseEvent(event);
}
public:
static const int WIDTH = 30;
static const int HEIGHT = 40;
PinBodyWidget(QWidget* parent, const TargetPinDescriptor& pinDescriptor, bool isVertical):
QWidget(parent), pinDescriptor(pinDescriptor), isVertical(isVertical) {
this->setObjectName("target-pin-body");
if (isVertical) {
this->setFixedSize(PinBodyWidget::WIDTH, PinBodyWidget::HEIGHT);
} else {
this->setFixedSize(PinBodyWidget::HEIGHT, PinBodyWidget::WIDTH);
}
}
void setPinState(const TargetPinState& pinState) {
this->pinState = pinState;
}
QColor getBodyColor() const {
return this->bodyColor;
}
void setBodyColor(QColor color) {
this->bodyColor = color;
}
int getDisableAlphaLevel() const {
return this->disableAlphaLevel;
}
void setDisableAlphaLevel(int level) {
this->disableAlphaLevel = level;
}
signals:
void clicked();
};
}

View File

@@ -0,0 +1,97 @@
#include <QWidget>
#include <QPainter>
#include <QLayout>
#include <cmath>
#include <QEvent>
#include "PinWidget.hpp"
#include "PinBodyWidget.hpp"
#include "src/Logger/Logger.hpp"
using namespace Bloom::InsightTargetWidgets::Qfp;
PinWidget::PinWidget(QWidget* parent, const TargetPinDescriptor& pinDescriptor, const TargetVariant& targetVariant):
TargetPinWidget(parent, pinDescriptor, targetVariant) {
this->layout = new QVBoxLayout();
this->layout->setMargin(0);
this->layout->setSpacing(0);
auto pinCountPerLayout = (targetVariant.pinDescriptorsByNumber.size() / 4);
this->isLeftLayout = pinDescriptor.number <= pinCountPerLayout;
this->isBottomLayout = pinDescriptor.number > pinCountPerLayout && pinDescriptor.number <= (pinCountPerLayout * 2);
this->isRightLayout = pinDescriptor.number > (pinCountPerLayout * 2) && pinDescriptor.number <= (pinCountPerLayout * 3);
this->isTopLayout = pinDescriptor.number > (pinCountPerLayout * 3) && pinDescriptor.number <= (pinCountPerLayout * 4);
this->bodyWidget = new PinBodyWidget(this, this->pinDescriptor, (this->isTopLayout || this->isBottomLayout));
this->pinDirectionLabel = new QLabel(this);
this->pinDirectionLabel->setObjectName("target-pin-direction");
this->pinDirectionLabel->setAlignment(Qt::AlignmentFlag::AlignCenter);
this->pinNameLabel = new QLabel(this);
this->pinNameLabel->setObjectName("target-pin-name");
auto pinName = QString::fromStdString(pinDescriptor.name).toUpper();
pinName.truncate(5);
this->pinNameLabel->setText(pinName);
this->pinNameLabel->setAlignment(Qt::AlignmentFlag::AlignCenter);
this->pinNumberLabel = new QLabel(this);
this->pinNumberLabel->setObjectName("target-pin-number");
auto pinNumberText = QString::number(pinDescriptor.number);
pinNumberText.truncate(5);
this->pinNumberLabel->setText(QString::number(pinDescriptor.number));
this->pinNumberLabel->setAlignment(Qt::AlignmentFlag::AlignCenter);
if (this->isLeftLayout) {
this->layout->setAlignment((Qt::AlignmentFlag::AlignVCenter | Qt::AlignmentFlag::AlignRight));
this->layout->setDirection(QBoxLayout::Direction::RightToLeft);
this->setFixedSize(PinWidget::MAXIMUM_HORIZONTAL_WIDTH, PinWidget::MAXIMUM_HORIZONTAL_HEIGHT);
} else if (this->isBottomLayout) {
this->layout->setAlignment(Qt::AlignmentFlag::AlignHCenter | Qt::AlignmentFlag::AlignTop);
this->layout->setDirection(QBoxLayout::Direction::TopToBottom);
this->setFixedSize(PinWidget::MAXIMUM_VERTICAL_WIDTH, PinWidget::MAXIMUM_VERTICAL_HEIGHT);
} else if (this->isRightLayout) {
this->layout->setAlignment((Qt::AlignmentFlag::AlignVCenter | Qt::AlignmentFlag::AlignLeft));
this->layout->setDirection(QBoxLayout::Direction::LeftToRight);
this->setFixedSize(PinWidget::MAXIMUM_HORIZONTAL_WIDTH, PinWidget::MAXIMUM_HORIZONTAL_HEIGHT);
} else if (this->isTopLayout) {
this->layout->setAlignment((Qt::AlignmentFlag::AlignHCenter | Qt::AlignmentFlag::AlignBottom));
this->layout->setDirection(QBoxLayout::Direction::BottomToTop);
this->setFixedSize(PinWidget::MAXIMUM_VERTICAL_WIDTH, PinWidget::MAXIMUM_VERTICAL_HEIGHT);
}
this->layout->addWidget(this->bodyWidget);
this->layout->insertSpacing(1, 3);
if (this->isLeftLayout || this->isRightLayout) {
auto stackedLabelLayout = new QVBoxLayout();
stackedLabelLayout->addWidget(this->pinNameLabel);
stackedLabelLayout->insertSpacing(3, 2);
stackedLabelLayout->addWidget(this->pinNumberLabel);
this->layout->insertSpacing(2, 4);
this->layout->addLayout(stackedLabelLayout);
// Adjust the pin name label width for horizontal pins to accommodate for pin names up to 5 characters in length
this->pinNameLabel->setFixedSize(PinWidget::MAXIMUM_LABEL_WIDTH + 5, PinWidget::MAXIMUM_HORIZONTAL_HEIGHT / 2);
this->pinNumberLabel->setFixedSize(PinWidget::MAXIMUM_LABEL_WIDTH + 5, PinWidget::MAXIMUM_HORIZONTAL_HEIGHT / 2);
} else if (this-isTopLayout || this->isBottomLayout) {
this->layout->addWidget(this->pinNumberLabel);
this->layout->insertSpacing(3, 2);
this->layout->addWidget(this->pinNameLabel);
this->pinNameLabel->setFixedSize(PinBodyWidget::WIDTH, PinWidget::LABEL_HEIGHT - 2);
this->pinNumberLabel->setFixedSize(PinBodyWidget::WIDTH, PinWidget::LABEL_HEIGHT - 2);
}
this->layout->insertSpacing(5, 2);
this->layout->addWidget(this->pinDirectionLabel);
this->setLayout(this->layout);
connect(this->bodyWidget, &PinBodyWidget::clicked, this, &TargetPinWidget::onWidgetBodyClicked);
}

View File

@@ -0,0 +1,69 @@
#pragma once
#include <QWidget>
#include <QLabel>
#include "../TargetPinWidget.hpp"
#include "PinBodyWidget.hpp"
#include "src/Targets/TargetVariant.hpp"
namespace Bloom::InsightTargetWidgets::Qfp
{
class PinWidget: public TargetPinWidget
{
Q_OBJECT
private:
QVBoxLayout* layout = nullptr;
QLabel* pinNumberLabel = nullptr;
QLabel* pinNameLabel = nullptr;
QLabel* pinDirectionLabel = nullptr;
PinBodyWidget* bodyWidget = nullptr;
bool isLeftLayout = false;
bool isBottomLayout = false;
bool isRightLayout = false;
bool isTopLayout = false;
void setLabelColor(QString hexColor) {
auto style = QString("QLabel { color: " + hexColor + "; }");
if (this->pinNumberLabel != nullptr) {
// this->pinNumberLabel->setStyleSheet(style);
}
if (this->pinNameLabel != nullptr) {
this->pinNameLabel->setStyleSheet(style);
}
}
public:
static const int MAXIMUM_SPACING = 8;
static const int MAXIMUM_LABEL_COUNT = 3;
static const int LABEL_HEIGHT = 20;
static const int MAXIMUM_LABEL_WIDTH = PinBodyWidget::WIDTH;
static const int MAXIMUM_LABEL_HEIGHT = 20;
static const int MAXIMUM_HORIZONTAL_WIDTH = PinBodyWidget::HEIGHT + (PinWidget::MAXIMUM_LABEL_WIDTH * PinWidget::MAXIMUM_LABEL_COUNT);
static const int MAXIMUM_HORIZONTAL_HEIGHT = PinBodyWidget::WIDTH;
static const int MAXIMUM_VERTICAL_HEIGHT = PinBodyWidget::HEIGHT + (PinWidget::MAXIMUM_LABEL_HEIGHT * PinWidget::MAXIMUM_LABEL_COUNT);
static const int MAXIMUM_VERTICAL_WIDTH = PinBodyWidget::WIDTH;
PinWidget(QWidget* parent, const TargetPinDescriptor& pinDescriptor, const TargetVariant& targetVariant);
virtual void updatePinState(const TargetPinState& pinState) override {
TargetPinWidget::updatePinState(pinState);
if (pinState.ioDirection.has_value()) {
this->pinDirectionLabel->setText(pinState.ioDirection.value() == TargetPinState::IoDirection::INPUT ?
"IN" : "OUT");
} else {
this->pinDirectionLabel->setText("");
}
if (this->bodyWidget != nullptr) {
this->bodyWidget->setPinState(pinState);
}
this->setLabelColor(this->pinStateChanged ? "#6FA0FF" : "#a6a7aa");
}
};
}

View File

@@ -0,0 +1,213 @@
#include <QPainter>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <vector>
#include <QEvent>
#include <QFile>
#include "../../InsightWindow.hpp"
#include "QuadFlatPackageWidget.hpp"
#include "src/Logger/Logger.hpp"
#include "src/Exceptions/Exception.hpp"
#include "PinWidget.hpp"
#include "BodyWidget.hpp"
using namespace Bloom::InsightTargetWidgets::Qfp;
using namespace Bloom::Exceptions;
QuadFlatPackageWidget::QuadFlatPackageWidget(const TargetVariant& targetVariant, QObject* insightWindowObj, QWidget* parent):
TargetPackageWidget(targetVariant, insightWindowObj, parent) {
assert((targetVariant.pinDescriptorsByNumber.size() % 4) == 0);
auto stylesheetFile = QFile("/home/nav/Projects/Bloom/src/Insight/UserInterfaces/InsightWindow/TargetWidgets/QFP/Stylesheets/QuadFlatPackage.qss");
stylesheetFile.open(QFile::ReadOnly);
this->setStyleSheet(stylesheetFile.readAll());
this->pinWidgets.reserve(targetVariant.pinDescriptorsByNumber.size());
this->layout = new QVBoxLayout();
this->layout->setSpacing(0);
this->layout->setMargin(0);
this->horizontalLayout = new QHBoxLayout();
this->horizontalLayout->setSpacing(0);
this->horizontalLayout->setDirection(QBoxLayout::Direction::LeftToRight);
this->topPinLayout = new QHBoxLayout();
this->topPinLayout->setSpacing(QuadFlatPackageWidget::PIN_WIDGET_SPACING);
this->topPinLayout->setDirection(QBoxLayout::Direction::RightToLeft);
this->rightPinLayout = new QVBoxLayout();
this->rightPinLayout->setSpacing(QuadFlatPackageWidget::PIN_WIDGET_SPACING);
this->rightPinLayout->setDirection(QBoxLayout::Direction::BottomToTop);
this->bottomPinLayout = new QHBoxLayout();
this->bottomPinLayout->setSpacing(QuadFlatPackageWidget::PIN_WIDGET_SPACING);
this->bottomPinLayout->setDirection(QBoxLayout::Direction::LeftToRight);
this->leftPinLayout = new QVBoxLayout();
this->leftPinLayout->setSpacing(QuadFlatPackageWidget::PIN_WIDGET_SPACING);
this->leftPinLayout->setDirection(QBoxLayout::Direction::TopToBottom);
auto insightWindow = qobject_cast<InsightWindow*>(insightWindowObj);
assert(insightWindow != nullptr);
auto pinCountPerLayout = (targetVariant.pinDescriptorsByNumber.size() / 4);
for (const auto& [targetPinNumber, targetPinDescriptor]: targetVariant.pinDescriptorsByNumber) {
auto pinWidget = new PinWidget(this, targetPinDescriptor, targetVariant);
this->pinWidgets.push_back(pinWidget);
if (targetPinNumber <= pinCountPerLayout) {
this->leftPinLayout->addWidget(pinWidget, 0, Qt::AlignmentFlag::AlignRight);
} else if (targetPinNumber > pinCountPerLayout && targetPinNumber <= (pinCountPerLayout * 2)) {
this->bottomPinLayout->addWidget(pinWidget, 0, Qt::AlignmentFlag::AlignTop);
} else if (targetPinNumber > (pinCountPerLayout * 2) && targetPinNumber <= (pinCountPerLayout * 3)) {
this->rightPinLayout->addWidget(pinWidget, 0, Qt::AlignmentFlag::AlignLeft);
} else if (targetPinNumber > (pinCountPerLayout * 3) && targetPinNumber <= (pinCountPerLayout * 4)) {
this->topPinLayout->addWidget(pinWidget, 0, Qt::AlignmentFlag::AlignBottom);
}
connect(pinWidget, &TargetPinWidget::toggleIoState, insightWindow, &InsightWindow::togglePinIoState);
}
this->bodyWidget = new BodyWidget(this);
this->layout->addLayout(this->topPinLayout);
this->horizontalLayout->addLayout(this->leftPinLayout);
this->horizontalLayout->addWidget(this->bodyWidget);
this->horizontalLayout->addLayout(this->rightPinLayout);
this->layout->addLayout(this->horizontalLayout);
this->layout->addLayout(this->bottomPinLayout);
this->setLayout(this->layout);
auto insightWindowWidget = this->window();
assert(insightWindowWidget != nullptr);
insightWindowWidget->setMinimumHeight(
std::max(
500,
static_cast<int>((PinWidget::MAXIMUM_HORIZONTAL_HEIGHT * pinCountPerLayout)
+ (PinWidget::MAXIMUM_VERTICAL_HEIGHT * 2)) + 300
)
);
insightWindowWidget->setMinimumWidth(
std::max(
1000,
static_cast<int>((PinWidget::MAXIMUM_VERTICAL_WIDTH * pinCountPerLayout)
+ (PinWidget::MAXIMUM_VERTICAL_WIDTH * 2)) + 300
)
);
}
void QuadFlatPackageWidget::paintEvent(QPaintEvent* event) {
auto painter = QPainter(this);
this->drawWidget(painter);
}
void QuadFlatPackageWidget::drawWidget(QPainter& painter) {
auto parentWidget = this->parentWidget();
assert(parentWidget != nullptr);
auto parentContainerHeight = parentWidget->height();
auto parentContainerWidth = parentWidget->width();
// auto verticalPinWidgetHeight = this->topPinLayout->findChildren<PinWidget*>().front()->height();
// auto verticalPinWidgetWidth = this->topPinLayout->findChildren<PinWidget*>().front()->width();
// auto horizontalPinWidgetHeight = this->leftPinLayout->findChildren<PinWidget*>().front()->height();
// auto horizontalPinWidgetWidth = this->leftPinLayout->findChildren<PinWidget*>().front()->width();
auto verticalPinWidgetHeight = PinWidget::MAXIMUM_VERTICAL_HEIGHT;
auto verticalPinWidgetWidth = PinWidget::MAXIMUM_VERTICAL_WIDTH;
auto horizontalPinWidgetHeight = PinWidget::MAXIMUM_HORIZONTAL_HEIGHT;
auto horizontalPinWidgetWidth = PinWidget::MAXIMUM_HORIZONTAL_WIDTH;
auto pinCountPerLayout = static_cast<int>(this->pinWidgets.size() / 4);
auto width = ((horizontalPinWidgetHeight + QuadFlatPackageWidget::PIN_WIDGET_SPACING) * pinCountPerLayout
+ QuadFlatPackageWidget::PIN_WIDGET_LAYOUT_PADDING);
auto containerWidth = width + (horizontalPinWidgetWidth * 2);
this->topPinLayout->setGeometry(QRect(
horizontalPinWidgetWidth,
0,
width,
verticalPinWidgetHeight
));
this->horizontalLayout->setGeometry(QRect(
0,
verticalPinWidgetHeight,
containerWidth,
width
));
this->leftPinLayout->setGeometry(QRect(
0,
verticalPinWidgetHeight,
horizontalPinWidgetWidth,
width
));
this->bodyWidget->setGeometry(QRect(
horizontalPinWidgetWidth,
verticalPinWidgetHeight,
width,
width
));
this->rightPinLayout->setGeometry(QRect(
width + horizontalPinWidgetWidth,
verticalPinWidgetHeight,
horizontalPinWidgetWidth,
width
));
this->bottomPinLayout->setGeometry(QRect(
horizontalPinWidgetWidth,
verticalPinWidgetHeight + width,
width,
verticalPinWidgetHeight
));
auto pinWidgetLayoutMargin = QuadFlatPackageWidget::PIN_WIDGET_LAYOUT_PADDING / 2;
this->topPinLayout->setContentsMargins(
pinWidgetLayoutMargin,
0,
pinWidgetLayoutMargin,
0
);
this->bottomPinLayout->setContentsMargins(
pinWidgetLayoutMargin,
0,
pinWidgetLayoutMargin,
0
);
this->leftPinLayout->setContentsMargins(
0,
pinWidgetLayoutMargin,
0,
pinWidgetLayoutMargin
);
this->rightPinLayout->setContentsMargins(
0,
pinWidgetLayoutMargin,
0,
pinWidgetLayoutMargin
);
auto containerHeight = width + (verticalPinWidgetHeight * 2);
this->setGeometry(
(parentContainerWidth / 2) - (containerWidth / 2),
(parentContainerHeight / 2) - (containerHeight / 2),
containerWidth,
containerHeight
);
}

View File

@@ -0,0 +1,41 @@
#pragma once
#include <QWidget>
#include <vector>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include "../TargetPackageWidget.hpp"
#include "PinWidget.hpp"
#include "BodyWidget.hpp"
#include "src/Targets/TargetVariant.hpp"
namespace Bloom::InsightTargetWidgets::Qfp
{
using Targets::TargetVariant;
/**
* QuadFlatPackageWidget implements a custom Qt widget for Quad-flat package variants.
*/
class QuadFlatPackageWidget: public TargetPackageWidget
{
Q_OBJECT
private:
QVBoxLayout* layout = nullptr;
QHBoxLayout* horizontalLayout = nullptr;
QHBoxLayout* topPinLayout = nullptr;
QVBoxLayout* rightPinLayout = nullptr;
QHBoxLayout* bottomPinLayout = nullptr;
QVBoxLayout* leftPinLayout = nullptr;
BodyWidget* bodyWidget = nullptr;
protected:
void paintEvent(QPaintEvent* event);
void drawWidget(QPainter& painter);
public:
static const int PIN_WIDGET_LAYOUT_PADDING = 46;
static const int PIN_WIDGET_SPACING = 8;
QuadFlatPackageWidget(const TargetVariant& targetVariant, QObject* insightWindowObj, QWidget* parent);
};
}

View File

@@ -0,0 +1,30 @@
#target-pin-number,
#target-pin-number {
font-size: 14px;
}
#target-pin-name,
#target-pin-direction {
font-size: 11px;
}
#target-pin-name {
color: #a6a7aa;
}
#target-pin-direction {
color: #8a8a8d;
}
#target-pin-number {
}
#target-body {
qproperty-bodyColor: #A6A8AB;
qproperty-disableAlphaLevel: 100;
}
#target-pin-body {
qproperty-bodyColor: #A6A8AB;
qproperty-disableAlphaLevel: 100;
}