fritzing: fix build with qt >= 6.9 (#400019)

This commit is contained in:
K900
2025-05-01 07:49:13 +03:00
committed by GitHub
2 changed files with 62 additions and 0 deletions
@@ -50,6 +50,11 @@ stdenv.mkDerivation {
hash = "sha256-a/bWAUeDPj3g8BECOlXuqyCi4JgGLLs1605m380Drt0=";
};
patches = [
# Fix build with Qt >= 6.9
./fix-stricter-types.patch
];
nativeBuildInputs = [
qmake
pkg-config
@@ -0,0 +1,57 @@
diff --git a/src/items/paletteitembase.cpp b/src/items/paletteitembase.cpp
index 49db343e..8760ba55 100644
--- a/src/items/paletteitembase.cpp
+++ b/src/items/paletteitembase.cpp
@@ -626,7 +626,7 @@ QString PaletteItemBase::retrieveSvg(ViewLayer::ViewLayerID viewLayerID, QHash<Q
//DebugDialog::debug(QString("path: %1").arg(path));
- QString svg = svgHash.value(path + xmlName + QString(QChar(m_viewLayerPlacement)), "");
+ QString svg = svgHash.value(path + xmlName + QString(QChar(static_cast<ushort>(m_viewLayerPlacement))), "");
if (!svg.isEmpty()) return svg;
SvgFileSplitter splitter;
@@ -657,7 +657,7 @@ QString PaletteItemBase::retrieveSvg(ViewLayer::ViewLayerID viewLayerID, QHash<Q
return "";
}
svg = splitter.elementString(xmlName);
- svgHash.insert(path + xmlName + QString(QChar(m_viewLayerPlacement)), svg);
+ svgHash.insert(path + xmlName + QString(QChar(static_cast<ushort>(m_viewLayerPlacement))), svg);
return svg;
}
diff --git a/src/items/resistor.cpp b/src/items/resistor.cpp
index e2a23fd8..3fb4c669 100644
--- a/src/items/resistor.cpp
+++ b/src/items/resistor.cpp
@@ -260,7 +260,7 @@ bool Resistor::collectExtraInfo(QWidget * parent, const QString & family, const
validator->setSymbol(OhmSymbol);
validator->setConverter(TextUtils::convertFromPowerPrefix);
validator->setBounds(MIN_RESISTANCE, MAX_RESISTANCE);
- validator->setRegularExpression(QRegularExpression(QString("((\\d{1,10})|(\\d{1,10}\\.)|(\\d{1,10}\\.\\d{1,5}))[\\x%1umkMG]{0,1}[\\x03A9]{0,1}").arg(TextUtils::MicroSymbolCode, 4, 16, QChar('0'))));
+ validator->setRegularExpression(QRegularExpression(QString("((\\d{1,10})|(\\d{1,10}\\.)|(\\d{1,10}\\.\\d{1,5}))[\\x%1umkMG]{0,1}[\\x03A9]{0,1}").arg(static_cast<int>(TextUtils::MicroSymbolCode), 4, 16, QChar('0'))));
focusOutComboBox->setValidator(validator);
connect(focusOutComboBox->validator(), SIGNAL(sendState(QValidator::State)), this, SLOT(textModified(QValidator::State)));
connect(focusOutComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(resistanceEntry(int)));
diff --git a/src/utils/textutils.cpp b/src/utils/textutils.cpp
index a1a28d51..3d3aa8e0 100644
--- a/src/utils/textutils.cpp
+++ b/src/utils/textutils.cpp
@@ -79,7 +79,7 @@ const QString TextUtils::AdobeIllustratorIdentifier = "Generator: Adobe Illustra
QList<QString> PowerPrefixes;
QList<double> PowerPrefixValues;
-const QString TextUtils::PowerPrefixesString = QString("pnmkMGTu\\x%1").arg(MicroSymbolCode, 4, 16, QChar('0'));
+const QString TextUtils::PowerPrefixesString = QString("pnmkMGTu\\x%1").arg(static_cast<int>(MicroSymbolCode), 4, 16, QChar('0'));
typedef QHash<QString /*brokenFont*/, QString /*replacementFont*/> FixedFontsHash;
@@ -763,7 +763,7 @@ QString TextUtils::convertExtendedChars(const QString & str)
result.append(c);
}
else {
- result.append(QString("&#x%1;").arg(c.unicode(), 0, 16));
+ result.append("&#x" + QString::number(c.unicode(), 16) + ";");
}
}