TechDraw: Use QStringLiteral

This commit is contained in:
Benjamin Bræstrup Sayoc
2025-02-09 17:51:41 +01:00
parent 97b9b6de89
commit 9a8bdbaf9f
41 changed files with 250 additions and 250 deletions

View File

@@ -108,11 +108,11 @@ std::string DimensionFormatter::formatValue(const qreal value,
// neverheless limited. To keep old drawings, we limit the number of decimals too
// if the TD preferences option to use the global decimal number is set
// the formatSpecifier can have a prefix and/or suffix
if (m_dimension->useDecimals() && formatSpecifier.contains(QString::fromLatin1("%g"), Qt::CaseInsensitive)) {
if (m_dimension->useDecimals() && formatSpecifier.contains(QStringLiteral("%g"), Qt::CaseInsensitive)) {
int globalPrecision = Base::UnitsApi::getDecimals();
// change formatSpecifier to e.g. "%.2f"
QString newSpecifier = QString::fromStdString("%." + std::to_string(globalPrecision) + "f");
formatSpecifier.replace(QString::fromLatin1("%g"), newSpecifier, Qt::CaseInsensitive);
formatSpecifier.replace(QStringLiteral("%g"), newSpecifier, Qt::CaseInsensitive);
}
// since we are not using a multiValueSchema, we know that angles are in '°' and for
@@ -129,14 +129,14 @@ std::string DimensionFormatter::formatValue(const qreal value,
double userVal;
if (angularMeasure) {
userVal = asQuantity.getValue();
qBasicUnit = QString::fromUtf8("°");
qBasicUnit = QStringLiteral("°");
}
else {
double convertValue = Base::Quantity::parse("1" + qBasicUnit.toStdString()).getValue();
userVal = asQuantity.getValue() / convertValue;
if (areaMeasure) {
userVal = userVal / convertValue; // divide again as area is length²
qBasicUnit = qBasicUnit + QString::fromUtf8("²");
qBasicUnit = qBasicUnit + QStringLiteral("²");
}
}
@@ -287,11 +287,11 @@ std::string DimensionFormatter::getFormattedDimensionValue(const int partial) co
// tolerance might start with a plus sign that we don't want, so cut it off
// note plus sign is not at pos = 0!
QRegularExpression plus(QString::fromUtf8("^\\s*\\+"));
QRegularExpression plus(QStringLiteral("^\\s*\\+"));
tolerance.remove(plus);
return (labelText +
QString::fromUtf8(" \xC2\xB1 ") + // +/- symbol
QStringLiteral(" \xC2\xB1 ") + // +/- symbol
tolerance).toStdString();
if (partial == 2) {
@@ -398,7 +398,7 @@ std::string DimensionFormatter::getDefaultFormatSpec(bool isToleranceFormat) con
}
if (isToleranceFormat) {
formatSpec.replace(QString::fromUtf8("%"), QString::fromUtf8("%+"));
formatSpec.replace(QStringLiteral("%"), QStringLiteral("%+"));
}
return formatSpec.toStdString();

View File

@@ -141,7 +141,7 @@ QString DrawSVGTemplate::processTemplate()
// XPath query to select all <tspan> nodes whose <text> parent
// has "freecad:editable" attribute
query.processItems(QString::fromUtf8(
query.processItems(QStringLiteral(
"declare default element namespace \"" SVG_NS_URI "\"; "
"declare namespace freecad=\"" FREECAD_SVG_NS_URI "\"; "
"//text[@" FREECAD_ATTR_EDITABLE "]/tspan"),
@@ -158,7 +158,7 @@ QString DrawSVGTemplate::processTemplate()
QString editableValue = QString::fromUtf8(item->second.c_str());
// Keep all spaces in the text node
tspan.setAttribute(QString::fromUtf8("xml:space"), QString::fromUtf8("preserve"));
tspan.setAttribute(QStringLiteral("xml:space"), QStringLiteral("preserve"));
// Remove all child nodes and append text node with editable replacement as the only descendant
while (!tspan.lastChild().isNull()) {
@@ -181,13 +181,13 @@ void DrawSVGTemplate::extractTemplateAttributes(QDomDocument& templateDocument)
Base::Quantity quantity;
// Obtain the width
QString str = docElement.attribute(QString::fromLatin1("width"));
QString str = docElement.attribute(QStringLiteral("width"));
quantity = Base::Quantity::parse(str.toStdString());
quantity.setUnit(Base::Unit::Length);
Width.setValue(quantity.getValue());
str = docElement.attribute(QString::fromLatin1("height"));
str = docElement.attribute(QStringLiteral("height"));
quantity = Base::Quantity::parse(str.toStdString());
quantity.setUnit(Base::Unit::Length);
@@ -258,7 +258,7 @@ std::map<std::string, std::string> DrawSVGTemplate::getEditableTextsFromTemplate
// XPath query to select all <tspan> nodes whose <text> parent
// has "freecad:editable" attribute
query.processItems(QString::fromUtf8(
query.processItems(QStringLiteral(
"declare default element namespace \"" SVG_NS_URI "\"; "
"declare namespace freecad=\"" FREECAD_SVG_NS_URI "\"; "
"//text[@" FREECAD_ATTR_EDITABLE "]/tspan"),
@@ -301,7 +301,7 @@ QString DrawSVGTemplate::getAutofillByEditableName(QString nameToMatch)
// XPath query to select all <tspan> nodes whose <text> parent
// has "freecad:editable" attribute
query.processItems(QString::fromUtf8(
query.processItems(QStringLiteral(
"declare default element namespace \"" SVG_NS_URI "\"; "
"declare namespace freecad=\"" FREECAD_SVG_NS_URI "\"; "
"//text[@" FREECAD_ATTR_EDITABLE "]/tspan"),

View File

@@ -1964,7 +1964,7 @@ QString DrawUtil::qbaToDebug(const QByteArray& line)
if ((c >= 0x20) && (c <= 126)) {
s.append(QChar::fromLatin1(c));
} else {
s.append(QString::fromUtf8("<%1>").arg(c, 2, 16, QChar::fromLatin1('0')));
s.append(QStringLiteral("<%1>").arg(c, 2, 16, QChar::fromLatin1('0')));
}
}
return s;

View File

@@ -123,7 +123,7 @@ std::vector<std::string> DrawViewSymbol::getEditableFields()
// XPath query to select all <tspan> nodes whose <text> parent
// has "freecad:editable" attribute
query.processItems(QString::fromUtf8("declare default element namespace \"" SVG_NS_URI "\"; "
query.processItems(QStringLiteral("declare default element namespace \"" SVG_NS_URI "\"; "
"declare namespace freecad=\"" FREECAD_SVG_NS_URI "\"; "
"//text[@" FREECAD_ATTR_EDITABLE "]/tspan"),
[&editables](QDomElement& tspan) -> bool {
@@ -152,7 +152,7 @@ void DrawViewSymbol::updateFieldsInSymbol()
// XPath query to select all <tspan> nodes whose <text> parent
// has "freecad:editable" attribute
query.processItems(QString::fromUtf8("declare default element namespace \"" SVG_NS_URI "\"; "
query.processItems(QStringLiteral("declare default element namespace \"" SVG_NS_URI "\"; "
"declare namespace freecad=\"" FREECAD_SVG_NS_URI "\"; "
"//text[@" FREECAD_ATTR_EDITABLE "]/tspan"),
[&symbolDocument, &editText, &count](QDomElement& tspanElement) -> bool {
@@ -161,8 +161,8 @@ void DrawViewSymbol::updateFieldsInSymbol()
return false;
}
// Keep all spaces in the text node
tspanElement.setAttribute(QString::fromUtf8("xml:space"),
QString::fromUtf8("preserve"));
tspanElement.setAttribute(QStringLiteral("xml:space"),
QStringLiteral("preserve"));
// Remove all child nodes (if any)
while (!tspanElement.lastChild().isNull()) {

View File

@@ -446,12 +446,12 @@ void CmdTechDrawView::activated(int iMsg)
QString filename = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(),
QObject::tr("Select a SVG or Image file to open"),
Preferences::defaultSymbolDir(),
QString::fromLatin1("%1 (*.svg *.svgz *.jpg *.jpeg *.png *.bmp);;%2 (*.*)")
QStringLiteral("%1 (*.svg *.svgz *.jpg *.jpeg *.png *.bmp);;%2 (*.*)")
.arg(QObject::tr("SVG or Image files"), QObject::tr("All Files")));
if (!filename.isEmpty()) {
if (filename.endsWith(QString::fromLatin1(".svg"), Qt::CaseInsensitive)
|| filename.endsWith(QString::fromLatin1(".svgz"), Qt::CaseInsensitive)) {
if (filename.endsWith(QStringLiteral(".svg"), Qt::CaseInsensitive)
|| filename.endsWith(QStringLiteral(".svgz"), Qt::CaseInsensitive)) {
std::string FeatName = getUniqueObjectName("Symbol");
filename = Base::Tools::escapeEncodeFilename(filename);
auto filespec = DU::cleanFilespecBackslash(filename.toStdString());
@@ -765,12 +765,12 @@ Gui::Action* CmdTechDrawSectionGroup::createAction()
QAction* p1 = pcAction->addAction(QString());
p1->setIcon(Gui::BitmapFactory().iconFromTheme("actions/TechDraw_SectionView"));
p1->setObjectName(QString::fromLatin1("TechDraw_SectionView"));
p1->setWhatsThis(QString::fromLatin1("TechDraw_SectionView"));
p1->setObjectName(QStringLiteral("TechDraw_SectionView"));
p1->setWhatsThis(QStringLiteral("TechDraw_SectionView"));
QAction* p2 = pcAction->addAction(QString());
p2->setIcon(Gui::BitmapFactory().iconFromTheme("actions/TechDraw_ComplexSection"));
p2->setObjectName(QString::fromLatin1("TechDraw_ComplexSection"));
p2->setWhatsThis(QString::fromLatin1("TechDraw_ComplexSection"));
p2->setObjectName(QStringLiteral("TechDraw_ComplexSection"));
p2->setWhatsThis(QStringLiteral("TechDraw_ComplexSection"));
_pcAction = pcAction;
languageChange();
@@ -1552,7 +1552,7 @@ void CmdTechDrawSymbol::activated(int iMsg)
QString filename = Gui::FileDialog::getOpenFileName(
Gui::getMainWindow(), QObject::tr("Choose an SVG file to open"),
Preferences::defaultSymbolDir(),
QString::fromLatin1("%1 (*.svg *.svgz);;%2 (*.*)")
QStringLiteral("%1 (*.svg *.svgz);;%2 (*.*)")
.arg(QObject::tr("Scalable Vector Graphic"), QObject::tr("All Files")));
if (!filename.isEmpty()) {
@@ -1882,7 +1882,7 @@ void CmdTechDrawExportPageDXF::activated(int iMsg)
QString defaultDir;
QString fileName = Gui::FileDialog::getSaveFileName(
Gui::getMainWindow(), QString::fromUtf8(QT_TR_NOOP("Save DXF file")), defaultDir,
QString::fromUtf8("DXF (*.dxf)"));
QStringLiteral("DXF (*.dxf)"));
if (fileName.isEmpty()) {
return;

View File

@@ -247,16 +247,16 @@ Gui::Action * CmdTechDrawCosmeticVertexGroup::createAction()
QAction* p1 = pcAction->addAction(QString());
p1->setIcon(Gui::BitmapFactory().iconFromTheme("actions/TechDraw_CosmeticVertex"));
p1->setObjectName(QString::fromLatin1("TechDraw_CosmeticVertex"));
p1->setWhatsThis(QString::fromLatin1("TechDraw_CosmeticVertex"));
p1->setObjectName(QStringLiteral("TechDraw_CosmeticVertex"));
p1->setWhatsThis(QStringLiteral("TechDraw_CosmeticVertex"));
QAction* p2 = pcAction->addAction(QString());
p2->setIcon(Gui::BitmapFactory().iconFromTheme("actions/TechDraw_Midpoints"));
p2->setObjectName(QString::fromLatin1("TechDraw_Midpoints"));
p2->setWhatsThis(QString::fromLatin1("TechDraw_Midpoints"));
p2->setObjectName(QStringLiteral("TechDraw_Midpoints"));
p2->setWhatsThis(QStringLiteral("TechDraw_Midpoints"));
QAction* p3 = pcAction->addAction(QString());
p3->setIcon(Gui::BitmapFactory().iconFromTheme("actions/TechDraw_Quadrants"));
p3->setObjectName(QString::fromLatin1("TechDraw_Quadrants"));
p3->setWhatsThis(QString::fromLatin1("TechDraw_Quadrants"));
p3->setObjectName(QStringLiteral("TechDraw_Quadrants"));
p3->setWhatsThis(QStringLiteral("TechDraw_Quadrants"));
_pcAction = pcAction;
languageChange();
@@ -621,16 +621,16 @@ Gui::Action * CmdTechDrawCenterLineGroup::createAction()
QAction* p1 = pcAction->addAction(QString());
p1->setIcon(Gui::BitmapFactory().iconFromTheme("actions/TechDraw_FaceCenterLine"));
p1->setObjectName(QString::fromLatin1("TechDraw_FaceCenterLine"));
p1->setWhatsThis(QString::fromLatin1("TechDraw_FaceCenterLine"));
p1->setObjectName(QStringLiteral("TechDraw_FaceCenterLine"));
p1->setWhatsThis(QStringLiteral("TechDraw_FaceCenterLine"));
QAction* p2 = pcAction->addAction(QString());
p2->setIcon(Gui::BitmapFactory().iconFromTheme("actions/TechDraw_2LineCenterline"));
p2->setObjectName(QString::fromLatin1("TechDraw_2LineCenterLine"));
p2->setWhatsThis(QString::fromLatin1("TechDraw_2LineCenterLine"));
p2->setObjectName(QStringLiteral("TechDraw_2LineCenterLine"));
p2->setWhatsThis(QStringLiteral("TechDraw_2LineCenterLine"));
QAction* p3 = pcAction->addAction(QString());
p3->setIcon(Gui::BitmapFactory().iconFromTheme("actions/TechDraw_2PointCenterline"));
p3->setObjectName(QString::fromLatin1("TechDraw_2PointCenterLine"));
p3->setWhatsThis(QString::fromLatin1("TechDraw_2PointCenterLine"));
p3->setObjectName(QStringLiteral("TechDraw_2PointCenterLine"));
p3->setWhatsThis(QStringLiteral("TechDraw_2PointCenterLine"));
_pcAction = pcAction;
languageChange();

View File

@@ -574,7 +574,7 @@ public:
private:
QString getCrosshairCursorSVGName() const override
{
return QString::fromLatin1("TechDraw_Dimension_Pointer");
return QStringLiteral("TechDraw_Dimension_Pointer");
}
protected:
@@ -2003,12 +2003,12 @@ Gui::Action* CmdTechDrawExtentGroup::createAction()
QAction* p1 = pcAction->addAction(QString());
p1->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_HorizontalExtentDimension"));
p1->setObjectName(QString::fromLatin1("TechDraw_HorizontalExtentDimension"));
p1->setWhatsThis(QString::fromLatin1("TechDraw_HorizontalExtentDimension"));
p1->setObjectName(QStringLiteral("TechDraw_HorizontalExtentDimension"));
p1->setWhatsThis(QStringLiteral("TechDraw_HorizontalExtentDimension"));
QAction* p2 = pcAction->addAction(QString());
p2->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_VerticalExtentDimension"));
p2->setObjectName(QString::fromLatin1("TechDraw_VerticalExtentDimension"));
p2->setWhatsThis(QString::fromLatin1("TechDraw_VerticalExtentDimension"));
p2->setObjectName(QStringLiteral("TechDraw_VerticalExtentDimension"));
p2->setWhatsThis(QStringLiteral("TechDraw_VerticalExtentDimension"));
_pcAction = pcAction;
languageChange();

View File

@@ -117,7 +117,7 @@ void execInsertPrefixChar(Gui::Command* cmd, std::string prefixFormat, const QAc
const int MAX_PREFIX_LENGTH = 31;
if (action) {
if (action->objectName() == QString::fromUtf8("TechDraw_ExtensionInsertRepetition")) {
if (action->objectName() == QStringLiteral("TechDraw_ExtensionInsertRepetition")) {
ui.setFieldName(QT_TR_NOOP("Repeat Count"));
}
}
@@ -357,20 +357,20 @@ Gui::Action* CmdTechDrawExtensionInsertPrefixGroup::createAction()
QAction* p1 = pcAction->addAction(QString());
p1->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionInsertDiameter"));
p1->setObjectName(QString::fromLatin1("TechDraw_ExtensionInsertDiameter"));
p1->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionInsertDiameter"));
p1->setObjectName(QStringLiteral("TechDraw_ExtensionInsertDiameter"));
p1->setWhatsThis(QStringLiteral("TechDraw_ExtensionInsertDiameter"));
QAction* p2 = pcAction->addAction(QString());
p2->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionInsertSquare"));
p2->setObjectName(QString::fromLatin1("TechDraw_ExtensionInsertSquare"));
p2->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionInsertSquare"));
p2->setObjectName(QStringLiteral("TechDraw_ExtensionInsertSquare"));
p2->setWhatsThis(QStringLiteral("TechDraw_ExtensionInsertSquare"));
QAction* p3 = pcAction->addAction(QString());
p3->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionInsertRepetition"));
p3->setObjectName(QString::fromLatin1("TechDraw_ExtensionInsertRepetition"));
p3->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionInsertRepetition"));
p3->setObjectName(QStringLiteral("TechDraw_ExtensionInsertRepetition"));
p3->setWhatsThis(QStringLiteral("TechDraw_ExtensionInsertRepetition"));
QAction* p4 = pcAction->addAction(QString());
p4->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionRemovePrefixChar"));
p4->setObjectName(QString::fromLatin1("TechDraw_ExtensionRemovePrefixChar"));
p4->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionRemovePrefixChar"));
p4->setObjectName(QStringLiteral("TechDraw_ExtensionRemovePrefixChar"));
p4->setWhatsThis(QStringLiteral("TechDraw_ExtensionRemovePrefixChar"));
_pcAction = pcAction;
languageChange();
@@ -574,12 +574,12 @@ Gui::Action* CmdTechDrawExtensionIncreaseDecreaseGroup::createAction()
QAction* p1 = pcAction->addAction(QString());
p1->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionIncreaseDecimal"));
p1->setObjectName(QString::fromLatin1("TechDraw_ExtensionIncreaseDecimal"));
p1->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionIncreaseDecimal"));
p1->setObjectName(QStringLiteral("TechDraw_ExtensionIncreaseDecimal"));
p1->setWhatsThis(QStringLiteral("TechDraw_ExtensionIncreaseDecimal"));
QAction* p2 = pcAction->addAction(QString());
p2->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionDecreaseDecimal"));
p2->setObjectName(QString::fromLatin1("TechDraw_ExtensionDecreaseDecimal"));
p2->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionDecreaseDecimal"));
p2->setObjectName(QStringLiteral("TechDraw_ExtensionDecreaseDecimal"));
p2->setWhatsThis(QStringLiteral("TechDraw_ExtensionDecreaseDecimal"));
_pcAction = pcAction;
languageChange();
@@ -869,16 +869,16 @@ Gui::Action* CmdTechDrawExtensionPosChainDimensionGroup::createAction()
QAction* p1 = pcAction->addAction(QString());
p1->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionPosHorizChainDimension"));
p1->setObjectName(QString::fromLatin1("TechDraw_ExtensionPosHorizChainDimension"));
p1->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionPosHorizChainDimension"));
p1->setObjectName(QStringLiteral("TechDraw_ExtensionPosHorizChainDimension"));
p1->setWhatsThis(QStringLiteral("TechDraw_ExtensionPosHorizChainDimension"));
QAction* p2 = pcAction->addAction(QString());
p2->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionPosVertChainDimension"));
p2->setObjectName(QString::fromLatin1("TechDraw_ExtensionPosVertChainDimension"));
p2->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionPosVertChainDimension"));
p2->setObjectName(QStringLiteral("TechDraw_ExtensionPosVertChainDimension"));
p2->setWhatsThis(QStringLiteral("sion"));
QAction* p3 = pcAction->addAction(QString());
p3->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionPosObliqueChainDimension"));
p3->setObjectName(QString::fromLatin1("TechDraw_ExtensionPosObliqueChainDimension"));
p3->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionPosObliqueChainDimension"));
p3->setObjectName(QStringLiteral("TechDraw_ExtensionPosObliqueChainDimension"));
p3->setWhatsThis(QStringLiteral("TechDraw_ExtensionPosObliqueChainDimension"));
_pcAction = pcAction;
languageChange();
@@ -1197,16 +1197,16 @@ Gui::Action* CmdTechDrawExtensionCascadeDimensionGroup::createAction()
QAction* p1 = pcAction->addAction(QString());
p1->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionCascadeHorizDimension"));
p1->setObjectName(QString::fromLatin1("TechDraw_ExtensionCascadeHorizDimension"));
p1->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionCascadeHorizDimension"));
p1->setObjectName(QStringLiteral("TechDraw_ExtensionCascadeHorizDimension"));
p1->setWhatsThis(QStringLiteral("TechDraw_ExtensionCascadeHorizDimension"));
QAction* p2 = pcAction->addAction(QString());
p2->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionCascadeVertDimension"));
p2->setObjectName(QString::fromLatin1("TechDraw_ExtensionCascadeVertDimension"));
p2->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionCascadeVertDimension"));
p2->setObjectName(QStringLiteral("TechDraw_ExtensionCascadeVertDimension"));
p2->setWhatsThis(QStringLiteral("TechDraw_ExtensionCascadeVertDimension"));
QAction* p3 = pcAction->addAction(QString());
p3->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionCascadeObliqueDimension"));
p3->setObjectName(QString::fromLatin1("TechDraw_ExtensionCascadeObliqueDimension"));
p3->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionCascadeObliqueDimension"));
p3->setObjectName(QStringLiteral("TechDraw_ExtensionCascadeObliqueDimension"));
p3->setWhatsThis(QStringLiteral("TechDraw_ExtensionCascadeObliqueDimension"));
_pcAction = pcAction;
languageChange();
@@ -1573,16 +1573,16 @@ Gui::Action* CmdTechDrawExtensionCreateChainDimensionGroup::createAction()
QAction* p1 = pcAction->addAction(QString());
p1->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionCreateHorizChainDimension"));
p1->setObjectName(QString::fromLatin1("TechDraw_ExtensionCreateHorizChainDimension"));
p1->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionCreateHorizChainDimension"));
p1->setObjectName(QStringLiteral("TechDraw_ExtensionCreateHorizChainDimension"));
p1->setWhatsThis(QStringLiteral("TechDraw_ExtensionCreateHorizChainDimension"));
QAction* p2 = pcAction->addAction(QString());
p2->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionCreateVertChainDimension"));
p2->setObjectName(QString::fromLatin1("TechDraw_ExtensionCreateVertChainDimension"));
p2->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionCreateVertChainDimension"));
p2->setObjectName(QStringLiteral("TechDraw_ExtensionCreateVertChainDimension"));
p2->setWhatsThis(QStringLiteral("TechDraw_ExtensionCreateVertChainDimension"));
QAction* p3 = pcAction->addAction(QString());
p3->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionCreateObliqueChainDimension"));
p3->setObjectName(QString::fromLatin1("TechDraw_ExtensionCreateObliqueChainDimension"));
p3->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionCreateObliqueChainDimension"));
p3->setObjectName(QStringLiteral("TechDraw_ExtensionCreateObliqueChainDimension"));
p3->setWhatsThis(QStringLiteral("TechDraw_ExtensionCreateObliqueChainDimension"));
_pcAction = pcAction;
languageChange();
@@ -1966,16 +1966,16 @@ Gui::Action* CmdTechDrawExtensionCreateCoordDimensionGroup::createAction()
QAction* p1 = pcAction->addAction(QString());
p1->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionCreateHorizCoordDimension"));
p1->setObjectName(QString::fromLatin1("TechDraw_ExtensionCreateHorizCoordDimension"));
p1->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionCreateHorizCoordDimension"));
p1->setObjectName(QStringLiteral("TechDraw_ExtensionCreateHorizCoordDimension"));
p1->setWhatsThis(QStringLiteral("TechDraw_ExtensionCreateHorizCoordDimension"));
QAction* p2 = pcAction->addAction(QString());
p2->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionCreateVertCoordDimension"));
p2->setObjectName(QString::fromLatin1("TechDraw_ExtensionCreateVertCoordDimension"));
p2->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionCreateVertCoordDimension"));
p2->setObjectName(QStringLiteral("TechDraw_ExtensionCreateVertCoordDimension"));
p2->setWhatsThis(QStringLiteral("TechDraw_ExtensionCreateVertCoordDimension"));
QAction* p3 = pcAction->addAction(QString());
p3->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionCreateObliqueCoordDimension"));
p3->setObjectName(QString::fromLatin1("TechDraw_ExtensionCreateObliqueCoordDimension"));
p3->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionCreateObliqueCoordDimension"));
p3->setObjectName(QStringLiteral("TechDraw_ExtensionCreateObliqueCoordDimension"));
p3->setWhatsThis(QStringLiteral("TechDraw_ExtensionCreateObliqueCoordDimension"));
_pcAction = pcAction;
languageChange();
@@ -2222,12 +2222,12 @@ Gui::Action* CmdTechDrawExtensionChamferDimensionGroup::createAction()
QAction* p1 = pcAction->addAction(QString());
p1->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionCreateHorizChamferDimension"));
p1->setObjectName(QString::fromLatin1("TechDraw_ExtensionCreateHorizChamferDimension"));
p1->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionCreateHorizChamferDimension"));
p1->setObjectName(QStringLiteral("TechDraw_ExtensionCreateHorizChamferDimension"));
p1->setWhatsThis(QStringLiteral("TechDraw_ExtensionCreateHorizChamferDimension"));
QAction* p2 = pcAction->addAction(QString());
p2->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionCreateVertChamferDimension"));
p2->setObjectName(QString::fromLatin1("TechDraw_ExtensionCreateVertChamferDimension"));
p2->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionCreateVertChamferDimension"));
p2->setObjectName(QStringLiteral("TechDraw_ExtensionCreateVertChamferDimension"));
p2->setWhatsThis(QStringLiteral("TechDraw_ExtensionCreateVertChamferDimension"));
_pcAction = pcAction;
languageChange();

View File

@@ -319,12 +319,12 @@ Gui::Action* CmdTechDrawExtensionCircleCenterLinesGroup::createAction()
QAction* p1 = pcAction->addAction(QString());
p1->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionCircleCenterLines"));
p1->setObjectName(QString::fromLatin1("TechDraw_ExtensionCircleCenterLines"));
p1->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionCircleCenterLines"));
p1->setObjectName(QStringLiteral("TechDraw_ExtensionCircleCenterLines"));
p1->setWhatsThis(QStringLiteral("TechDraw_ExtensionCircleCenterLines"));
QAction* p2 = pcAction->addAction(QString());
p2->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionHoleCircle"));
p2->setObjectName(QString::fromLatin1("TechDraw_ExtensionHoleCircle"));
p2->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionHoleCircle"));
p2->setObjectName(QStringLiteral("TechDraw_ExtensionHoleCircle"));
p2->setWhatsThis(QStringLiteral("TechDraw_ExtensionHoleCircle"));
_pcAction = pcAction;
languageChange();
@@ -648,20 +648,20 @@ Gui::Action* CmdTechDrawExtensionThreadsGroup::createAction()
QAction* p1 = pcAction->addAction(QString());
p1->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionThreadHoleSide"));
p1->setObjectName(QString::fromLatin1("TechDraw_ExtensionThreadHoleSide"));
p1->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionThreadHoleSide"));
p1->setObjectName(QStringLiteral("TechDraw_ExtensionThreadHoleSide"));
p1->setWhatsThis(QStringLiteral("TechDraw_ExtensionThreadHoleSide"));
QAction* p2 = pcAction->addAction(QString());
p2->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionThreadHoleBottom"));
p2->setObjectName(QString::fromLatin1("TechDraw_ExtensionThreadHoleBottom"));
p2->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionThreadHoleBottom"));
p2->setObjectName(QStringLiteral("TechDraw_ExtensionThreadHoleBottom"));
p2->setWhatsThis(QStringLiteral("TechDraw_ExtensionThreadHoleBottom"));
QAction* p3 = pcAction->addAction(QString());
p3->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionThreadBoltSide"));
p3->setObjectName(QString::fromLatin1("TechDraw_ExtensionThreadBoltSide"));
p3->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionThreadBoltSide"));
p3->setObjectName(QStringLiteral("TechDraw_ExtensionThreadBoltSide"));
p3->setWhatsThis(QStringLiteral("TechDraw_ExtensionThreadBoltSide"));
QAction* p4 = pcAction->addAction(QString());
p4->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionThreadBoltBottom"));
p4->setObjectName(QString::fromLatin1("TechDraw_ExtensionThreadBoltBottom"));
p4->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionThreadBoltBottom"));
p4->setObjectName(QStringLiteral("TechDraw_ExtensionThreadBoltBottom"));
p4->setWhatsThis(QStringLiteral("TechDraw_ExtensionThreadBoltBottom"));
_pcAction = pcAction;
languageChange();
@@ -1148,16 +1148,16 @@ Gui::Action* CmdTechDrawExtensionDrawCirclesGroup::createAction()
QAction* p1 = pcAction->addAction(QString());
p1->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionDrawCosmCircle"));
p1->setObjectName(QString::fromLatin1("TechDraw_ExtensionDrawCosmCircle"));
p1->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionDrawCosmCircle"));
p1->setObjectName(QStringLiteral("TechDraw_ExtensionDrawCosmCircle"));
p1->setWhatsThis(QStringLiteral("TechDraw_ExtensionDrawCosmCircle"));
QAction* p2 = pcAction->addAction(QString());
p2->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionDrawCosmArc"));
p2->setObjectName(QString::fromLatin1("TechDraw_ExtensionDrawCosmArc"));
p2->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionDrawCosmArc"));
p2->setObjectName(QStringLiteral("TechDraw_ExtensionDrawCosmArc"));
p2->setWhatsThis(QStringLiteral("TechDraw_ExtensionDrawCosmArc"));
QAction* p3 = pcAction->addAction(QString());
p3->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionDrawCosmCircle3Points"));
p3->setObjectName(QString::fromLatin1("TechDraw_ExtensionDrawCosmCircle3Points"));
p3->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionDrawCosmCircle3Points"));
p3->setObjectName(QStringLiteral("TechDraw_ExtensionDrawCosmCircle3Points"));
p3->setWhatsThis(QStringLiteral("TechDraw_ExtensionDrawCosmCircle3Points"));
_pcAction = pcAction;
languageChange();
@@ -1394,12 +1394,12 @@ Gui::Action* CmdTechDrawExtensionLinePPGroup::createAction()
QAction* p1 = pcAction->addAction(QString());
p1->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionLineParallel"));
p1->setObjectName(QString::fromLatin1("TechDraw_ExtensionLineParallel"));
p1->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionLineParallel"));
p1->setObjectName(QStringLiteral("TechDraw_ExtensionLineParallel"));
p1->setWhatsThis(QStringLiteral("TechDraw_ExtensionLineParallel"));
QAction* p2 = pcAction->addAction(QString());
p2->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionLinePerpendicular"));
p2->setObjectName(QString::fromLatin1("TechDraw_ExtensionLinePerpendicular"));
p2->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionLinePerpendicular"));
p2->setObjectName(QStringLiteral("TechDraw_ExtensionLinePerpendicular"));
p2->setWhatsThis(QStringLiteral("TechDraw_ExtensionLinePerpendicular"));
_pcAction = pcAction;
languageChange();
@@ -1700,12 +1700,12 @@ Gui::Action* CmdTechDrawExtendShortenLineGroup::createAction()
QAction* p1 = pcAction->addAction(QString());
p1->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionExtendLine"));
p1->setObjectName(QString::fromLatin1("TechDraw_ExtensionExtendLine"));
p1->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionExtendLine"));
p1->setObjectName(QStringLiteral("TechDraw_ExtensionExtendLine"));
p1->setWhatsThis(QStringLiteral("TechDraw_ExtensionExtendLine"));
QAction* p2 = pcAction->addAction(QString());
p2->setIcon(Gui::BitmapFactory().iconFromTheme("TechDraw_ExtensionShortenLine"));
p2->setObjectName(QString::fromLatin1("TechDraw_ExtensionShortenLine"));
p2->setWhatsThis(QString::fromLatin1("TechDraw_ExtensionShortenLine"));
p2->setObjectName(QStringLiteral("TechDraw_ExtensionShortenLine"));
p2->setWhatsThis(QStringLiteral("TechDraw_ExtensionShortenLine"));
_pcAction = pcAction;
languageChange();
@@ -1841,9 +1841,9 @@ void CmdTechDrawExtensionAreaAnnotation::activated(int iMsg)
asQuantity.setUnit(Base::Unit::Area);
QString qUserString = QString::fromStdString(asQuantity.getUserString());
if (qUserString.endsWith(QString::fromUtf8("^2"))) {
if (qUserString.endsWith(QStringLiteral("^2"))) {
qUserString.chop(2);
qUserString.append(QString::fromUtf8("²"));
qUserString.append(QStringLiteral("²"));
}
std::string sUserString = qUserString.toStdString();

View File

@@ -105,20 +105,20 @@ Gui::Action * CmdTechDrawStackGroup::createAction(void)
QAction* p1 = pcAction->addAction(QString());
p1->setIcon(Gui::BitmapFactory().iconFromTheme("actions/TechDraw_StackTop"));
p1->setObjectName(QString::fromLatin1("TechDraw_StackTop"));
p1->setWhatsThis(QString::fromLatin1("TechDraw_StackTop"));
p1->setObjectName(QStringLiteral("TechDraw_StackTop"));
p1->setWhatsThis(QStringLiteral("TechDraw_StackTop"));
QAction* p2 = pcAction->addAction(QString());
p2->setIcon(Gui::BitmapFactory().iconFromTheme("actions/TechDraw_StackBottom"));
p2->setObjectName(QString::fromLatin1("TechDraw_StackBottom"));
p2->setWhatsThis(QString::fromLatin1("TechDraw_StackBottom"));
p2->setObjectName(QStringLiteral("TechDraw_StackBottom"));
p2->setWhatsThis(QStringLiteral("TechDraw_StackBottom"));
QAction* p3 = pcAction->addAction(QString());
p3->setIcon(Gui::BitmapFactory().iconFromTheme("actions/TechDraw_StackUp"));
p3->setObjectName(QString::fromLatin1("TechDraw_StackUp"));
p3->setWhatsThis(QString::fromLatin1("TechDraw_StackUp"));
p3->setObjectName(QStringLiteral("TechDraw_StackUp"));
p3->setWhatsThis(QStringLiteral("TechDraw_StackUp"));
QAction* p4 = pcAction->addAction(QString());
p4->setIcon(Gui::BitmapFactory().iconFromTheme("actions/TechDraw_StackDown"));
p4->setObjectName(QString::fromLatin1("TechDraw_StackDown"));
p4->setWhatsThis(QString::fromLatin1("TechDraw_StackDown"));
p4->setObjectName(QStringLiteral("TechDraw_StackDown"));
p4->setWhatsThis(QStringLiteral("TechDraw_StackDown"));
_pcAction = pcAction;
languageChange();

View File

@@ -73,7 +73,7 @@ void DlgPageChooser::fillList(std::vector<std::string> labels, std::vector<std::
for (; i < labelCount; i++) {
qLabel = QString::fromStdString(labels[i]);
qName = QString::fromStdString(names[i]);
qText = QString::fromUtf8("%1 (%2)").arg(qLabel, qName);
qText = QStringLiteral("%1 (%2)").arg(qLabel, qName);
item = new QListWidgetItem(qText, ui->lwPages);
item->setData(Qt::UserRole, qName);
}

View File

@@ -51,7 +51,7 @@ DlgPrefsTechDrawAnnotationImp::DlgPrefsTechDrawAnnotationImp(QWidget* parent)
// stylesheet override to defeat behaviour of non-editable combobox to ignore
// maxVisibleItems property
QString ssOverride = QString::fromUtf8("combobox-popup: 0;");
QString ssOverride = QStringLiteral("combobox-popup: 0;");
ui->pcbSectionStyle->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
ui->pcbSectionStyle->setStyleSheet(ssOverride);
ui->pcbCenterStyle->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);

View File

@@ -74,7 +74,7 @@ void DlgStringListEditor::fillList(std::vector<std::string> texts)
ui->lwTexts->addItem(item);
}
//add a blank line at the end to allow extending the list
QListWidgetItem* item = new QListWidgetItem(QString::fromUtf8(""));
QListWidgetItem* item = new QListWidgetItem(QStringLiteral(""));
item->setFlags(item->flags() | Qt::ItemIsEditable);
ui->lwTexts->addItem(item);
}

View File

@@ -108,7 +108,7 @@ MDIViewPage::MDIViewPage(ViewProviderPage* pageVp, Gui::Document* doc, QWidget*
isContextualMenuEnabled = true;
QString tabText = QString::fromUtf8(pageVp->getDrawPage()->getNameInDocument());
tabText += QString::fromUtf8("[*]");
tabText += QStringLiteral("[*]");
setWindowTitle(tabText);
//NOLINTBEGIN
@@ -283,7 +283,7 @@ void MDIViewPage::zoomOut()
void MDIViewPage::setTabText(std::string tabText)
{
if (!isPassive() && !tabText.empty()) {
QString cap = QString::fromLatin1("%1 [*]").arg(QString::fromUtf8(tabText.c_str()));
QString cap = QStringLiteral("%1 [*]").arg(QString::fromUtf8(tabText.c_str()));
setWindowTitle(cap);
}
}
@@ -1075,7 +1075,7 @@ bool MDIViewPage::compareSelections(std::vector<Gui::SelectionObject> treeSel,
void MDIViewPage::showStatusMsg(const char* string1, const char* string2, const char* string3) const
{
QString msg = QString::fromLatin1("%1 %2.%3.%4 ")
QString msg = QStringLiteral("%1 %2.%3.%4 ")
.arg(tr("Selected:"), QString::fromUtf8(string1), QString::fromUtf8(string2),
QString::fromUtf8(string3));
if (Gui::getMainWindow()) {

View File

@@ -272,7 +272,7 @@ void PagePrinter::printBannerPage(QPrinter* printer, QPainter& painter, QPageLay
verticalPos += 2 * verticalSpacing * fontSizePx;
for (auto& obj : docObjs) {
//print a line for each page
QString pageLine = QString::fromUtf8(obj->getNameInDocument()) + QString::fromUtf8(" / ")
QString pageLine = QString::fromUtf8(obj->getNameInDocument()) + QStringLiteral(" / ")
+ QString::fromUtf8(obj->Label.getValue());
painter.drawText(leftMargin, verticalPos, pageLine);
verticalPos += verticalSpacing * fontSizePx;

View File

@@ -102,26 +102,26 @@ QVariant QGIProjGroup::itemChange(GraphicsItemChange change, const QVariant &val
auto *projItemPtr = static_cast<TechDraw::DrawProjGroupItem *>(fView);
QString type = QString::fromLatin1(projItemPtr->Type.getValueAsString());
if (type == QString::fromLatin1("Front")) {
gView->alignTo(m_origin, QString::fromLatin1("None"));
if (type == QStringLiteral("Front")) {
gView->alignTo(m_origin, QStringLiteral("None"));
installSceneEventFilter(gView);
}
else if ( type == QString::fromLatin1("Top") ||
type == QString::fromLatin1("Bottom")) {
gView->alignTo(m_origin, QString::fromLatin1("Vertical"));
else if ( type == QStringLiteral("Top") ||
type == QStringLiteral("Bottom")) {
gView->alignTo(m_origin, QStringLiteral("Vertical"));
}
else if ( type == QString::fromLatin1("Left") ||
type == QString::fromLatin1("Right") ||
type == QString::fromLatin1("Rear") ) {
gView->alignTo(m_origin, QString::fromLatin1("Horizontal"));
else if ( type == QStringLiteral("Left") ||
type == QStringLiteral("Right") ||
type == QStringLiteral("Rear") ) {
gView->alignTo(m_origin, QStringLiteral("Horizontal"));
}
else if ( type == QString::fromLatin1("FrontTopRight") ||
type == QString::fromLatin1("FrontBottomLeft") ) {
gView->alignTo(m_origin, QString::fromLatin1("45slash"));
else if ( type == QStringLiteral("FrontTopRight") ||
type == QStringLiteral("FrontBottomLeft") ) {
gView->alignTo(m_origin, QStringLiteral("45slash"));
}
else if ( type == QString::fromLatin1("FrontTopLeft") ||
type == QString::fromLatin1("FrontBottomRight") ) {
gView->alignTo(m_origin, QString::fromLatin1("45backslash"));
else if ( type == QStringLiteral("FrontTopLeft") ||
type == QStringLiteral("FrontBottomRight") ) {
gView->alignTo(m_origin, QStringLiteral("45backslash"));
}
}
}

View File

@@ -238,7 +238,7 @@ QString QGIRichAnno::convertTextSizes(const QString& inHtml) const
constexpr double cssPxPerPoint{1.333333}; // CSS says 12 pt text is 16 px high
double sceneUnitsPerPoint = Rez::getRezFactor() * mmPerPoint; // scene units per point: 3.53
QRegularExpression rxFontSize(QString::fromUtf8("font-size:([0-9]*)pt;"));
QRegularExpression rxFontSize(QStringLiteral("font-size:([0-9]*)pt;"));
QRegularExpressionMatch match;
QStringList findList;
QStringList replList;

View File

@@ -176,19 +176,19 @@ void QGISVGTemplate::createClickHandles()
// XPath query to select all <text> nodes with "freecad:editable" attribute
// XPath query to select all <tspan> nodes whose <text> parent
// has "freecad:editable" attribute
query.processItems(QString::fromUtf8("declare default element namespace \"" SVG_NS_URI "\"; "
query.processItems(QStringLiteral("declare default element namespace \"" SVG_NS_URI "\"; "
"declare namespace freecad=\"" FREECAD_SVG_NS_URI "\"; "
"//text[@" FREECAD_ATTR_EDITABLE "]/tspan"),
[&](QDomElement& tspan) -> bool {
QString fontSizeString = tspan.attribute(QString::fromUtf8("font-size"));
QString fontSizeString = tspan.attribute(QStringLiteral("font-size"));
QDomElement textElement = tspan.parentNode().toElement();
QString textAnchorString = textElement.attribute(QString::fromUtf8("text-anchor"));
QString textAnchorString = textElement.attribute(QStringLiteral("text-anchor"));
QString name = textElement.attribute(QString::fromUtf8(FREECAD_ATTR_EDITABLE));
double x = Rez::guiX(
textElement.attribute(QString::fromUtf8("x"), QString::fromUtf8("0.0")).toDouble());
textElement.attribute(QStringLiteral("x"), QStringLiteral("0.0")).toDouble());
double y = Rez::guiX(
textElement.attribute(QString::fromUtf8("y"), QString::fromUtf8("0.0")).toDouble());
textElement.attribute(QStringLiteral("y"), QStringLiteral("0.0")).toDouble());
if (name.isEmpty()) {
Base::Console().Warning(
"QGISVGTemplate::createClickHandles - no name for editable text at %f, %f\n", x, y);
@@ -198,7 +198,7 @@ void QGISVGTemplate::createClickHandles()
// default box size
double textHeight{0};
QString style = textElement.attribute(QString::fromUtf8("style"));
QString style = textElement.attribute(QStringLiteral("style"));
if (!style.isEmpty()) {
// get text attributes from style element
textHeight = getFontSizeFromStyle(style);
@@ -221,7 +221,7 @@ void QGISVGTemplate::createClickHandles()
auto newLength = brect.width();
double charWidth = newLength / editableNameString.length();
if (textAnchorString == QString::fromUtf8("middle")) {
if (textAnchorString == QStringLiteral("middle")) {
x = x - editableNameString.length() * charWidth / 2;
}
@@ -258,7 +258,7 @@ double QGISVGTemplate::getFontSizeFromStyle(QString style)
}
// get text attributes from style element
QRegularExpression rxFontSize(QString::fromUtf8("font-size:([0-9]*.?[0-9]*)px;"));
QRegularExpression rxFontSize(QStringLiteral("font-size:([0-9]*.?[0-9]*)px;"));
QRegularExpressionMatch match;
int pos{0};
@@ -278,7 +278,7 @@ double QGISVGTemplate::getFontSizeFromElement(QString element)
}
// font-size="3.95px"
QRegularExpression rxFontSize(QString::fromUtf8("([0-9]*.?[0-9]*)px"));
QRegularExpression rxFontSize(QStringLiteral("([0-9]*.?[0-9]*)px"));
QRegularExpressionMatch match;
int pos{0};

View File

@@ -45,9 +45,9 @@ using namespace TechDraw;
using DU = DrawUtil;
QGITile::QGITile(TechDraw::DrawTileWeld* dtw) :
m_textL(QString::fromUtf8(" ")),
m_textR(QString::fromUtf8(" ")),
m_textC(QString::fromUtf8(" ")),
m_textL(QStringLiteral(" ")),
m_textR(QStringLiteral(" ")),
m_textC(QStringLiteral(" ")),
m_scale(1.0),
m_row(0),
m_col(0),

View File

@@ -103,7 +103,7 @@ QGIView::QGIView()
addToGroup(m_caption);
m_lock = new QGCustomImage();
m_lock->setParentItem(m_border);
m_lock->load(QString::fromUtf8(":/icons/TechDraw_Lock.svg"));
m_lock->load(QStringLiteral(":/icons/TechDraw_Lock.svg"));
QSize sizeLock = m_lock->imageSize();
m_lockWidth = (double) sizeLock.width();
m_lockHeight = (double) sizeLock.height();
@@ -171,10 +171,10 @@ QVariant QGIView::itemChange(GraphicsItemChange change, const QVariant &value)
if(alignHash.size() == 1) { //if aligned.
QGraphicsItem* item = alignHash.begin().value();
QString alignMode = alignHash.begin().key();
if(alignMode == QString::fromLatin1("Vertical")) {
if(alignMode == QStringLiteral("Vertical")) {
newPos.setX(item->pos().x());
}
else if(alignMode == QString::fromLatin1("Horizontal")) {
else if(alignMode == QStringLiteral("Horizontal")) {
newPos.setY(item->pos().y());
}
}
@@ -568,7 +568,7 @@ void QGIView::setViewFeature(TechDraw::DrawView *obj)
viewName = obj->getNameInDocument();
//mark the actual QGraphicsItem so we can check what's in the scene later
setData(0, QString::fromUtf8("QGIV"));
setData(0, QStringLiteral("QGIV"));
setData(1, QString::fromUtf8(obj->getNameInDocument()));
}

View File

@@ -191,7 +191,7 @@ void QGIViewAnnotation::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event)
const std::vector<std::string>& values = annotation->Text.getValues();
DlgStringListEditor dlg(values, Gui::getMainWindow());
dlg.setWindowTitle(QString::fromUtf8("Annotation Text Editor"));
dlg.setWindowTitle(QStringLiteral("Annotation Text Editor"));
if (dlg.exec() == QDialog::Accepted) {
App::GetApplication().setActiveTransaction("Set Annotation Text");
annotation->Text.setValues(dlg.getTexts());

View File

@@ -438,9 +438,9 @@ void QGIViewBalloon::updateBalloon(bool obtuse)
if (strcmp(balloon->BubbleShape.getValueAsString(), "Rectangle") == 0) {
std::vector<int> newSeps;
while (labelText.contains(QString::fromUtf8("|"))) {
int pos = labelText.indexOf(QString::fromUtf8("|"));
labelText.replace(pos, 1, QString::fromUtf8(" "));
while (labelText.contains(QStringLiteral("|"))) {
int pos = labelText.indexOf(QStringLiteral("|"));
labelText.replace(pos, 1, QStringLiteral(" "));
QFontMetrics fm(balloonLabel->getFont());
newSeps.push_back(Gui::QtTools::horizontalAdvance(fm, labelText.left(pos + 2)));
balloonLabel->setVerticalSep(true);

View File

@@ -669,7 +669,7 @@ QGIViewDimension::QGIViewDimension() : dvDimension(nullptr), hasHover(false), m_
// needs phase 2 of autocorrect to be useful
// m_refFlag = new QGCustomSvg();
// m_refFlag->setParentItem(this);
// m_refFlag->load(QString::fromUtf8(":/icons/TechDraw_RefError.svg"));
// m_refFlag->load(QStringLiteral(":/icons/TechDraw_RefError.svg"));
// m_refFlag->setZValue(ZVALUE::LOCK);
// m_refFlag->hide();
}

View File

@@ -199,11 +199,11 @@ double QGIViewSymbol::symbolScaler(TechDraw::DrawViewSymbol* feature) const
QByteArray qba(feature->Symbol.getValue(), strlen(feature->Symbol.getValue()));
QString qSymbolString = QString::fromUtf8(qba);
const QString pxToken{QString::fromUtf8("px")};
const QString mmToken{QString::fromUtf8("mm")};
const QString pxToken{QStringLiteral("px")};
const QString mmToken{QStringLiteral("mm")};
// heightRegex finds (height="51.8309mm") in the svg text and returns the mm if present
QString heightRegex = QString::fromUtf8(R"(height=\"\d*\.?\d+([a-zA-Z]+)\")");
QString heightRegex = QStringLiteral(R"(height=\"\d*\.?\d+([a-zA-Z]+)\")");
QRegularExpression reHeight(heightRegex);
QRegularExpressionMatch matchHeight = reHeight.match(qSymbolString);

View File

@@ -71,7 +71,7 @@ QGIWeldSymbol::QGIWeldSymbol() :
setZValue(ZVALUE::DIMENSION);
m_tailText->setPlainText(
QString::fromUtf8(" "));
QStringLiteral(" "));
addToGroup(m_tailText);
m_tailText->hide();
m_tailText->setPos(0.0, 0.0); //avoid bRect issues

View File

@@ -879,7 +879,7 @@ void QGSPage::refreshViews()
QList<QGraphicsItem*> qgiv;
//find only QGIV's
for (auto q : list) {
QString viewFamily = QString::fromUtf8("QGIV");
QString viewFamily = QStringLiteral("QGIV");
if (viewFamily == q->data(0).toString()) {
qgiv.push_back(q);
}
@@ -1068,8 +1068,8 @@ void QGSPage::saveSvg(QString filename)
const QString docName(QString::fromUtf8(page->getDocument()->getName()));
const QString pageName(QString::fromUtf8(page->getNameInDocument()));
QString svgDescription = QString::fromUtf8("Drawing page: ") + pageName
+ QString::fromUtf8(" exported from FreeCAD document: ") + docName;
QString svgDescription = QStringLiteral("Drawing page: ") + pageName
+ QStringLiteral(" exported from FreeCAD document: ") + docName;
QSvgGenerator svgGen;
QTemporaryFile temporaryFile;
@@ -1087,7 +1087,7 @@ void QGSPage::saveSvg(QString filename)
// the width and height attributes of the <svg> element." >> but Inkscape won't read it without size info??
svgGen.setViewBox(QRect(0, 0, pixelWidth, pixelHeight));
svgGen.setTitle(QString::fromUtf8("FreeCAD SVG Export"));
svgGen.setTitle(QStringLiteral("FreeCAD SVG Export"));
svgGen.setDescription(svgDescription);
Gui::Selection().clearSelection();
@@ -1150,7 +1150,7 @@ static void removeEmptyGroups(QDomElement e)
void QGSPage::postProcessXml(QTemporaryFile& temporaryFile, QString fileName, QString pageName)
{
QDomDocument exportDoc(QString::fromUtf8("SvgDoc"));
QDomDocument exportDoc(QStringLiteral("SvgDoc"));
QFile file(temporaryFile.fileName());
if (!file.open(QIODevice::ReadOnly)) {
Base::Console().Error("QGSPage::ppsvg - tempfile open error\n");
@@ -1166,23 +1166,23 @@ void QGSPage::postProcessXml(QTemporaryFile& temporaryFile, QString fileName, QS
QDomElement exportDocElem = exportDoc.documentElement();//root <svg>
// Insert Freecad SVG namespace into namespace declarations
exportDocElem.setAttribute(QString::fromUtf8("xmlns:freecad"),
exportDocElem.setAttribute(QStringLiteral("xmlns:freecad"),
QString::fromUtf8(FREECAD_SVG_NS_URI));
// Insert all namespaces used by TechDraw's page template SVGs
exportDocElem.setAttribute(QString::fromUtf8("xmlns:svg"), QString::fromUtf8(SVG_NS_URI));
exportDocElem.setAttribute(QString::fromUtf8("xmlns:cc"), QString::fromUtf8(CC_NS_URI));
exportDocElem.setAttribute(QString::fromUtf8("xmlns:dc"), QString::fromUtf8(DC_NS_URI));
exportDocElem.setAttribute(QString::fromUtf8("xmlns:rdf"), QString::fromUtf8(RDF_NS_URI));
exportDocElem.setAttribute(QString::fromUtf8("xmlns:inkscape"),
exportDocElem.setAttribute(QStringLiteral("xmlns:svg"), QString::fromUtf8(SVG_NS_URI));
exportDocElem.setAttribute(QStringLiteral("xmlns:cc"), QString::fromUtf8(CC_NS_URI));
exportDocElem.setAttribute(QStringLiteral("xmlns:dc"), QString::fromUtf8(DC_NS_URI));
exportDocElem.setAttribute(QStringLiteral("xmlns:rdf"), QString::fromUtf8(RDF_NS_URI));
exportDocElem.setAttribute(QStringLiteral("xmlns:inkscape"),
QString::fromUtf8(INKSCAPE_NS_URI));
exportDocElem.setAttribute(QString::fromUtf8("xmlns:sodipodi"),
exportDocElem.setAttribute(QStringLiteral("xmlns:sodipodi"),
QString::fromUtf8(SODIPODI_NS_URI));
// Create the root group which will host the drawing group and the template group
QDomElement rootGroup = exportDoc.createElement(QString::fromUtf8("g"));
rootGroup.setAttribute(QString::fromUtf8("id"), pageName);
rootGroup.setAttribute(QString::fromUtf8("inkscape:groupmode"), QString::fromUtf8("layer"));
rootGroup.setAttribute(QString::fromUtf8("inkscape:label"), QString::fromUtf8("TechDraw"));
QDomElement rootGroup = exportDoc.createElement(QStringLiteral("g"));
rootGroup.setAttribute(QStringLiteral("id"), pageName);
rootGroup.setAttribute(QStringLiteral("inkscape:groupmode"), QStringLiteral("layer"));
rootGroup.setAttribute(QStringLiteral("inkscape:label"), QStringLiteral("TechDraw"));
// Now insert our template
QGISVGTemplate* svgTemplate = dynamic_cast<QGISVGTemplate*>(pageTemplate);
@@ -1190,26 +1190,26 @@ void QGSPage::postProcessXml(QTemporaryFile& temporaryFile, QString fileName, QS
DrawSVGTemplate* drawTemplate = svgTemplate->getSVGTemplate();
if (drawTemplate) {
QString templateSvg = drawTemplate->processTemplate();
QDomDocument templateResultDoc(QString::fromUtf8("SvgDoc"));
QDomDocument templateResultDoc(QStringLiteral("SvgDoc"));
if (templateResultDoc.setContent(templateSvg)) {
QDomElement templateDocElem = templateResultDoc.documentElement();
// Insert the template into a new group with id set to template name
QDomElement templateGroup = exportDoc.createElement(QString::fromUtf8("g"));
QDomElement templateGroup = exportDoc.createElement(QStringLiteral("g"));
Base::FileInfo fi(drawTemplate->PageResult.getValue());
templateGroup.setAttribute(QString::fromUtf8("id"),
templateGroup.setAttribute(QStringLiteral("id"),
QString::fromUtf8(fi.fileName().c_str()));
templateGroup.setAttribute(QString::fromUtf8("style"),
QString::fromUtf8("stroke: none;"));
templateGroup.setAttribute(QStringLiteral("style"),
QStringLiteral("stroke: none;"));
// Scale the template group correctly
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
templateGroup.setAttribute(
QString::fromUtf8("transform"),
QStringLiteral("transform"),
QString().sprintf("scale(%f, %f)", Rez::guiX(1.0), Rez::guiX(1.0)));
#else
templateGroup.setAttribute(QString::fromUtf8("transform"),
QString::fromLatin1("scale(%1, %2)")
templateGroup.setAttribute(QStringLiteral("transform"),
QStringLiteral("scale(%1, %2)")
.arg(Rez::guiX(1.0), 0, 'f')
.arg(Rez::guiX(1.0), 0, 'f'));
#endif
@@ -1227,7 +1227,7 @@ void QGSPage::postProcessXml(QTemporaryFile& temporaryFile, QString fileName, QS
// Obtain the drawing group element, move it under root node and set its id to "DrawingContent"
QDomElement drawingGroup = exportDocElem.firstChildElement(QLatin1String("g"));
if (!drawingGroup.isNull()) {
drawingGroup.setAttribute(QString::fromUtf8("id"), QString::fromUtf8("DrawingContent"));
drawingGroup.setAttribute(QStringLiteral("id"), QStringLiteral("DrawingContent"));
rootGroup.appendChild(drawingGroup);
}
exportDocElem.appendChild(rootGroup);

View File

@@ -90,7 +90,7 @@ void SymbolChooser::onOKClicked()
QString targetText = sourceItem->text();
m_symbolPath = m_symbolDir +
targetText +
QString::fromUtf8(".svg");
QStringLiteral(".svg");
Q_EMIT symbolSelected(m_symbolPath, m_source);
}
@@ -109,7 +109,7 @@ void SymbolChooser::onItemClicked(QListWidgetItem* item)
QString targetText = sourceItem->text();
m_symbolPath = m_symbolDir +
targetText +
QString::fromUtf8(".svg");
QStringLiteral(".svg");
Q_EMIT symbolSelected(m_symbolPath, m_source);
// Base::Console().Message("SC::onOKClicked - symbol: %s\n", qPrintable(m_symbolPath));
@@ -120,7 +120,7 @@ void SymbolChooser::onDirectoryChanged(const QString& newDir)
{
ui->lwSymbols->clear(); // Remove all previous symbols
// Base::Console().Message("SC::onDirectoryChanged(%s)\n", qPrintable(newDir));
m_symbolDir = newDir + QString::fromUtf8("/");
m_symbolDir = newDir + QStringLiteral("/");
loadSymbolNames(m_symbolDir);
}

View File

@@ -205,7 +205,7 @@ void TaskComplexSection::setUiCommon()
{
ui->leSectionObjects->setText(sourcesToString());
ui->leProfileObject->setText(QString::fromStdString(m_profileObject->getNameInDocument())
+ QString::fromUtf8(" / ")
+ QStringLiteral(" / ")
+ QString::fromStdString(m_profileObject->Label.getValue()));
m_compass = new CompassWidget(this);
@@ -383,7 +383,7 @@ void TaskComplexSection::onProfileObjectsUseSelectionClicked()
m_profileObject = selection.front().getObject();
ui->leProfileObject->setText(
QString::fromStdString(m_profileObject->getNameInDocument())
+ QString::fromUtf8(" / ")
+ QStringLiteral(" / ")
+ QString::fromStdString(m_profileObject->Label.getValue()));
}
}
@@ -432,7 +432,7 @@ void TaskComplexSection::enableAll(bool enable)
ui->cmbScaleType->setEnabled(enable);
QString qScaleType = ui->cmbScaleType->currentText();
//Allow or prevent scale changing initially
if (qScaleType == QString::fromUtf8("Custom")) {
if (qScaleType == QStringLiteral("Custom")) {
ui->sbScale->setEnabled(true);
}
else {
@@ -447,29 +447,29 @@ void TaskComplexSection::updateNowClicked() { apply(true); }
QString TaskComplexSection::sourcesToString()
{
QString result;
QString separator(QString::fromUtf8(", "));
QString separator(QStringLiteral(", "));
QString currentSeparator;
if (m_baseView) {
for (auto& obj : m_baseView->Source.getValues()) {
result += currentSeparator + QString::fromStdString(obj->getNameInDocument())
+ QString::fromUtf8(" / ") + QString::fromStdString(obj->Label.getValue());
+ QStringLiteral(" / ") + QString::fromStdString(obj->Label.getValue());
currentSeparator = separator;
}
currentSeparator = QString();
for (auto& obj : m_baseView->XSource.getValues()) {
result += currentSeparator + QString::fromStdString(obj->getNameInDocument())
+ QString::fromUtf8(" / ") + QString::fromStdString(obj->Label.getValue());
+ QStringLiteral(" / ") + QString::fromStdString(obj->Label.getValue());
}
}
else {
for (auto& obj : m_shapes) {
result += currentSeparator + QString::fromStdString(obj->getNameInDocument())
+ QString::fromUtf8(" / ") + QString::fromStdString(obj->Label.getValue());
+ QStringLiteral(" / ") + QString::fromStdString(obj->Label.getValue());
}
currentSeparator = QString();
for (auto& obj : m_xShapes) {
result += currentSeparator + QString::fromStdString(obj->getNameInDocument())
+ QString::fromUtf8(" / ") + QString::fromStdString(obj->Label.getValue());
+ QStringLiteral(" / ") + QString::fromStdString(obj->Label.getValue());
}
}
return result;

View File

@@ -248,7 +248,7 @@ void TaskDetail::setUiFromFeat()
TechDraw::DrawViewDetail* detailFeat = getDetailFeat();
QString detailDisplay = QString::fromUtf8(detailFeat->getNameInDocument()) +
QString::fromUtf8(" / ") +
QStringLiteral(" / ") +
QString::fromUtf8(detailFeat->Label.getValue());
ui->leDetailView->setText(detailDisplay);
anchor = detailFeat->AnchorPoint.getValue();

View File

@@ -210,7 +210,7 @@ void TaskDimRepair::fillList(QListWidget* lwItems, std::vector<std::string> labe
for (; i < labelCount; i++) {
qLabel = QString::fromStdString(labels[i]);
qName = QString::fromStdString(names[i]);
qText = QString::fromUtf8("%1 %2").arg(qName, qLabel);
qText = QStringLiteral("%1 %2").arg(qName, qLabel);
item = new QListWidgetItem(qText, lwItems);
item->setTextAlignment(Qt::AlignRight | Qt::AlignVCenter);
item->setData(Qt::UserRole, qName);

View File

@@ -96,7 +96,7 @@ void TaskHatch::setUiPrimary()
{
setWindowTitle(QObject::tr("Create Face Hatch"));
ui->fcFile->setFileName(QString::fromStdString(DrawHatch::prefSvgHatch()));
ui->fcFile->setFilter(QString::fromUtf8(
ui->fcFile->setFilter(QStringLiteral(
"SVG files (*.svg *.SVG);;Bitmap files(*.jpg *.jpeg *.png *.bmp);;All files (*)"));
ui->sbScale->setValue(1.0);
ui->sbScale->setSingleStep(0.1);
@@ -108,7 +108,7 @@ void TaskHatch::setUiEdit()
{
setWindowTitle(QObject::tr("Edit Face Hatch"));
ui->fcFile->setFileName(QString::fromStdString(m_saveFile));
ui->fcFile->setFilter(QString::fromUtf8(
ui->fcFile->setFilter(QStringLiteral(
"SVG files (*.svg *.SVG);;Bitmap files(*.jpg *.jpeg *.png *.bmp);;All files (*)"));
ui->sbScale->setValue(m_saveScale);
ui->sbScale->setSingleStep(0.1);

View File

@@ -119,7 +119,7 @@ void TaskLinkDim::loadToTree(const TechDraw::DrawViewDimension* dim, const bool
{
QString label = QString::fromUtf8(dim->Label.getValue());
QString name = QString::fromUtf8(dim->getNameInDocument());
QString tooltip = label + QString::fromUtf8(" / ") + name;
QString tooltip = label + QStringLiteral(" / ") + name;
QTreeWidgetItem* child = new QTreeWidgetItem();
child->setText(0, label);

View File

@@ -497,7 +497,7 @@ void TaskProjGroup::projectionTypeChanged(QString qText)
return;
}
if (qText == QString::fromUtf8("Page")) {
if (qText == QStringLiteral("Page")) {
multiView->ProjectionType.setValue("Default");
}
else {
@@ -769,7 +769,7 @@ void TaskProjGroup::setUiPrimary()
QString TaskProjGroup::formatVector(Base::Vector3d vec)
{
QString data = QString::fromLatin1("[%1 %2 %3]")
QString data = QStringLiteral("[%1 %2 %3]")
.arg(QLocale().toString(vec.x, 'f', 2),
QLocale().toString(vec.y, 'f', 2),
QLocale().toString(vec.z, 'f', 2));

View File

@@ -407,7 +407,7 @@ void TaskSectionView::enableAll(bool enable)
ui->cmbScaleType->setEnabled(enable);
QString qScaleType = ui->cmbScaleType->currentText();
//Allow or prevent scale changing initially
if (qScaleType == QString::fromUtf8("Custom")) {
if (qScaleType == QStringLiteral("Custom")) {
ui->sbScale->setEnabled(true);
}
else {

View File

@@ -121,9 +121,9 @@ void TaskSelectLineAttributes::setUiEdit()
}
// TODO: how to handle translation of a string with arg parameters in it?
ui->rbThin->setText(QString::fromUtf8("Thin %1").arg(QString::number(TechDraw::LineGroup::getDefaultWidth("Thin"))));
ui->rbMiddle->setText(QString::fromUtf8("Middle %1").arg(QString::number(TechDraw::LineGroup::getDefaultWidth("Graphic"))));
ui->rbThick->setText(QString::fromUtf8("Thick %1").arg(QString::number(TechDraw::LineGroup::getDefaultWidth("Thick"))));
ui->rbThin->setText(QStringLiteral("Thin %1").arg(QString::number(TechDraw::LineGroup::getDefaultWidth("Thin"))));
ui->rbMiddle->setText(QStringLiteral("Middle %1").arg(QString::number(TechDraw::LineGroup::getDefaultWidth("Graphic"))));
ui->rbThick->setText(QStringLiteral("Thick %1").arg(QString::number(TechDraw::LineGroup::getDefaultWidth("Thick"))));
double lineWidth = LineFormat::getCurrentLineFormat().getWidth();
if (lineWidth <= TechDraw::LineGroup::getDefaultWidth("Thin")) {

View File

@@ -371,7 +371,7 @@ void TaskWeldingSymbol::onWeldingChanged()
void TaskWeldingSymbol::onDirectorySelected(const QString& newDir)
{
// Base::Console().Message("TWS::onDirectorySelected(%s)\n", qPrintable(newDir));
m_currDir = newDir + QString::fromUtf8("/");
m_currDir = newDir + QStringLiteral("/");
}
void TaskWeldingSymbol::onSymbolSelected(QString symbolPath,

View File

@@ -362,7 +362,7 @@ void ViewProviderDrawingView::onProgressMessage(const TechDraw::DrawView* dv,
void ViewProviderDrawingView::showProgressMessage(const std::string featureName, const std::string text) const
{
QString msg = QString::fromUtf8("%1 %2")
QString msg = QStringLiteral("%1 %2")
.arg(QString::fromStdString(featureName),
QString::fromStdString(text));
if (Gui::getMainWindow()) {

View File

@@ -329,7 +329,7 @@ void ViewProviderPage::createMDIViewPage()
m_mdiView->setDocumentObject(getDrawPage()->getNameInDocument());
m_mdiView->setDocumentName(pcObject->getDocument()->getName());
m_mdiView->setWindowTitle(tabTitle + QString::fromLatin1("[*]"));
m_mdiView->setWindowTitle(tabTitle + QStringLiteral("[*]"));
m_mdiView->setWindowIcon(Gui::BitmapFactory().pixmap("TechDraw_TreePage"));
Gui::getMainWindow()->addWindow(m_mdiView);
}

View File

@@ -43,7 +43,7 @@ CompassDialWidget::CompassDialWidget(QWidget* parent) : QWidget(parent),
m_defaultMargin(10),
m_designRadius(64)
{
setObjectName(QString::fromUtf8("Compass"));
setObjectName(QStringLiteral("Compass"));
m_rect = QRect(0, 0, m_defaultSize, m_defaultSize);
m_angle = 0.0;
m_margin = m_defaultMargin;

View File

@@ -49,7 +49,7 @@ CompassWidget::CompassWidget(QWidget* parent)
: QWidget(parent), m_minimumWidth(200), m_minimumHeight(200), m_defaultMargin(10), m_angle(0.0),
m_advanceIncrement(10.0)
{
setObjectName(QString::fromUtf8("Compass"));
setObjectName(QStringLiteral("Compass"));
m_rect = QRect(0, 0, m_minimumWidth, m_minimumHeight);
buildWidget();
compassDial->setSize(m_minimumHeight - 2 * m_defaultMargin);
@@ -91,26 +91,26 @@ void CompassWidget::buildWidget()
setSizePolicy(sizePolicy);
setMinimumSize(QSize(m_minimumWidth, m_minimumHeight));
compassLayout = new QVBoxLayout(this);
compassLayout->setObjectName(QString::fromUtf8("CompassLayout"));
compassLayout->setObjectName(QStringLiteral("CompassLayout"));
compassDialLayout = new QHBoxLayout();
compassDialLayout->setObjectName(QString::fromUtf8("compassDialLayout"));
compassDialLayout->setObjectName(QStringLiteral("compassDialLayout"));
pbCWAdvance = new QPushButton(this);
pbCWAdvance->setObjectName(QString::fromUtf8("pbCWAdvance"));
pbCWAdvance->setObjectName(QStringLiteral("pbCWAdvance"));
QIcon icon1;
icon1.addFile(QString::fromUtf8(":/icons/arrow-cw.svg"), QSize(), QIcon::Normal, QIcon::On);
icon1.addFile(QStringLiteral(":/icons/arrow-cw.svg"), QSize(), QIcon::Normal, QIcon::On);
pbCWAdvance->setIcon(icon1);
compassDialLayout->addWidget(pbCWAdvance);
compassDial = new CompassDialWidget(this);
compassDial->setObjectName(QString::fromUtf8("CompassDial"));
compassDial->setObjectName(QStringLiteral("CompassDial"));
compassDialLayout->addWidget(compassDial);
pbCCWAdvance = new QPushButton(this);
pbCCWAdvance->setObjectName(QString::fromUtf8("pbCCWAdvance"));
pbCCWAdvance->setObjectName(QStringLiteral("pbCCWAdvance"));
QIcon icon2;
icon2.addFile(QString::fromUtf8(":/icons/arrow-ccw.svg"), QSize(), QIcon::Normal, QIcon::On);
icon2.addFile(QStringLiteral(":/icons/arrow-ccw.svg"), QSize(), QIcon::Normal, QIcon::On);
pbCCWAdvance->setIcon(icon2);
compassDialLayout->addWidget(pbCCWAdvance);
@@ -118,9 +118,9 @@ void CompassWidget::buildWidget()
compassLayout->addLayout(compassDialLayout);
compassControlLayout = new QHBoxLayout();
compassControlLayout->setObjectName(QString::fromUtf8("compassControlLayout"));
compassControlLayout->setObjectName(QStringLiteral("compassControlLayout"));
compassControlLabel = new QLabel(this);
compassControlLabel->setObjectName(QString::fromUtf8("compassControlLabel"));
compassControlLabel->setObjectName(QStringLiteral("compassControlLabel"));
QSizePolicy sizePolicy2(QSizePolicy::Minimum, QSizePolicy::Minimum);
sizePolicy2.setHorizontalStretch(0);
sizePolicy2.setVerticalStretch(0);
@@ -130,7 +130,7 @@ void CompassWidget::buildWidget()
compassControlLayout->addWidget(compassControlLabel);
dsbAngle = new QDoubleSpinBox(this);
dsbAngle->setObjectName(QString::fromUtf8("dsbAngle"));
dsbAngle->setObjectName(QStringLiteral("dsbAngle"));
sizePolicy2.setHeightForWidth(dsbAngle->sizePolicy().hasHeightForWidth());
dsbAngle->setSizePolicy(sizePolicy2);
dsbAngle->setMinimumSize(QSize(75, 26));
@@ -138,7 +138,7 @@ void CompassWidget::buildWidget()
dsbAngle->setFocusPolicy(Qt::ClickFocus);
dsbAngle->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
dsbAngle->setKeyboardTracking(false);
dsbAngle->setSuffix(QString::fromUtf8("\302\260"));
dsbAngle->setSuffix(QStringLiteral("\302\260"));
dsbAngle->setMaximum(360.000000000000000);
dsbAngle->setMinimum(-360.000000000000000);

View File

@@ -61,7 +61,7 @@ VectorEditWidget::VectorEditWidget(QWidget* parent) : QWidget(parent),
m_blockNotify(false)
{
m_size = QSize(m_minimumWidth, m_minimumHeight);
setObjectName(QString::fromUtf8("VectorEdit"));
setObjectName(QStringLiteral("VectorEdit"));
buildWidget();
connect(tbExpand, &QToolButton::toggled, this, &VectorEditWidget::slotExpandButtonToggled);
@@ -189,28 +189,28 @@ QSize VectorEditWidget::minimumSizeHint() const
void VectorEditWidget::buildWidget()
{
if (objectName().isEmpty())
setObjectName(QString::fromUtf8("VectorEdit"));
setObjectName(QStringLiteral("VectorEdit"));
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
setSizePolicy(sizePolicy);
vectorEditLayout = new QVBoxLayout(this);
vectorEditLayout->setObjectName(QString::fromUtf8("vectorEditLayout"));
vectorEditLayout->setObjectName(QStringLiteral("vectorEditLayout"));
vectorEditLayout->setContentsMargins(0, 0, 0, 0);
VectorEditButtonLayout = new QHBoxLayout();
VectorEditButtonLayout->setSpacing(0);
VectorEditButtonLayout->setObjectName(QString::fromUtf8("VectorEditButtonLayout"));
VectorEditButtonLayout->setObjectName(QStringLiteral("VectorEditButtonLayout"));
lvectorName = new QLabel(this);
lvectorName->setObjectName(QString::fromUtf8("lvectorName"));
lvectorName->setObjectName(QStringLiteral("lvectorName"));
VectorEditButtonLayout->addWidget(lvectorName);
leVectorDisplay = new QLineEdit(this);
leVectorDisplay->setObjectName(QString::fromUtf8("leVectorDisplay"));
leVectorDisplay->setObjectName(QStringLiteral("leVectorDisplay"));
VectorEditButtonLayout->addWidget(leVectorDisplay);
tbExpand = new QToolButton(this);
tbExpand->setObjectName(QString::fromUtf8("tbExpand"));
tbExpand->setText(QString::fromUtf8("..."));
tbExpand->setObjectName(QStringLiteral("tbExpand"));
tbExpand->setText(QStringLiteral("..."));
tbExpand->setCheckable(true);
VectorEditButtonLayout->addWidget(tbExpand);
@@ -219,15 +219,15 @@ void VectorEditWidget::buildWidget()
vectorEditLayout->addLayout(VectorEditButtonLayout);
VectorEditItemLayout = new QGridLayout();
VectorEditItemLayout->setObjectName(QString::fromUtf8("VectorEditItemLayout"));
VectorEditItemLayout->setObjectName(QStringLiteral("VectorEditItemLayout"));
lX = new QLabel();
lX->setObjectName(QString::fromUtf8("lX"));
lX->setText(QString::fromUtf8("X:"));
lX->setObjectName(QStringLiteral("lX"));
lX->setText(QStringLiteral("X:"));
VectorEditItemLayout->addWidget(lX, 0, 0, 1, 1);
dsbX = new Gui::DoubleSpinBox();
dsbX->setObjectName(QString::fromUtf8("dsbX"));
dsbX->setObjectName(QStringLiteral("dsbX"));
dsbX->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
dsbX->setKeyboardTracking(false);
dsbX->setMaximum(std::numeric_limits<double>::max());
@@ -236,12 +236,12 @@ void VectorEditWidget::buildWidget()
VectorEditItemLayout->addWidget(dsbX, 0, 1, 1, 1);
lY = new QLabel();
lY->setObjectName(QString::fromUtf8("lY"));
lY->setText(QString::fromUtf8("Y:"));
lY->setObjectName(QStringLiteral("lY"));
lY->setText(QStringLiteral("Y:"));
VectorEditItemLayout->addWidget(lY, 1, 0, 1, 1);
dsbY = new Gui::DoubleSpinBox();
dsbY->setObjectName(QString::fromUtf8("dsbY"));
dsbY->setObjectName(QStringLiteral("dsbY"));
dsbY->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
dsbY->setKeyboardTracking(false);
dsbY->setMaximum(std::numeric_limits<double>::max());
@@ -250,12 +250,12 @@ void VectorEditWidget::buildWidget()
VectorEditItemLayout->addWidget(dsbY, 1, 1, 1, 1);
lZ = new QLabel();
lZ->setObjectName(QString::fromUtf8("lZ"));
lZ->setText(QString::fromUtf8("Z:"));
lZ->setObjectName(QStringLiteral("lZ"));
lZ->setText(QStringLiteral("Z:"));
VectorEditItemLayout->addWidget(lZ, 2, 0, 1, 1);
dsbZ = new Gui::DoubleSpinBox();
dsbZ->setObjectName(QString::fromUtf8("dsbZ"));
dsbZ->setObjectName(QStringLiteral("dsbZ"));
dsbZ->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
dsbZ->setKeyboardTracking(false);
dsbZ->setMaximum(std::numeric_limits<double>::max());