Refactoring. Added special section for string literals.
--HG-- branch : develop
This commit is contained in:
parent
00f9139150
commit
64029c249a
|
@ -553,9 +553,9 @@ void TMainWindow::changeEvent(QEvent *event)
|
|||
if (mType == MeasurementsType::Multisize)
|
||||
{
|
||||
ui->labelMType->setText(tr("Multisize measurements"));
|
||||
ui->labelBaseSizeValue->setText(QString().setNum(m->BaseSize()) + QLatin1String(" ") +
|
||||
ui->labelBaseSizeValue->setText(QString().setNum(m->BaseSize()) + QChar(QChar::Space) +
|
||||
UnitsToStr(m->MUnit(), true));
|
||||
ui->labelBaseHeightValue->setText(QString().setNum(m->BaseHeight()) + QLatin1String(" ") +
|
||||
ui->labelBaseHeightValue->setText(QString().setNum(m->BaseHeight()) + QChar(QChar::Space) +
|
||||
UnitsToStr(m->MUnit(), true));
|
||||
|
||||
labelGradationHeights = new QLabel(tr("Height:"));
|
||||
|
|
|
@ -949,7 +949,7 @@ void MainWindowsNoGUI::PdfFile(const QString &name, QGraphicsRectItem *paper, QG
|
|||
bool ignorePrinterFields, const QMarginsF &margins) const
|
||||
{
|
||||
QPrinter printer;
|
||||
printer.setCreator(QGuiApplication::applicationDisplayName()+QLatin1String(" ")+
|
||||
printer.setCreator(QGuiApplication::applicationDisplayName()+QChar(QChar::Space)+
|
||||
QCoreApplication::applicationVersion());
|
||||
printer.setOutputFormat(QPrinter::PdfFormat);
|
||||
printer.setOutputFileName(name);
|
||||
|
|
|
@ -581,8 +581,6 @@ void ShowInGraphicalShell(const QString &filePath)
|
|||
|
||||
}
|
||||
|
||||
const QString LONG_OPTION_NO_HDPI_SCALING = QStringLiteral("no-scaling");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool IsOptionSet(int argc, char *argv[], const char *option)
|
||||
{
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include <windows.h>
|
||||
#endif /* Q_OS_WIN */
|
||||
|
||||
#include "literals.h"
|
||||
#include "debugbreak.h"
|
||||
#include "defglobal.h"
|
||||
|
||||
|
@ -316,7 +317,6 @@ enum class GSizes : unsigned char { ALL,
|
|||
# define V_FALLTHROUGH
|
||||
#endif
|
||||
|
||||
extern const QString LONG_OPTION_NO_HDPI_SCALING;
|
||||
bool IsOptionSet(int argc, char *argv[], const char *option);
|
||||
void InitHighDpiScaling(int argc, char *argv[]);
|
||||
|
||||
|
|
33
src/libs/vmisc/literals.cpp
Normal file
33
src/libs/vmisc/literals.cpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file literals.cpp
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 8 4, 2018
|
||||
**
|
||||
** @brief
|
||||
** @copyright
|
||||
** This source code is part of the Valentina project, a pattern making
|
||||
** program, whose allow create and modeling patterns of clothing.
|
||||
** Copyright (C) 2018 Valentina project
|
||||
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
||||
**
|
||||
** Valentina is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** Valentina is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
||||
**
|
||||
*************************************************************************/
|
||||
#include "literals.h"
|
||||
|
||||
const QString LONG_OPTION_NO_HDPI_SCALING = QStringLiteral("no-scaling");
|
||||
|
||||
const QString editDeleteIcon = QStringLiteral("edit-delete");
|
||||
const QString preferencesOtherIcon = QStringLiteral("preferences-other");
|
38
src/libs/vmisc/literals.h
Normal file
38
src/libs/vmisc/literals.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file literals.h
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 8 4, 2018
|
||||
**
|
||||
** @brief
|
||||
** @copyright
|
||||
** This source code is part of the Valentina project, a pattern making
|
||||
** program, whose allow create and modeling patterns of clothing.
|
||||
** Copyright (C) 2018 Valentina project
|
||||
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
||||
**
|
||||
** Valentina is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** Valentina is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
||||
**
|
||||
*************************************************************************/
|
||||
#ifndef LITERALS_H
|
||||
#define LITERALS_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
extern const QString LONG_OPTION_NO_HDPI_SCALING;
|
||||
|
||||
extern const QString editDeleteIcon;
|
||||
extern const QString preferencesOtherIcon;
|
||||
|
||||
#endif // LITERALS_H
|
|
@ -12,7 +12,8 @@ SOURCES += \
|
|||
$$PWD/qxtcsvmodel.cpp \
|
||||
$$PWD/vtablesearch.cpp \
|
||||
$$PWD/dialogs/dialogexporttocsv.cpp \
|
||||
$$PWD/defglobal.cpp
|
||||
$$PWD/defglobal.cpp \
|
||||
$$PWD/literals.cpp
|
||||
|
||||
*msvc*:SOURCES += $$PWD/stable.cpp
|
||||
|
||||
|
@ -37,7 +38,8 @@ HEADERS += \
|
|||
$$PWD/customevents.h \
|
||||
$$PWD/defglobal.h \
|
||||
$$PWD/backport/qoverload.h \
|
||||
$$PWD/testvapplication.h
|
||||
$$PWD/testvapplication.h \
|
||||
$$PWD/literals.h
|
||||
|
||||
# Qt's versions
|
||||
# 5.2.0, 5.2.1
|
||||
|
|
|
@ -266,7 +266,7 @@ void DialogCubicBezierPath::currentPointChanged(int index)
|
|||
void DialogCubicBezierPath::NewItem(const VPointF &point)
|
||||
{
|
||||
auto item = new QListWidgetItem(point.name());
|
||||
item->setFont(QFont("Times", 12, QFont::Bold));
|
||||
item->setFont(NodeFont(item->font()));
|
||||
item->setData(Qt::UserRole, QVariant::fromValue(point));
|
||||
|
||||
ui->listWidget->addItem(item);
|
||||
|
|
|
@ -724,7 +724,7 @@ void DialogSplinePath::NewItem(const VSplinePoint &point)
|
|||
flagLength2.append(true);
|
||||
|
||||
auto item = new QListWidgetItem(point.P().name());
|
||||
item->setFont(QFont("Times", 12, QFont::Bold));
|
||||
item->setFont(NodeFont(item->font()));
|
||||
item->setData(Qt::UserRole, QVariant::fromValue(point));
|
||||
|
||||
ui->listWidget->addItem(item);
|
||||
|
|
|
@ -601,9 +601,10 @@ QString DialogTool::DialogWarningIcon()
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QFont DialogTool::NodeFont(bool nodeExcluded)
|
||||
QFont DialogTool::NodeFont(QFont font, bool nodeExcluded)
|
||||
{
|
||||
QFont font("Times", 12, QFont::Bold);
|
||||
font.setPointSize(12);
|
||||
font.setWeight(QFont::Bold);
|
||||
font.setStrikeOut(nodeExcluded);
|
||||
return font;
|
||||
}
|
||||
|
@ -696,7 +697,7 @@ void DialogTool::NewNodeItem(QListWidget *listWidget, const VPieceNode &node)
|
|||
if(canAddNewPoint)
|
||||
{
|
||||
QListWidgetItem *item = new QListWidgetItem(name);
|
||||
item->setFont(NodeFont(node.IsExcluded()));
|
||||
item->setFont(NodeFont(item->font(), node.IsExcluded()));
|
||||
item->setData(Qt::UserRole, QVariant::fromValue(node));
|
||||
listWidget->addItem(item);
|
||||
listWidget->setCurrentRow(listWidget->count()-1);
|
||||
|
|
|
@ -276,7 +276,7 @@ protected:
|
|||
static bool DoublePoints(QListWidget *listWidget, const VContainer *data);
|
||||
static bool EachPointLabelIsUnique(QListWidget *listWidget);
|
||||
static QString DialogWarningIcon();
|
||||
static QFont NodeFont(bool nodeExcluded);
|
||||
static QFont NodeFont(QFont font, bool nodeExcluded = false);
|
||||
|
||||
QString GetNodeName(const VPieceNode &node, bool showPassmark = false) const;
|
||||
void NewNodeItem(QListWidget *listWidget, const VPieceNode &node);
|
||||
|
|
|
@ -226,7 +226,7 @@ void DialogSeamAllowance::SetPiece(const VPiece &piece)
|
|||
const QString name = GetPathName(record.path, record.reverse);
|
||||
|
||||
QListWidgetItem *item = new QListWidgetItem(name);
|
||||
item->setFont(QFont("Times", 12, QFont::Bold));
|
||||
item->setFont(NodeFont(item->font()));
|
||||
item->setData(Qt::UserRole, QVariant::fromValue(record));
|
||||
uiTabPaths->listWidgetCustomSA->addItem(item);
|
||||
uiTabPaths->listWidgetCustomSA->setCurrentRow(uiTabPaths->listWidgetCustomSA->count()-1);
|
||||
|
@ -243,7 +243,7 @@ void DialogSeamAllowance::SetPiece(const VPiece &piece)
|
|||
const QString name = GetPathName(path);
|
||||
|
||||
QListWidgetItem *item = new QListWidgetItem(name);
|
||||
item->setFont(QFont("Times", 12, QFont::Bold));
|
||||
item->setFont(NodeFont(item->font()));
|
||||
item->setData(Qt::UserRole, QVariant::fromValue(path));
|
||||
uiTabPaths->listWidgetInternalPaths->addItem(item);
|
||||
uiTabPaths->listWidgetInternalPaths->setCurrentRow(uiTabPaths->listWidgetInternalPaths->count()-1);
|
||||
|
@ -259,7 +259,7 @@ void DialogSeamAllowance::SetPiece(const VPiece &piece)
|
|||
const QSharedPointer<VGObject> p = data->GetGObject(point);
|
||||
|
||||
QListWidgetItem *item = new QListWidgetItem(p->name());
|
||||
item->setFont(QFont("Times", 12, QFont::Bold));
|
||||
item->setFont(NodeFont(item->font()));
|
||||
item->setData(Qt::UserRole, QVariant::fromValue(point));
|
||||
listWidget->addItem(item);
|
||||
listWidget->setCurrentRow(uiTabPins->listWidgetPins->count()-1);
|
||||
|
@ -491,7 +491,7 @@ void DialogSeamAllowance::CheckState()
|
|||
}
|
||||
else
|
||||
{
|
||||
m_ftb->SetTabText(TabOrder::Paths, tr("Paths") + QLatin1String("*"));
|
||||
m_ftb->SetTabText(TabOrder::Paths, tr("Paths") + '*');
|
||||
const QIcon icon = QIcon::fromTheme("dialog-warning",
|
||||
QIcon(":/icons/win.icon.theme/16x16/status/dialog-warning.png"));
|
||||
uiTabPaths->tabWidget->setTabIcon(uiTabPaths->tabWidget->indexOf(uiTabPaths->tabSeamAllowance), icon);
|
||||
|
@ -506,15 +506,15 @@ void DialogSeamAllowance::CheckState()
|
|||
QString tooltip = tr("Ready!");
|
||||
if (not applyAllowed)
|
||||
{
|
||||
tooltip = tooltip + QLatin1String(" <b>") +
|
||||
tr("To open all detail's features complete creating the main path.") + QLatin1String("</b>");
|
||||
tooltip = tooltip + QStringLiteral(" <b>") +
|
||||
tr("To open all detail's features complete creating the main path.") + QStringLiteral("</b>");
|
||||
}
|
||||
uiTabPaths->helpLabel->setText(tooltip);
|
||||
uiTabPaths->tabWidget->setTabIcon(uiTabPaths->tabWidget->indexOf(uiTabPaths->tabMainPath), QIcon());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ftb->SetTabText(TabOrder::Paths, tr("Paths") + QLatin1String("*"));
|
||||
m_ftb->SetTabText(TabOrder::Paths, tr("Paths") + '*');
|
||||
const QIcon icon = QIcon::fromTheme("dialog-warning",
|
||||
QIcon(":/icons/win.icon.theme/16x16/status/dialog-warning.png"));
|
||||
uiTabPaths->tabWidget->setTabIcon(uiTabPaths->tabWidget->indexOf(uiTabPaths->tabMainPath), icon);
|
||||
|
@ -537,7 +537,7 @@ void DialogSeamAllowance::closeEvent(QCloseEvent *event)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSeamAllowance::showEvent(QShowEvent *event)
|
||||
{
|
||||
QDialog::showEvent( event );
|
||||
QDialog::showEvent( event ); // clazy:exclude=skipped-base-method
|
||||
if ( event->spontaneous() )
|
||||
{
|
||||
return;
|
||||
|
@ -630,7 +630,7 @@ void DialogSeamAllowance::ShowMainPathContextMenu(const QPoint &pos)
|
|||
actionExcluded->setCheckable(true);
|
||||
actionExcluded->setChecked(rowNode.IsExcluded());
|
||||
|
||||
QAction *actionDelete = menu->addAction(QIcon::fromTheme("edit-delete"), tr("Delete"));
|
||||
QAction *actionDelete = menu->addAction(QIcon::fromTheme(editDeleteIcon), tr("Delete"));
|
||||
|
||||
QAction *selectedAction = menu->exec(uiTabPaths->listWidgetMainPath->viewport()->mapToGlobal(pos));
|
||||
if (selectedAction == actionDelete)
|
||||
|
@ -648,7 +648,7 @@ void DialogSeamAllowance::ShowMainPathContextMenu(const QPoint &pos)
|
|||
rowNode.SetExcluded(not rowNode.IsExcluded());
|
||||
rowItem->setData(Qt::UserRole, QVariant::fromValue(rowNode));
|
||||
rowItem->setText(GetNodeName(rowNode, true));
|
||||
rowItem->setFont(NodeFont(rowNode.IsExcluded()));
|
||||
rowItem->setFont(NodeFont(rowItem->font(), rowNode.IsExcluded()));
|
||||
}
|
||||
else if (selectedAction == actionPassmark)
|
||||
{
|
||||
|
@ -677,7 +677,7 @@ void DialogSeamAllowance::ShowCustomSAContextMenu(const QPoint &pos)
|
|||
}
|
||||
|
||||
QScopedPointer<QMenu> menu(new QMenu());
|
||||
QAction *actionOption = menu->addAction(QIcon::fromTheme("preferences-other"), tr("Options"));
|
||||
QAction *actionOption = menu->addAction(QIcon::fromTheme(preferencesOtherIcon), tr("Options"));
|
||||
|
||||
QListWidgetItem *rowItem = uiTabPaths->listWidgetCustomSA->item(row);
|
||||
SCASSERT(rowItem != nullptr);
|
||||
|
@ -687,7 +687,7 @@ void DialogSeamAllowance::ShowCustomSAContextMenu(const QPoint &pos)
|
|||
actionReverse->setCheckable(true);
|
||||
actionReverse->setChecked(record.reverse);
|
||||
|
||||
QAction *actionDelete = menu->addAction(QIcon::fromTheme("edit-delete"), tr("Delete"));
|
||||
QAction *actionDelete = menu->addAction(QIcon::fromTheme(editDeleteIcon), tr("Delete"));
|
||||
|
||||
QAction *selectedAction = menu->exec(uiTabPaths->listWidgetCustomSA->viewport()->mapToGlobal(pos));
|
||||
if (selectedAction == actionDelete)
|
||||
|
@ -729,8 +729,8 @@ void DialogSeamAllowance::ShowInternalPathsContextMenu(const QPoint &pos)
|
|||
}
|
||||
|
||||
QScopedPointer<QMenu> menu(new QMenu());
|
||||
QAction *actionOption = menu->addAction(QIcon::fromTheme("preferences-other"), tr("Options"));
|
||||
QAction *actionDelete = menu->addAction(QIcon::fromTheme("edit-delete"), tr("Delete"));
|
||||
QAction *actionOption = menu->addAction(QIcon::fromTheme(preferencesOtherIcon), tr("Options"));
|
||||
QAction *actionDelete = menu->addAction(QIcon::fromTheme(editDeleteIcon), tr("Delete"));
|
||||
|
||||
QAction *selectedAction = menu->exec(uiTabPaths->listWidgetInternalPaths->viewport()->mapToGlobal(pos));
|
||||
if (selectedAction == actionDelete)
|
||||
|
@ -764,7 +764,7 @@ void DialogSeamAllowance::ShowPinsContextMenu(const QPoint &pos)
|
|||
}
|
||||
|
||||
QScopedPointer<QMenu> menu(new QMenu());
|
||||
QAction *actionDelete = menu->addAction(QIcon::fromTheme("edit-delete"), tr("Delete"));
|
||||
QAction *actionDelete = menu->addAction(QIcon::fromTheme(editDeleteIcon), tr("Delete"));
|
||||
|
||||
QAction *selectedAction = menu->exec(uiTabPins->listWidgetPins->viewport()->mapToGlobal(pos));
|
||||
if (selectedAction == actionDelete)
|
||||
|
@ -814,7 +814,7 @@ void DialogSeamAllowance::ShowPlaceLabelsContextMenu(const QPoint &pos)
|
|||
UpdateCurrentPlaceLabelRecords();
|
||||
};
|
||||
|
||||
QAction *actionOption = menu->addAction(QIcon::fromTheme("preferences-other"), tr("Options"));
|
||||
QAction *actionOption = menu->addAction(QIcon::fromTheme(preferencesOtherIcon), tr("Options"));
|
||||
menu->addSeparator();
|
||||
QAction *actionSegment = InitAction(tr("Segment"), PlaceLabelType::Segment);
|
||||
QAction *actionRectangle = InitAction(tr("Rectangle"), PlaceLabelType::Rectangle);
|
||||
|
@ -826,7 +826,7 @@ void DialogSeamAllowance::ShowPlaceLabelsContextMenu(const QPoint &pos)
|
|||
QAction *actionHshaped = InitAction(tr("H-shaped"), PlaceLabelType::Hshaped);
|
||||
QAction *actionButton = InitAction(tr("Button"), PlaceLabelType::Button);
|
||||
menu->addSeparator();
|
||||
QAction *actionDelete = menu->addAction(QIcon::fromTheme("edit-delete"), tr("Delete"));
|
||||
QAction *actionDelete = menu->addAction(QIcon::fromTheme(editDeleteIcon), tr("Delete"));
|
||||
|
||||
QAction *selectedAction = menu->exec(uiTabPlaceLabels->listWidgetPlaceLabels->viewport()->mapToGlobal(pos));
|
||||
if (selectedAction == actionDelete)
|
||||
|
@ -1537,7 +1537,7 @@ void DialogSeamAllowance::UpdateGrainlineValues()
|
|||
{
|
||||
plbVal = uiTabGrainline->labelLen;
|
||||
plbText = uiTabGrainline->labelEditLen;
|
||||
qsUnit = QLatin1String(" ") + UnitsToStr(qApp->patternUnit());
|
||||
qsUnit = QChar(QChar::Space) + UnitsToStr(qApp->patternUnit());
|
||||
}
|
||||
|
||||
plbVal->setToolTip(tr("Value"));
|
||||
|
@ -1581,7 +1581,7 @@ void DialogSeamAllowance::UpdateGrainlineValues()
|
|||
flagGFormulas = bFormulasOK[0] && bFormulasOK[1];
|
||||
if (not flagGFormulas && not flagGPin)
|
||||
{
|
||||
m_ftb->SetTabText(TabOrder::Grainline, tr("Grainline") + QLatin1String("*"));
|
||||
m_ftb->SetTabText(TabOrder::Grainline, tr("Grainline") + '*');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1606,13 +1606,13 @@ void DialogSeamAllowance::UpdateDetailLabelValues()
|
|||
{
|
||||
plbVal = uiTabLabels->labelDLWidth;
|
||||
plbText = uiTabLabels->labelEditDLWidth;
|
||||
qsUnit = QLatin1String(" ") + UnitsToStr(qApp->patternUnit());
|
||||
qsUnit = QChar(QChar::Space) + UnitsToStr(qApp->patternUnit());
|
||||
}
|
||||
else if (i == 1)
|
||||
{
|
||||
plbVal = uiTabLabels->labelDLHeight;
|
||||
plbText = uiTabLabels->labelEditDLHeight;
|
||||
qsUnit = QLatin1String(" ") + UnitsToStr(qApp->patternUnit());
|
||||
qsUnit = QChar(QChar::Space) + UnitsToStr(qApp->patternUnit());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1664,7 +1664,7 @@ void DialogSeamAllowance::UpdateDetailLabelValues()
|
|||
flagDLFormulas = bFormulasOK[0] && bFormulasOK[1];
|
||||
if (not flagDLAngle || not (flagDLFormulas || flagDPin) || not flagPLAngle || not (flagPLFormulas || flagPPin))
|
||||
{
|
||||
m_ftb->SetTabText(TabOrder::Labels, tr("Labels") + QLatin1String("*"));
|
||||
m_ftb->SetTabText(TabOrder::Labels, tr("Labels") + '*');
|
||||
const QIcon icon = QIcon::fromTheme("dialog-warning",
|
||||
QIcon(":/icons/win.icon.theme/16x16/status/dialog-warning.png"));
|
||||
uiTabLabels->tabWidget->setTabIcon(uiTabLabels->tabWidget->indexOf(uiTabLabels->tabLabels), icon);
|
||||
|
@ -1692,13 +1692,13 @@ void DialogSeamAllowance::UpdatePatternLabelValues()
|
|||
{
|
||||
plbVal = uiTabLabels->labelPLWidth;
|
||||
plbText = uiTabLabels->labelEditPLWidth;
|
||||
qsUnit = QLatin1String(" ") + UnitsToStr(qApp->patternUnit());
|
||||
qsUnit = QChar(QChar::Space) + UnitsToStr(qApp->patternUnit());
|
||||
}
|
||||
else if (i == 1)
|
||||
{
|
||||
plbVal = uiTabLabels->labelPLHeight;
|
||||
plbText = uiTabLabels->labelEditPLHeight;
|
||||
qsUnit = QLatin1String(" ") + UnitsToStr(qApp->patternUnit());
|
||||
qsUnit = QChar(QChar::Space) + UnitsToStr(qApp->patternUnit());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1749,7 +1749,7 @@ void DialogSeamAllowance::UpdatePatternLabelValues()
|
|||
flagPLFormulas = bFormulasOK[0] && bFormulasOK[1];
|
||||
if (not flagDLAngle || not (flagDLFormulas || flagDPin) || not flagPLAngle || not (flagPLFormulas || flagPPin))
|
||||
{
|
||||
m_ftb->SetTabText(TabOrder::Labels, tr("Labels") + QLatin1String("*"));
|
||||
m_ftb->SetTabText(TabOrder::Labels, tr("Labels") + '*');
|
||||
const QIcon icon = QIcon::fromTheme("dialog-warning",
|
||||
QIcon(":/icons/win.icon.theme/16x16/status/dialog-warning.png"));
|
||||
uiTabLabels->tabWidget->setTabIcon(uiTabLabels->tabWidget->indexOf(uiTabLabels->tabLabels), icon);
|
||||
|
@ -2247,7 +2247,7 @@ void DialogSeamAllowance::DetailPinPointChanged()
|
|||
flagDPin = false;
|
||||
topPinId == NULL_ID && bottomPinId == NULL_ID ? color = okColor : color = errorColor;
|
||||
|
||||
m_ftb->SetTabText(TabOrder::Labels, tr("Labels") + QLatin1String("*"));
|
||||
m_ftb->SetTabText(TabOrder::Labels, tr("Labels") + '*');
|
||||
const QIcon icon = QIcon::fromTheme("dialog-warning",
|
||||
QIcon(":/icons/win.icon.theme/16x16/status/dialog-warning.png"));
|
||||
uiTabLabels->tabWidget->setTabIcon(uiTabLabels->tabWidget->indexOf(uiTabLabels->tabLabels), icon);
|
||||
|
@ -2280,7 +2280,7 @@ void DialogSeamAllowance::PatternPinPointChanged()
|
|||
flagPPin = false;
|
||||
topPinId == NULL_ID && bottomPinId == NULL_ID ? color = okColor : color = errorColor;
|
||||
|
||||
m_ftb->SetTabText(TabOrder::Labels, tr("Labels") + QLatin1String("*"));
|
||||
m_ftb->SetTabText(TabOrder::Labels, tr("Labels") + '*');
|
||||
const QIcon icon = QIcon::fromTheme("dialog-warning",
|
||||
QIcon(":/icons/win.icon.theme/16x16/status/dialog-warning.png"));
|
||||
uiTabLabels->tabWidget->setTabIcon(uiTabLabels->tabWidget->indexOf(uiTabLabels->tabLabels), icon);
|
||||
|
@ -2374,7 +2374,7 @@ QString DialogSeamAllowance::GetPathName(quint32 path, bool reverse) const
|
|||
|
||||
if (reverse)
|
||||
{
|
||||
name = QLatin1String("- ") + name;
|
||||
name = QStringLiteral("- ") + name;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2783,7 +2783,7 @@ void DialogSeamAllowance::InitPinPoint(QComboBox *box)
|
|||
}
|
||||
|
||||
box->clear();
|
||||
box->addItem(QLatin1String("<") + tr("no pin") + QLatin1String(">"), NULL_ID);
|
||||
box->addItem('<' + tr("no pin") + '>', NULL_ID);
|
||||
|
||||
const QVector<quint32> pins = GetListInternals<quint32>(uiTabPins->listWidgetPins);
|
||||
|
||||
|
@ -3073,7 +3073,7 @@ void DialogSeamAllowance::SetGrainlineAngle(QString angleFormula)
|
|||
{
|
||||
if (angleFormula.isEmpty())
|
||||
{
|
||||
angleFormula = QString("0");
|
||||
angleFormula = '0';
|
||||
}
|
||||
|
||||
const QString formula = qApp->TrVars()->FormulaToUser(angleFormula, qApp->Settings()->GetOsSeparator());
|
||||
|
@ -3152,7 +3152,7 @@ void DialogSeamAllowance::SetDLAngle(QString angleFormula)
|
|||
{
|
||||
if (angleFormula.isEmpty())
|
||||
{
|
||||
angleFormula = QString("0");
|
||||
angleFormula = '0';
|
||||
}
|
||||
|
||||
const QString formula = qApp->TrVars()->FormulaToUser(angleFormula, qApp->Settings()->GetOsSeparator());
|
||||
|
@ -3212,7 +3212,7 @@ void DialogSeamAllowance::SetPLAngle(QString angleFormula)
|
|||
{
|
||||
if (angleFormula.isEmpty())
|
||||
{
|
||||
angleFormula = QString("0");
|
||||
angleFormula = '0';
|
||||
}
|
||||
|
||||
const QString formula = qApp->TrVars()->FormulaToUser(angleFormula, qApp->Settings()->GetOsSeparator());
|
||||
|
@ -3296,7 +3296,7 @@ QString DialogSeamAllowance::GetDefaultPieceName() const
|
|||
|
||||
while(names.contains(name))
|
||||
{
|
||||
name = defName + QString("_%1").arg(++i);
|
||||
name = defName + QStringLiteral("_%1").arg(++i);
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
|
|
@ -271,15 +271,15 @@ QString VToolCutArc::MakeToolTip() const
|
|||
"<tr> <td><b>%4:</b> %5 %3</td> </tr>"
|
||||
"<tr> <td><b>%6:</b> %7°</td> </tr>"
|
||||
"<tr> <td><b>%8:</b> %9°</td> </tr>")
|
||||
.arg(arcStr + arcNumber + QLatin1String(" ") + lengthStr)
|
||||
.arg(arcStr + arcNumber + QChar(QChar::Space) + lengthStr)
|
||||
.arg(qApp->fromPixel(arc.GetLength()))
|
||||
.arg(UnitsToStr(qApp->patternUnit(), true), arcStr + arcNumber + QLatin1String(" ") + radiusStr)
|
||||
.arg(UnitsToStr(qApp->patternUnit(), true), arcStr + arcNumber + QChar(QChar::Space) + radiusStr)
|
||||
.arg(qApp->fromPixel(arc.GetRadius()))
|
||||
.arg(arcStr + arcNumber + QLatin1String(" ") + startAngleStr)
|
||||
.arg(arcStr + arcNumber + QChar(QChar::Space) + startAngleStr)
|
||||
.arg(qApp->fromPixel(arc.GetStartAngle()))
|
||||
.arg(arcStr + arcNumber + QLatin1String(" ") + endAngleStr)
|
||||
.arg(arcStr + arcNumber + QChar(QChar::Space) + endAngleStr)
|
||||
.arg(qApp->fromPixel(arc.GetEndAngle()))
|
||||
.arg(arcStr + arcNumber + QLatin1String(" ") + tr("label"), arc.name());
|
||||
.arg(arcStr + arcNumber + QChar(QChar::Space) + tr("label"), arc.name());
|
||||
return toolTip;
|
||||
};
|
||||
|
||||
|
|
|
@ -196,14 +196,17 @@ void TST_TSLocaleTranslation::TestPunctuation()
|
|||
QFETCH(QString, source);
|
||||
QFETCH(QString, translation);
|
||||
|
||||
static const QStringList punctuation = QStringList() << QLatin1String(".")
|
||||
<< QLatin1String(":")
|
||||
<< QLatin1String(" ")
|
||||
<< QLatin1String("\n")
|
||||
<< QLatin1String("!")
|
||||
<< QLatin1String("?")
|
||||
<< QLatin1String(";")
|
||||
<< "…";
|
||||
static const QStringList punctuation{
|
||||
QChar('.'),
|
||||
QChar(':'),
|
||||
QChar(QChar::Space),
|
||||
QChar('\n'),
|
||||
QChar('!'),
|
||||
QChar('?'),
|
||||
QChar(';'),
|
||||
QChar(0x2026)//…
|
||||
};
|
||||
|
||||
bool testFail = false;
|
||||
const QChar cSource = source.at(source.length()-1);
|
||||
QChar cPunctuation = cSource;
|
||||
|
|
Loading…
Reference in New Issue
Block a user