Fixed pin alignment issue with Insight QFP target widget.
This commit is contained in:
@@ -112,12 +112,7 @@ void QuadFlatPackageWidget::drawWidget(QPainter& painter) {
|
|||||||
|
|
||||||
auto parentContainerHeight = parentWidget->height();
|
auto parentContainerHeight = parentWidget->height();
|
||||||
auto parentContainerWidth = parentWidget->width();
|
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 verticalPinWidgetHeight = PinWidget::MAXIMUM_VERTICAL_HEIGHT;
|
||||||
auto verticalPinWidgetWidth = PinWidget::MAXIMUM_VERTICAL_WIDTH;
|
auto verticalPinWidgetWidth = PinWidget::MAXIMUM_VERTICAL_WIDTH;
|
||||||
auto horizontalPinWidgetHeight = PinWidget::MAXIMUM_HORIZONTAL_HEIGHT;
|
auto horizontalPinWidgetHeight = PinWidget::MAXIMUM_HORIZONTAL_HEIGHT;
|
||||||
@@ -125,15 +120,22 @@ void QuadFlatPackageWidget::drawWidget(QPainter& painter) {
|
|||||||
|
|
||||||
auto pinCountPerLayout = static_cast<int>(this->pinWidgets.size() / 4);
|
auto pinCountPerLayout = static_cast<int>(this->pinWidgets.size() / 4);
|
||||||
|
|
||||||
auto width = ((horizontalPinWidgetHeight + QuadFlatPackageWidget::PIN_WIDGET_SPACING) * pinCountPerLayout
|
/*
|
||||||
+ QuadFlatPackageWidget::PIN_WIDGET_LAYOUT_PADDING);
|
* Horizontal layouts are the right and left pin layouts - the ones that hold horizontal pin widgets.
|
||||||
|
* The bottom and top layouts are vertical layouts, as they hold the vertical pin widgets.
|
||||||
|
*/
|
||||||
|
auto horizontalLayoutHeight = ((horizontalPinWidgetHeight + QuadFlatPackageWidget::PIN_WIDGET_SPACING) * pinCountPerLayout
|
||||||
|
+ QuadFlatPackageWidget::PIN_WIDGET_LAYOUT_PADDING - QuadFlatPackageWidget::PIN_WIDGET_SPACING);
|
||||||
|
|
||||||
auto containerWidth = width + (horizontalPinWidgetWidth * 2);
|
auto verticalLayoutWidth = ((verticalPinWidgetWidth + QuadFlatPackageWidget::PIN_WIDGET_SPACING) * pinCountPerLayout
|
||||||
|
+ QuadFlatPackageWidget::PIN_WIDGET_LAYOUT_PADDING - QuadFlatPackageWidget::PIN_WIDGET_SPACING);
|
||||||
|
|
||||||
|
auto containerWidth = verticalLayoutWidth + (horizontalPinWidgetWidth * 2);
|
||||||
|
|
||||||
this->topPinLayout->setGeometry(QRect(
|
this->topPinLayout->setGeometry(QRect(
|
||||||
horizontalPinWidgetWidth,
|
horizontalPinWidgetWidth,
|
||||||
0,
|
0,
|
||||||
width,
|
verticalLayoutWidth,
|
||||||
verticalPinWidgetHeight
|
verticalPinWidgetHeight
|
||||||
));
|
));
|
||||||
|
|
||||||
@@ -141,34 +143,34 @@ void QuadFlatPackageWidget::drawWidget(QPainter& painter) {
|
|||||||
0,
|
0,
|
||||||
verticalPinWidgetHeight,
|
verticalPinWidgetHeight,
|
||||||
containerWidth,
|
containerWidth,
|
||||||
width
|
horizontalLayoutHeight
|
||||||
));
|
));
|
||||||
|
|
||||||
this->leftPinLayout->setGeometry(QRect(
|
this->leftPinLayout->setGeometry(QRect(
|
||||||
0,
|
0,
|
||||||
verticalPinWidgetHeight,
|
verticalPinWidgetHeight,
|
||||||
horizontalPinWidgetWidth,
|
horizontalPinWidgetWidth,
|
||||||
width
|
horizontalLayoutHeight
|
||||||
));
|
));
|
||||||
|
|
||||||
this->bodyWidget->setGeometry(QRect(
|
this->bodyWidget->setGeometry(QRect(
|
||||||
horizontalPinWidgetWidth,
|
horizontalPinWidgetWidth,
|
||||||
verticalPinWidgetHeight,
|
verticalPinWidgetHeight,
|
||||||
width,
|
horizontalLayoutHeight,
|
||||||
width
|
horizontalLayoutHeight
|
||||||
));
|
));
|
||||||
|
|
||||||
this->rightPinLayout->setGeometry(QRect(
|
this->rightPinLayout->setGeometry(QRect(
|
||||||
width + horizontalPinWidgetWidth,
|
horizontalLayoutHeight + horizontalPinWidgetWidth,
|
||||||
verticalPinWidgetHeight,
|
verticalPinWidgetHeight,
|
||||||
horizontalPinWidgetWidth,
|
horizontalPinWidgetWidth,
|
||||||
width
|
horizontalLayoutHeight
|
||||||
));
|
));
|
||||||
|
|
||||||
this->bottomPinLayout->setGeometry(QRect(
|
this->bottomPinLayout->setGeometry(QRect(
|
||||||
horizontalPinWidgetWidth,
|
horizontalPinWidgetWidth,
|
||||||
verticalPinWidgetHeight + width,
|
verticalPinWidgetHeight + horizontalLayoutHeight,
|
||||||
width,
|
verticalLayoutWidth,
|
||||||
verticalPinWidgetHeight
|
verticalPinWidgetHeight
|
||||||
));
|
));
|
||||||
|
|
||||||
@@ -202,7 +204,7 @@ void QuadFlatPackageWidget::drawWidget(QPainter& painter) {
|
|||||||
pinWidgetLayoutMargin
|
pinWidgetLayoutMargin
|
||||||
);
|
);
|
||||||
|
|
||||||
auto containerHeight = width + (verticalPinWidgetHeight * 2);
|
auto containerHeight = horizontalLayoutHeight + (verticalPinWidgetHeight * 2);
|
||||||
this->setGeometry(
|
this->setGeometry(
|
||||||
(parentContainerWidth / 2) - (containerWidth / 2),
|
(parentContainerWidth / 2) - (containerWidth / 2),
|
||||||
(parentContainerHeight / 2) - (containerHeight / 2),
|
(parentContainerHeight / 2) - (containerHeight / 2),
|
||||||
|
|||||||
Reference in New Issue
Block a user