Qt6 compatability changes

This commit is contained in:
Nav
2021-08-18 22:51:15 +01:00
parent 29ab3aa3b8
commit 01c20339f3
7 changed files with 16 additions and 14 deletions

View File

@@ -25,8 +25,8 @@ void SupportedFeaturesQuery::init() {
auto featureString = featureList.at(i);
// We only care about supported features. Supported features will precede a '+' character.
if (featureString[featureString.size() - 1] == "+") {
featureString.remove("+");
if (featureString[featureString.size() - 1] == '+') {
featureString.remove('+');
auto feature = gdbFeatureMapping.valueAt(featureString.toStdString());
if (feature.has_value()) {

View File

@@ -18,7 +18,7 @@ void WriteRegister::init() {
}
auto packetSegments = QString::fromStdString(packet).split("=");
this->registerNumber = static_cast<int>(packetSegments.front().midRef(1).toUInt(nullptr, 16));
this->registerNumber = static_cast<int>(packetSegments.front().mid(1).toUInt(nullptr, 16));
this->registerValue = Packet::hexToData(packetSegments.back().toStdString());
std::reverse(this->registerValue.begin(), this->registerValue.end());
}

View File

@@ -34,7 +34,7 @@ DualInlinePackageWidget::DualInlinePackageWidget(
this->pinWidgets.reserve(targetVariant.pinDescriptorsByNumber.size());
this->layout = new QVBoxLayout();
this->layout->setSpacing(8);
this->layout->setMargin(0);
this->layout->setContentsMargins(0, 0, 0, 0);
this->topPinLayout = new QHBoxLayout();
this->topPinLayout->setSpacing(8);

View File

@@ -14,7 +14,7 @@ using namespace Bloom::Targets;
PinWidget::PinWidget(QWidget* parent, const TargetPinDescriptor& pinDescriptor, const TargetVariant& targetVariant):
TargetPinWidget(parent, pinDescriptor, targetVariant) {
this->layout = new QVBoxLayout();
this->layout->setMargin(0);
this->layout->setContentsMargins(0, 0, 0, 0);
this->layout->setSpacing(0);
this->bodyWidget = new PinBodyWidget(this, this->pinDescriptor);

View File

@@ -13,8 +13,8 @@ using namespace Bloom::Targets;
PinWidget::PinWidget(QWidget* parent, const TargetPinDescriptor& pinDescriptor, const TargetVariant& targetVariant):
TargetPinWidget(parent, pinDescriptor, targetVariant) {
this->layout = new QVBoxLayout();
this->layout->setMargin(0);
this->layout = new QBoxLayout(QBoxLayout::TopToBottom);
this->layout->setContentsMargins(0, 0, 0, 0);
this->layout->setSpacing(0);
auto pinCountPerLayout = (targetVariant.pinDescriptorsByNumber.size() / 4);
@@ -68,14 +68,14 @@ PinWidget::PinWidget(QWidget* parent, const TargetPinDescriptor& pinDescriptor,
}
this->layout->addWidget(this->bodyWidget);
this->layout->insertSpacing(1, 3);
this->layout->addSpacing(3);
if (this->isLeftLayout || this->isRightLayout) {
auto stackedLabelLayout = new QVBoxLayout();
stackedLabelLayout->addWidget(this->pinNameLabel);
stackedLabelLayout->insertSpacing(3, 2);
stackedLabelLayout->addSpacing(2);
stackedLabelLayout->addWidget(this->pinNumberLabel);
this->layout->insertSpacing(2, 4);
this->layout->addSpacing(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
@@ -84,15 +84,16 @@ PinWidget::PinWidget(QWidget* parent, const TargetPinDescriptor& pinDescriptor,
} else if (this-isTopLayout || this->isBottomLayout) {
this->layout->addWidget(this->pinNumberLabel);
this->layout->insertSpacing(3, 2);
this->layout->addSpacing(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->addSpacing(2);
this->layout->addWidget(this->pinDirectionLabel);
this->layout->addStretch(1);
this->setLayout(this->layout);

View File

@@ -1,6 +1,7 @@
#pragma once
#include <QWidget>
#include <QBoxLayout>
#include <QLabel>
#include "../TargetPinWidget.hpp"
@@ -13,7 +14,7 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp
{
Q_OBJECT
private:
QVBoxLayout* layout = nullptr;
QBoxLayout* layout = nullptr;
QLabel* pinNumberLabel = nullptr;
QLabel* pinNameLabel = nullptr;
QLabel* pinDirectionLabel = nullptr;

View File

@@ -32,7 +32,7 @@ QuadFlatPackageWidget::QuadFlatPackageWidget(
this->pinWidgets.reserve(targetVariant.pinDescriptorsByNumber.size());
this->layout = new QVBoxLayout();
this->layout->setSpacing(0);
this->layout->setMargin(0);
this->layout->setContentsMargins(0, 0, 0, 0);
this->horizontalLayout = new QHBoxLayout();
this->horizontalLayout->setSpacing(0);