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

@@ -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;