Refactoring.
Replace the redundant type with "auto".
This commit is contained in:
parent
ad1ea7b7fb
commit
78735cd31a
|
@ -92,7 +92,7 @@ auto VPCarrouselPiece::CreatePieceIcon(const QSize &size, bool isDragIcon) const
|
|||
|
||||
QRectF const boundingRect = piece->DetailBoundingRect();
|
||||
qreal const canvasSize = qMax(boundingRect.height(), boundingRect.width());
|
||||
QRectF const canvas = QRectF(0, 0, canvasSize, canvasSize);
|
||||
auto const canvas = QRectF(0, 0, canvasSize, canvasSize);
|
||||
|
||||
qreal const dx = canvas.center().x() - boundingRect.center().x();
|
||||
qreal const dy = canvas.center().y() - boundingRect.center().y();
|
||||
|
|
|
@ -689,7 +689,7 @@ void PuzzlePreferencesLayoutPage::FindTemplate(QComboBox *box, qreal width, qrea
|
|||
SCASSERT(box != nullptr)
|
||||
const Unit paperUnit = LayoutUnit();
|
||||
|
||||
const int max = static_cast<int>(VAbstractLayoutDialog::PaperSizeTemplate::Custom);
|
||||
const auto max = static_cast<int>(VAbstractLayoutDialog::PaperSizeTemplate::Custom);
|
||||
for (int i = 0; i < max; ++i)
|
||||
{
|
||||
const QSizeF tmplSize =
|
||||
|
|
|
@ -559,7 +559,7 @@ auto VPPiece::StickySheet(VStickyDistance &match) const -> bool
|
|||
}
|
||||
|
||||
const qreal stickyDistance = maxStickyDistance;
|
||||
if (QRectF const stickyZone =
|
||||
if (auto const stickyZone =
|
||||
QRectF(boundingRect.topLeft().x() - stickyDistance, boundingRect.topLeft().y() - stickyDistance,
|
||||
boundingRect.width() + stickyDistance * 2, boundingRect.height() + stickyDistance * 2);
|
||||
!stickyZone.intersects(sheetRect))
|
||||
|
@ -664,7 +664,7 @@ auto VPPiece::StickyPieces(VStickyDistance &match) const -> bool
|
|||
CastTo(GetMappedExternalContourPoints(), path);
|
||||
QRectF const boundingRect = VLayoutPiece::BoundingRect(path);
|
||||
const qreal stickyDistance = pieceGap + minStickyDistance;
|
||||
QRectF const stickyZone =
|
||||
auto const stickyZone =
|
||||
QRectF(boundingRect.topLeft().x() - stickyDistance, boundingRect.topLeft().y() - stickyDistance,
|
||||
boundingRect.width() + stickyDistance * 2, boundingRect.height() + stickyDistance * 2);
|
||||
|
||||
|
|
|
@ -725,8 +725,8 @@ auto VPSheet::GetMarginsRect() const -> QRectF
|
|||
{
|
||||
if (not m_ignoreMargins)
|
||||
{
|
||||
QRectF rect = QRectF(QPointF(m_margins.left(), m_margins.top()),
|
||||
QPointF(m_size.width() - m_margins.right(), m_size.height() - m_margins.bottom()));
|
||||
auto rect = QRectF(QPointF(m_margins.left(), m_margins.top()),
|
||||
QPointF(m_size.width() - m_margins.right(), m_size.height() - m_margins.bottom()));
|
||||
return rect;
|
||||
}
|
||||
|
||||
|
@ -984,7 +984,7 @@ auto VPSheet::GetSheetSize() const -> QSizeF
|
|||
auto VPSheet::GetSheetSizeConverted() const -> QSizeF
|
||||
{
|
||||
Unit const unit = SheetUnits();
|
||||
QSizeF convertedSize =
|
||||
auto convertedSize =
|
||||
QSizeF(UnitConvertor(m_size.width(), Unit::Px, unit), UnitConvertor(m_size.height(), Unit::Px, unit));
|
||||
|
||||
return convertedSize;
|
||||
|
|
|
@ -396,7 +396,7 @@ void VPGraphicsPiece::InitPieceLabelSVGFont(const QVector<QPointF> &labelShape,
|
|||
VSvgFont const svgFont = engine.Font();
|
||||
if (!svgFont.IsValid())
|
||||
{
|
||||
QString const errorMsg = QStringLiteral("Invalid SVG font '%1'. Fallback to outline font.").arg(svgFont.Name());
|
||||
auto const errorMsg = QStringLiteral("Invalid SVG font '%1'. Fallback to outline font.").arg(svgFont.Name());
|
||||
qDebug() << errorMsg;
|
||||
InitPieceLabelOutlineFont(labelShape, tm);
|
||||
return;
|
||||
|
|
|
@ -283,8 +283,8 @@ auto VPGraphicsTransformationOrigin::Center2() const -> QPainterPath
|
|||
const qreal scale = SceneScale(scene());
|
||||
qreal const radius = centerRadius2 / scale;
|
||||
VPTransformationOrigon const transformationOrigin = TransformationOrigin(m_layout, QRectF());
|
||||
QRectF const rect = QRectF(transformationOrigin.origin.x() - radius, transformationOrigin.origin.y() - radius,
|
||||
radius * 2., radius * 2.);
|
||||
auto const rect = QRectF(transformationOrigin.origin.x() - radius, transformationOrigin.origin.y() - radius,
|
||||
radius * 2., radius * 2.);
|
||||
|
||||
QPainterPath center2;
|
||||
center2.addEllipse(rect);
|
||||
|
@ -567,22 +567,22 @@ void VPGraphicsPieceControls::InitPixmaps()
|
|||
|
||||
auto InitPixmap = [this](VPHandleCornerType type, const QString &imageName)
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
const QString fileName = QStringLiteral("32x32/%1.png").arg(imageName);
|
||||
const auto fileName = QStringLiteral("32x32/%1.png").arg(imageName);
|
||||
QPixmap const handlePixmap = VTheme::GetPixmapResource(resource, fileName);
|
||||
|
||||
if (QGuiApplication::primaryScreen()->devicePixelRatio() >= 2)
|
||||
{
|
||||
const QString fileName2x = QStringLiteral("32x32/%1@2x.png").arg(imageName);
|
||||
const QString fileName2xHover = QStringLiteral("32x32/%1-hover@2x.png").arg(imageName);
|
||||
const auto fileName2x = QStringLiteral("32x32/%1@2x.png").arg(imageName);
|
||||
const auto fileName2xHover = QStringLiteral("32x32/%1-hover@2x.png").arg(imageName);
|
||||
|
||||
m_handlePixmaps.insert(type, VTheme::GetPixmapResource(resource, fileName2x));
|
||||
m_handleHoverPixmaps.insert(type, VTheme::GetPixmapResource(resource, fileName2xHover));
|
||||
}
|
||||
else
|
||||
{
|
||||
const QString fileNameHover = QStringLiteral("32x32/%1-hover.png").arg(imageName);
|
||||
const auto fileNameHover = QStringLiteral("32x32/%1-hover.png").arg(imageName);
|
||||
|
||||
m_handlePixmaps.insert(type, handlePixmap);
|
||||
m_handleHoverPixmaps.insert(type, VTheme::GetPixmapResource(resource, fileNameHover));
|
||||
|
|
|
@ -387,7 +387,7 @@ void VPGraphicsSheet::PaintGrid(QPainter *painter) const
|
|||
qreal colX = colWidth;
|
||||
while (colX < sheetRect.right())
|
||||
{
|
||||
QLineF const line = QLineF(colX, 0, colX, sheetRect.bottom());
|
||||
auto const line = QLineF(colX, 0, colX, sheetRect.bottom());
|
||||
painter->drawLine(line);
|
||||
colX += colWidth;
|
||||
}
|
||||
|
@ -399,7 +399,7 @@ void VPGraphicsSheet::PaintGrid(QPainter *painter) const
|
|||
|
||||
while (rowY < sheetRect.bottom())
|
||||
{
|
||||
QLineF const line = QLineF(0, rowY, sheetRect.right(), rowY);
|
||||
auto const line = QLineF(0, rowY, sheetRect.right(), rowY);
|
||||
painter->drawLine(line);
|
||||
rowY += rowHeight;
|
||||
}
|
||||
|
|
|
@ -1922,7 +1922,7 @@ void VPMainWindow::CreateWindowMenu(QMenu *menu)
|
|||
{
|
||||
VPMainWindow *window = windows.at(i);
|
||||
|
||||
QString title = QStringLiteral("%1. %2").arg(i + 1).arg(window->windowTitle());
|
||||
auto title = QStringLiteral("%1. %2").arg(i + 1).arg(window->windowTitle());
|
||||
if (const vsizetype index = title.lastIndexOf("[*]"_L1); index != -1)
|
||||
{
|
||||
window->isWindowModified() ? title.replace(index, 3, '*'_L1) : title.replace(index, 3, QString());
|
||||
|
@ -2210,7 +2210,7 @@ void VPMainWindow::FindTemplate(QComboBox *box, qreal width, qreal height)
|
|||
SCASSERT(box != nullptr)
|
||||
const Unit paperUnit = LayoutUnit();
|
||||
|
||||
const int max = static_cast<int>(VAbstractLayoutDialog::PaperSizeTemplate::Custom);
|
||||
const auto max = static_cast<int>(VAbstractLayoutDialog::PaperSizeTemplate::Custom);
|
||||
for (int i = 0; i < max; ++i)
|
||||
{
|
||||
const QSizeF tmplSize =
|
||||
|
@ -2907,7 +2907,7 @@ auto VPMainWindow::DrawTilesScheme(QPrinter *printer, QPainter *painter, const V
|
|||
|
||||
if (sheet->GetSheetOrientation() == QPageLayout::Landscape)
|
||||
{
|
||||
QPointF const shift = QPointF(0, textHeight);
|
||||
auto const shift = QPointF(0, textHeight);
|
||||
source = QRectF(sheetRect.topLeft() - shift, QSizeF(tilesWidth, tilesHeight + textHeight));
|
||||
}
|
||||
else
|
||||
|
@ -3603,7 +3603,7 @@ void VPMainWindow::RotatePieces()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPMainWindow::InitIcons()
|
||||
{
|
||||
const QString resource = QStringLiteral("puzzleicon");
|
||||
const auto resource = QStringLiteral("puzzleicon");
|
||||
|
||||
auto SetTabIcon = [resource, this](QWidget *tab, const QString &iconName)
|
||||
{
|
||||
|
@ -3747,7 +3747,7 @@ auto VPMainWindow::on_actionSave_triggered() -> bool
|
|||
auto VPMainWindow::on_actionSaveAs_triggered() -> bool
|
||||
{
|
||||
QString const filters = tr("Layout files") + QStringLiteral(" (*.vlt)");
|
||||
QString const suffix = QStringLiteral("vlt");
|
||||
auto const suffix = QStringLiteral("vlt");
|
||||
QString const fName = tr("layout") + '.'_L1 + suffix;
|
||||
|
||||
QString dir;
|
||||
|
|
|
@ -49,11 +49,11 @@ auto WatermarkImageFromCache(const VWatermarkData &watermarkData, const QString
|
|||
QPixmap pixmap;
|
||||
QString const imagePath = AbsoluteMPath(watermarkPath, watermarkData.path);
|
||||
|
||||
if (QString const imageCacheKey = QStringLiteral("puzzle=path%1+rotation%3+grayscale%4+xscale%5+yxcale%6")
|
||||
.arg(imagePath, QString::number(watermarkData.imageRotation),
|
||||
watermarkData.grayscale ? trueStr : falseStr)
|
||||
.arg(xScale)
|
||||
.arg(yScale);
|
||||
if (auto const imageCacheKey = QStringLiteral("puzzle=path%1+rotation%3+grayscale%4+xscale%5+yxcale%6")
|
||||
.arg(imagePath, QString::number(watermarkData.imageRotation),
|
||||
watermarkData.grayscale ? trueStr : falseStr)
|
||||
.arg(xScale)
|
||||
.arg(yScale);
|
||||
not QPixmapCache::find(imageCacheKey, &pixmap))
|
||||
{
|
||||
QImageReader imageReader(imagePath);
|
||||
|
@ -91,8 +91,8 @@ auto WatermarkImageFromCache(const VWatermarkData &watermarkData, const QString
|
|||
auto TriangleBasic() -> QPainterPath
|
||||
{
|
||||
// ------------- prepare triangles for position marks
|
||||
QRectF const rectBasic = QRectF(-UnitConvertor(0.5, Unit::Cm, Unit::Px), 0, UnitConvertor(1, Unit::Cm, Unit::Px),
|
||||
UnitConvertor(0.5, Unit::Cm, Unit::Px));
|
||||
auto const rectBasic = QRectF(-UnitConvertor(0.5, Unit::Cm, Unit::Px), 0, UnitConvertor(1, Unit::Cm, Unit::Px),
|
||||
UnitConvertor(0.5, Unit::Cm, Unit::Px));
|
||||
QPainterPath triangleBasic;
|
||||
triangleBasic.moveTo(rectBasic.topLeft());
|
||||
triangleBasic.lineTo(rectBasic.topRight());
|
||||
|
@ -408,7 +408,7 @@ void VPTileFactory::DrawTilePageContent(QPainter *painter, const VPSheetPtr &she
|
|||
sheetMargins = sheet->GetSheetMargins();
|
||||
}
|
||||
|
||||
QPen const penTileDrawing =
|
||||
auto const penTileDrawing =
|
||||
QPen(Qt::black, m_commonSettings->WidthMainLine(), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
|
||||
|
||||
painter->setPen(penTileDrawing);
|
||||
|
@ -416,11 +416,11 @@ void VPTileFactory::DrawTilePageContent(QPainter *painter, const VPSheetPtr &she
|
|||
// paint the content of the page
|
||||
const qreal xScale = layout->LayoutSettings().HorizontalScale();
|
||||
const qreal yScale = layout->LayoutSettings().VerticalScale();
|
||||
QRectF const source = QRectF(sheetMargins.left() + col * (m_drawingAreaWidth - tileStripeWidth) / xScale,
|
||||
sheetMargins.top() + row * (m_drawingAreaHeight - tileStripeWidth) / yScale,
|
||||
m_drawingAreaWidth / xScale, m_drawingAreaHeight / yScale);
|
||||
auto const source = QRectF(sheetMargins.left() + col * (m_drawingAreaWidth - tileStripeWidth) / xScale,
|
||||
sheetMargins.top() + row * (m_drawingAreaHeight - tileStripeWidth) / yScale,
|
||||
m_drawingAreaWidth / xScale, m_drawingAreaHeight / yScale);
|
||||
|
||||
QRectF const target = QRectF(0, 0, m_drawingAreaWidth, m_drawingAreaHeight);
|
||||
auto const target = QRectF(0, 0, m_drawingAreaWidth, m_drawingAreaHeight);
|
||||
sheet->SceneData()->Scene()->render(painter, VPrintLayout::SceneTargetRect(printer, target), source,
|
||||
Qt::IgnoreAspectRatio);
|
||||
}
|
||||
|
@ -616,7 +616,7 @@ void VPTileFactory::DrawTextInformation(QPainter *painter, int row, int col, int
|
|||
|
||||
td.setPageSize(QSizeF(m_drawingAreaHeight - UnitConvertor(2, Unit::Cm, Unit::Px), m_drawingAreaWidth));
|
||||
|
||||
QFontMetrics const metrix = QFontMetrics(td.defaultFont());
|
||||
auto const metrix = QFontMetrics(td.defaultFont());
|
||||
int const maxWidth = metrix.horizontalAdvance(QString().fill('z', 50));
|
||||
QString const clippedSheetName = metrix.elidedText(sheetName, Qt::ElideMiddle, maxWidth);
|
||||
|
||||
|
@ -683,7 +683,7 @@ void VPTileFactory::PaintWatermarkImage(QPainter *painter, const QRectF &img, co
|
|||
const qreal opacity = watermarkData.opacity / 100.;
|
||||
auto BrokenImage = [&img, &watermarkData, watermarkPath, opacity, folowColorScheme]()
|
||||
{
|
||||
QString colorScheme = QStringLiteral("light");
|
||||
auto colorScheme = QStringLiteral("light");
|
||||
|
||||
if (folowColorScheme)
|
||||
{
|
||||
|
|
|
@ -999,7 +999,7 @@ void VPLayoutFileReader::ReadLayoutMargins(const VPLayoutPtr &layout)
|
|||
{
|
||||
QXmlStreamAttributes const attribs = attributes();
|
||||
|
||||
QMarginsF margins = QMarginsF();
|
||||
QMarginsF margins;
|
||||
margins.setLeft(ReadAttributeDouble(attribs, ML::AttrLeft, QChar('0')));
|
||||
margins.setTop(ReadAttributeDouble(attribs, ML::AttrTop, QChar('0')));
|
||||
margins.setRight(ReadAttributeDouble(attribs, ML::AttrRight, QChar('0')));
|
||||
|
@ -1016,7 +1016,7 @@ void VPLayoutFileReader::ReadSheetMargins(const VPSheetPtr &sheet)
|
|||
{
|
||||
QXmlStreamAttributes const attribs = attributes();
|
||||
|
||||
QMarginsF margins = QMarginsF();
|
||||
QMarginsF margins;
|
||||
margins.setLeft(ReadAttributeDouble(attribs, ML::AttrLeft, QChar('0')));
|
||||
margins.setTop(ReadAttributeDouble(attribs, ML::AttrTop, QChar('0')));
|
||||
margins.setRight(ReadAttributeDouble(attribs, ML::AttrRight, QChar('0')));
|
||||
|
|
|
@ -73,7 +73,7 @@ void DialogDimensionCustomNames::InitTable(const QMap<MeasurementDimension, Meas
|
|||
while (i != dimensions.constEnd())
|
||||
{
|
||||
{
|
||||
QString const name = QStringLiteral("%1 (%2)").arg(
|
||||
auto const name = QStringLiteral("%1 (%2)").arg(
|
||||
VAbstartMeasurementDimension::DimensionName(i.value()->Type()), i.value()->Axis());
|
||||
auto *itemValue = new QTableWidgetItem(name);
|
||||
itemValue->setTextAlignment(Qt::AlignHCenter | Qt::AlignCenter);
|
||||
|
|
|
@ -59,8 +59,7 @@ void DialogDimensionLabels::changeEvent(QEvent *event)
|
|||
// retranslate designer form (single inheritance approach)
|
||||
ui->retranslateUi(this);
|
||||
|
||||
MeasurementDimension const type =
|
||||
static_cast<MeasurementDimension>(ui->comboBoxDimensionLabels->currentData().toInt());
|
||||
auto const type = static_cast<MeasurementDimension>(ui->comboBoxDimensionLabels->currentData().toInt());
|
||||
|
||||
InitDimensions();
|
||||
|
||||
|
@ -94,8 +93,7 @@ void DialogDimensionLabels::LabelChanged(QTableWidgetItem *item)
|
|||
{
|
||||
if (item != nullptr)
|
||||
{
|
||||
MeasurementDimension const type =
|
||||
static_cast<MeasurementDimension>(ui->comboBoxDimensionLabels->currentData().toInt());
|
||||
auto const type = static_cast<MeasurementDimension>(ui->comboBoxDimensionLabels->currentData().toInt());
|
||||
qreal const value = item->data(Qt::UserRole).toDouble();
|
||||
|
||||
DimesionLabels labels = m_labels.value(type);
|
||||
|
@ -138,8 +136,7 @@ void DialogDimensionLabels::InitTable()
|
|||
ui->tableWidget->blockSignals(true);
|
||||
ui->tableWidget->clearContents();
|
||||
|
||||
const MeasurementDimension type =
|
||||
static_cast<MeasurementDimension>(ui->comboBoxDimensionLabels->currentData().toInt());
|
||||
const auto type = static_cast<MeasurementDimension>(ui->comboBoxDimensionLabels->currentData().toInt());
|
||||
|
||||
MeasurementDimension_p dimension;
|
||||
|
||||
|
|
|
@ -519,7 +519,7 @@ void DialogKnownMeasurementsCSVColumns::CheckStatus()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
template <class T> auto DialogKnownMeasurementsCSVColumns::ColumnValid(T column) const -> bool
|
||||
{
|
||||
const int columnNumber = static_cast<int>(column);
|
||||
const auto columnNumber = static_cast<int>(column);
|
||||
int const value = m_columnsMap.at(columnNumber);
|
||||
|
||||
if (value == -1 && not ColumnMandatory(columnNumber))
|
||||
|
@ -548,7 +548,7 @@ template <class T> void DialogKnownMeasurementsCSVColumns::SaveColum(QComboBox *
|
|||
{
|
||||
SCASSERT(control != nullptr)
|
||||
|
||||
const int columnNumber = static_cast<int>(column);
|
||||
const auto columnNumber = static_cast<int>(column);
|
||||
m_columnsMap[columnNumber] = control->currentData().toInt();
|
||||
ShowImportPreview();
|
||||
CheckStatus();
|
||||
|
|
|
@ -253,7 +253,7 @@ auto DialogMeasurementsCSVColumns::ColumnHeader(int column) const -> QString
|
|||
}
|
||||
else
|
||||
{
|
||||
const QString suffix = QStringLiteral(" (%1):");
|
||||
const auto suffix = QStringLiteral(" (%1):");
|
||||
const auto multisizeColumn = static_cast<MultisizeMeasurementsColumns>(column);
|
||||
switch (multisizeColumn)
|
||||
{
|
||||
|
@ -746,7 +746,7 @@ void DialogMeasurementsCSVColumns::RetranslateLabels()
|
|||
ui->labelValue->setText(
|
||||
QCoreApplication::translate("DialogMeasurementsCSVColumns", "Base value", "measurement column") + "*:"_L1);
|
||||
|
||||
const QString suffix = QStringLiteral(" (%1)");
|
||||
const auto suffix = QStringLiteral(" (%1)");
|
||||
|
||||
if (not m_dimensions.empty())
|
||||
{
|
||||
|
@ -878,7 +878,7 @@ template <class T> void DialogMeasurementsCSVColumns::HackWidget(T **widget)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
template <class T> auto DialogMeasurementsCSVColumns::ColumnValid(T column) const -> bool
|
||||
{
|
||||
const int columnNumber = static_cast<int>(column);
|
||||
const auto columnNumber = static_cast<int>(column);
|
||||
int const value = m_columnsMap.at(columnNumber);
|
||||
|
||||
if (value == -1 && not ColumnMandatory(columnNumber))
|
||||
|
@ -907,7 +907,7 @@ template <class T> void DialogMeasurementsCSVColumns::SaveColum(QComboBox *contr
|
|||
{
|
||||
SCASSERT(control != nullptr)
|
||||
|
||||
const int columnNumber = static_cast<int>(column);
|
||||
const auto columnNumber = static_cast<int>(column);
|
||||
m_columnsMap[columnNumber] = control->currentData().toInt();
|
||||
ShowImportPreview();
|
||||
CheckStatus();
|
||||
|
|
|
@ -33,9 +33,9 @@
|
|||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogNewMeasurements::DialogNewMeasurements(QWidget *parent)
|
||||
:QDialog(parent),
|
||||
ui(new Ui::DialogNewMeasurements),
|
||||
m_isInitialized(false)
|
||||
: QDialog(parent),
|
||||
ui(new Ui::DialogNewMeasurements),
|
||||
m_isInitialized(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
|
@ -79,8 +79,8 @@ void DialogNewMeasurements::changeEvent(QEvent *event)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogNewMeasurements::showEvent(QShowEvent *event)
|
||||
{
|
||||
QDialog::showEvent( event );
|
||||
if ( event->spontaneous() )
|
||||
QDialog::showEvent(event);
|
||||
if (event->spontaneous())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -94,13 +94,13 @@ void DialogNewMeasurements::showEvent(QShowEvent *event)
|
|||
setMaximumSize(size());
|
||||
setMinimumSize(size());
|
||||
|
||||
m_isInitialized = true;//first show windows are held
|
||||
m_isInitialized = true; // first show windows are held
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogNewMeasurements::InitMTypes()
|
||||
{
|
||||
int val = static_cast<int>(MeasurementsType::Unknown);
|
||||
auto val = static_cast<int>(MeasurementsType::Unknown);
|
||||
if (ui->comboBoxMType->currentIndex() != -1)
|
||||
{
|
||||
val = ui->comboBoxMType->currentData().toInt();
|
||||
|
@ -122,7 +122,7 @@ void DialogNewMeasurements::InitMTypes()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogNewMeasurements::InitUnits()
|
||||
{
|
||||
int val = static_cast<int>(Unit::Cm);
|
||||
auto val = static_cast<int>(Unit::Cm);
|
||||
if (ui->comboBoxUnit->currentIndex() != -1)
|
||||
{
|
||||
val = ui->comboBoxUnit->currentData().toInt();
|
||||
|
|
|
@ -575,7 +575,7 @@ auto TKMMainWindow::FileSaveAs() -> bool
|
|||
QString const filters = tr("Known measurements") + QStringLiteral(" (*.vkm)");
|
||||
|
||||
QString fName = tr("known measurements");
|
||||
QString const suffix = QStringLiteral("vkm");
|
||||
auto const suffix = QStringLiteral("vkm");
|
||||
|
||||
fName += '.'_L1 + suffix;
|
||||
|
||||
|
@ -693,7 +693,7 @@ void TKMMainWindow::ImportDataFromCSV()
|
|||
}
|
||||
|
||||
const QString filters = tr("Comma-Separated Values") + QStringLiteral(" (*.csv)");
|
||||
const QString suffix = QStringLiteral("csv");
|
||||
const auto suffix = QStringLiteral("csv");
|
||||
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Import from CSV"), QDir::homePath(), filters, nullptr,
|
||||
VAbstractApplication::VApp()->NativeFileDialog());
|
||||
|
@ -2033,7 +2033,7 @@ void TKMMainWindow::WriteSettings()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TKMMainWindow::InitIcons()
|
||||
{
|
||||
QString const iconResource = QStringLiteral("icon");
|
||||
auto const iconResource = QStringLiteral("icon");
|
||||
ui->toolButtonAddImage->setIcon(VTheme::GetIconResource(iconResource, QStringLiteral("16x16/insert-image.png")));
|
||||
ui->toolButtonRemoveImage->setIcon(VTheme::GetIconResource(iconResource, QStringLiteral("16x16/remove-image.png")));
|
||||
|
||||
|
@ -2042,7 +2042,7 @@ void TKMMainWindow::InitIcons()
|
|||
ui->tabWidget->setTabIcon(index, VTheme::GetIconResource(iconResource, QStringLiteral("16x16/viewimage.png")));
|
||||
}
|
||||
|
||||
QString const tapeIconResource = QStringLiteral("tapeicon");
|
||||
auto const tapeIconResource = QStringLiteral("tapeicon");
|
||||
ui->actionMeasurementDiagram->setIcon(
|
||||
VTheme::GetIconResource(tapeIconResource, QStringLiteral("24x24/mannequin.png")));
|
||||
}
|
||||
|
@ -2150,7 +2150,7 @@ void TKMMainWindow::CreateWindowMenu(QMenu *menu)
|
|||
{
|
||||
TKMMainWindow *window = windows.at(i);
|
||||
|
||||
QString title = QStringLiteral("%1. %2").arg(i + 1).arg(window->windowTitle());
|
||||
auto title = QStringLiteral("%1. %2").arg(i + 1).arg(window->windowTitle());
|
||||
if (const auto index = title.lastIndexOf("[*]"_L1); index != -1)
|
||||
{
|
||||
window->isWindowModified() ? title.replace(index, 3, '*'_L1) : title.replace(index, 3, QString());
|
||||
|
|
|
@ -1090,7 +1090,7 @@ void TMainWindow::ImportDataFromCSV()
|
|||
}
|
||||
|
||||
const QString filters = tr("Comma-Separated Values") + QStringLiteral(" (*.csv)");
|
||||
const QString suffix = QStringLiteral("csv");
|
||||
const auto suffix = QStringLiteral("csv");
|
||||
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Import from CSV"), QDir::homePath(), filters, nullptr,
|
||||
VAbstractApplication::VApp()->NativeFileDialog());
|
||||
|
@ -2596,7 +2596,7 @@ void TMainWindow::ExportToIndividual()
|
|||
return;
|
||||
}
|
||||
|
||||
QString const suffix = QStringLiteral("vit");
|
||||
auto const suffix = QStringLiteral("vit");
|
||||
if (QFileInfo const f(fileName); f.suffix().isEmpty() && f.suffix() != suffix)
|
||||
{
|
||||
fileName += '.'_L1 + suffix;
|
||||
|
@ -3370,7 +3370,7 @@ void TMainWindow::ShowHeaderUnits(QTableWidget *table, int column, const QString
|
|||
{
|
||||
header.remove(index - 1, 100);
|
||||
}
|
||||
const QString unitHeader = QStringLiteral("%1 (%2)").arg(header, unit);
|
||||
const auto unitHeader = QStringLiteral("%1 (%2)").arg(header, unit);
|
||||
table->horizontalHeaderItem(column)->setText(unitHeader);
|
||||
}
|
||||
|
||||
|
@ -4197,7 +4197,7 @@ void TMainWindow::CreateWindowMenu(QMenu *menu)
|
|||
{
|
||||
TMainWindow *window = windows.at(i);
|
||||
|
||||
QString title = QStringLiteral("%1. %2").arg(i + 1).arg(window->windowTitle());
|
||||
auto title = QStringLiteral("%1. %2").arg(i + 1).arg(window->windowTitle());
|
||||
if (const auto index = title.lastIndexOf("[*]"_L1); index != -1)
|
||||
{
|
||||
window->isWindowModified() ? title.replace(index, 3, '*'_L1) : title.replace(index, 3, QString());
|
||||
|
@ -4697,12 +4697,12 @@ auto TMainWindow::OrderedMeasurements() const -> QMap<int, QSharedPointer<VMeasu
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TMainWindow::InitIcons()
|
||||
{
|
||||
QString const iconResource = QStringLiteral("icon");
|
||||
auto const iconResource = QStringLiteral("icon");
|
||||
ui->toolButtonExpr->setIcon(VTheme::GetIconResource(iconResource, QStringLiteral("24x24/fx.png")));
|
||||
ui->toolButtonAddImage->setIcon(VTheme::GetIconResource(iconResource, QStringLiteral("16x16/insert-image.png")));
|
||||
ui->toolButtonRemoveImage->setIcon(VTheme::GetIconResource(iconResource, QStringLiteral("16x16/remove-image.png")));
|
||||
|
||||
QString const tapeIconResource = QStringLiteral("tapeicon");
|
||||
auto const tapeIconResource = QStringLiteral("tapeicon");
|
||||
ui->actionMeasurementDiagram->setIcon(
|
||||
VTheme::GetIconResource(tapeIconResource, QStringLiteral("24x24/mannequin.png")));
|
||||
}
|
||||
|
@ -4846,7 +4846,7 @@ auto TMainWindow::CSVColumnHeader(int column) const -> QString
|
|||
}
|
||||
|
||||
const QList<MeasurementDimension_p> dimensions = m_m->Dimensions().values();
|
||||
const QString suffix = QStringLiteral(" (%1):");
|
||||
const auto suffix = QStringLiteral(" (%1):");
|
||||
|
||||
if (column == 4)
|
||||
{
|
||||
|
|
|
@ -97,7 +97,7 @@ namespace
|
|||
auto AppFilePath(const QString &appName) -> QString
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
const QString executableSuffix = QStringLiteral(".exe");
|
||||
const auto executableSuffix = QStringLiteral(".exe");
|
||||
#else
|
||||
const QString executableSuffix;
|
||||
#endif
|
||||
|
@ -416,7 +416,7 @@ void VApplication::NewValentina(const QString &fileName)
|
|||
}
|
||||
else
|
||||
{
|
||||
const QString run = QStringLiteral("\"%1\" \"%2\"").arg(QCoreApplication::applicationFilePath(), fileName);
|
||||
const auto run = QStringLiteral("\"%1\" \"%2\"").arg(QCoreApplication::applicationFilePath(), fileName);
|
||||
qCDebug(vApp, "New process with arguments. program = %s", qUtf8Printable(run));
|
||||
if (QProcess::startDetached(QCoreApplication::applicationFilePath(), QStringList{fileName}))
|
||||
{
|
||||
|
@ -518,9 +518,9 @@ auto VApplication::notify(QObject *receiver, QEvent *event) -> bool
|
|||
auto VApplication::TapeFilePath() -> QString
|
||||
{
|
||||
#ifdef Q_OS_MACOS
|
||||
const QString appName = QStringLiteral("Tape");
|
||||
const auto appName = QStringLiteral("Tape");
|
||||
#else
|
||||
const QString appName = QStringLiteral("tape");
|
||||
const auto appName = QStringLiteral("tape");
|
||||
#endif
|
||||
return AppFilePath(appName);
|
||||
}
|
||||
|
@ -529,9 +529,9 @@ auto VApplication::TapeFilePath() -> QString
|
|||
auto VApplication::PuzzleFilePath() -> QString
|
||||
{
|
||||
#ifdef Q_OS_MACOS
|
||||
const QString appName = QStringLiteral("Puzzle");
|
||||
const auto appName = QStringLiteral("Puzzle");
|
||||
#else
|
||||
const QString appName = QStringLiteral("puzzle");
|
||||
const auto appName = QStringLiteral("puzzle");
|
||||
#endif
|
||||
return AppFilePath(appName);
|
||||
}
|
||||
|
|
|
@ -551,14 +551,14 @@ void DialogFinalMeasurements::ShowUnits()
|
|||
{
|
||||
// calculated value
|
||||
const QString header = ui->tableWidget->horizontalHeaderItem(1)->text();
|
||||
const QString unitHeader = QStringLiteral("%1 (%2)").arg(header, unit);
|
||||
const auto unitHeader = QStringLiteral("%1 (%2)").arg(header, unit);
|
||||
ui->tableWidget->horizontalHeaderItem(1)->setText(unitHeader);
|
||||
}
|
||||
|
||||
{
|
||||
// formula
|
||||
const QString header = ui->tableWidget->horizontalHeaderItem(2)->text();
|
||||
const QString unitHeader = QStringLiteral("%1 (%2)").arg(header, unit);
|
||||
const auto unitHeader = QStringLiteral("%1 (%2)").arg(header, unit);
|
||||
ui->tableWidget->horizontalHeaderItem(2)->setText(unitHeader);
|
||||
}
|
||||
}
|
||||
|
@ -960,7 +960,7 @@ void DialogFinalMeasurements::UpdateSearchControlsTooltips()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogFinalMeasurements::InitIcons()
|
||||
{
|
||||
QString const resource = QStringLiteral("icon");
|
||||
auto const resource = QStringLiteral("icon");
|
||||
|
||||
ui->toolButtonExpr->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png")));
|
||||
}
|
||||
|
|
|
@ -317,7 +317,7 @@ void DialogIncrements::ShowHeaderUnits(QTableWidget *table, int column, const QS
|
|||
SCASSERT(table != nullptr)
|
||||
|
||||
const QString header = table->horizontalHeaderItem(column)->text();
|
||||
const QString unitHeader = QStringLiteral("%1 (%2)").arg(header, unit);
|
||||
const auto unitHeader = QStringLiteral("%1 (%2)").arg(header, unit);
|
||||
table->horizontalHeaderItem(column)->setText(unitHeader);
|
||||
}
|
||||
|
||||
|
@ -1306,8 +1306,8 @@ void DialogIncrements::InitIncrementUnits(QComboBox *combo)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::InitIcons()
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const QString fxIcon = QStringLiteral("24x24/fx.png");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
const auto fxIcon = QStringLiteral("24x24/fx.png");
|
||||
|
||||
ui->toolButtonExpr->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprPC->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
|
|
|
@ -75,7 +75,7 @@ DialogLayoutProgress::DialogLayoutProgress(QElapsedTimer timer, qint64 timeout,
|
|||
[this]()
|
||||
{
|
||||
const qint64 elapsed = m_timer.elapsed();
|
||||
const int timeout = static_cast<int>(m_timeout - elapsed);
|
||||
const auto timeout = static_cast<int>(m_timeout - elapsed);
|
||||
QTime t(0, 0);
|
||||
t = t.addMSecs(timeout);
|
||||
ui->labelTimeLeft->setText(tr("Time left: %1").arg(t.toString()));
|
||||
|
|
|
@ -450,7 +450,7 @@ void DialogLayoutSettings::FindTemplate()
|
|||
|
||||
const Unit paperUnit = PaperUnit();
|
||||
|
||||
const int max = static_cast<int>(PaperSizeTemplate::Custom);
|
||||
const auto max = static_cast<int>(PaperSizeTemplate::Custom);
|
||||
for (int i = 0; i < max; ++i)
|
||||
{
|
||||
const QSizeF tmplSize = GetTemplateSize(static_cast<PaperSizeTemplate>(i), paperUnit);
|
||||
|
|
|
@ -628,8 +628,8 @@ void DialogSaveLayout::SetTiledMargins(QMarginsF margins)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto DialogSaveLayout::GetTiledMargins() const -> QMarginsF
|
||||
{
|
||||
QMarginsF const margins = QMarginsF(ui->doubleSpinBoxLeftField->value(), ui->doubleSpinBoxTopField->value(),
|
||||
ui->doubleSpinBoxRightField->value(), ui->doubleSpinBoxBottomField->value());
|
||||
auto const margins = QMarginsF(ui->doubleSpinBoxLeftField->value(), ui->doubleSpinBoxTopField->value(),
|
||||
ui->doubleSpinBoxRightField->value(), ui->doubleSpinBoxBottomField->value());
|
||||
|
||||
return UnitConvertor(margins, VAbstractValApplication::VApp()->patternUnits(), Unit::Mm);
|
||||
}
|
||||
|
@ -821,7 +821,7 @@ void DialogSaveLayout::ReadSettings()
|
|||
const QSizeF size = VAbstractLayoutDialog::RoundTemplateSize(settings->GetTiledPDFPaperWidth(Unit::Mm),
|
||||
settings->GetTiledPDFPaperHeight(Unit::Mm), Unit::Mm);
|
||||
|
||||
const int max = static_cast<int>(PaperSizeTemplate::Custom);
|
||||
const auto max = static_cast<int>(PaperSizeTemplate::Custom);
|
||||
for (int i = 0; i < max; ++i)
|
||||
{
|
||||
|
||||
|
@ -886,8 +886,8 @@ void DialogSaveLayout::WriteSettings() const
|
|||
const Unit unit = VAbstractValApplication::VApp()->patternUnits();
|
||||
|
||||
// write Margins top, right, bottom, left
|
||||
QMarginsF const margins = QMarginsF(ui->doubleSpinBoxLeftField->value(), ui->doubleSpinBoxTopField->value(),
|
||||
ui->doubleSpinBoxRightField->value(), ui->doubleSpinBoxBottomField->value());
|
||||
auto const margins = QMarginsF(ui->doubleSpinBoxLeftField->value(), ui->doubleSpinBoxTopField->value(),
|
||||
ui->doubleSpinBoxRightField->value(), ui->doubleSpinBoxBottomField->value());
|
||||
settings->SetTiledPDFMargins(margins, unit);
|
||||
|
||||
// write Template
|
||||
|
|
|
@ -63,7 +63,7 @@ void SetImageHold(QTableWidgetItem *item, const VBackgroundPatternImage &image)
|
|||
{
|
||||
if (item)
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
(image.Hold()) ? item->setIcon(VTheme::GetIconResource(resource, QStringLiteral("16x16/hold_image.png")))
|
||||
: item->setIcon(VTheme::GetIconResource(resource, QStringLiteral("16x16/not_hold_image.png")));
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ void SetImageVisibility(QTableWidgetItem *item, const VBackgroundPatternImage &i
|
|||
{
|
||||
if (item)
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
item->setIcon(image.Visible() ? VTheme::GetIconResource(resource, QStringLiteral("16x16/open_eye.png"))
|
||||
: VTheme::GetIconResource(resource, QStringLiteral("16x16/closed_eye.png")));
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ void VWidgetGroups::SetGroupVisibility(vidtype id, bool visible) const
|
|||
QTableWidgetItem *item = ui->tableWidget->item(row, 0);
|
||||
if (item)
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
item->setIcon(visible ? VTheme::GetIconResource(resource, QStringLiteral("16x16/open_eye.png"))
|
||||
: VTheme::GetIconResource(resource, QStringLiteral("16x16/closed_eye.png")));
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ void VWidgetGroups::SetMultipleGroupsVisibility(const QVector<vidtype> &groups,
|
|||
|
||||
if (QTableWidgetItem *item = ui->tableWidget->item(row, 0); item)
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
item->setIcon(i.value()
|
||||
? VTheme::GetIconResource(resource, QStringLiteral("16x16/open_eye.png"))
|
||||
: VTheme::GetIconResource(resource, QStringLiteral("16x16/closed_eye.png")));
|
||||
|
@ -287,7 +287,7 @@ void VWidgetGroups::CtxMenu(const QPoint &pos)
|
|||
};
|
||||
|
||||
QScopedPointer<QMenu> const menu(new QMenu());
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
QAction *triggerVisibilityMenu =
|
||||
m_doc->GetGroupVisibility(id)
|
||||
? menu->addAction(VTheme::GetIconResource(resource, QStringLiteral("16x16/closed_eye.png")), tr("Hide"))
|
||||
|
@ -352,7 +352,7 @@ void VWidgetGroups::FillTable(QMap<quint32, VGroupData> groups)
|
|||
++currentRow;
|
||||
const VGroupData data = i.value();
|
||||
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
auto *item = new QTableWidgetItem();
|
||||
item->setTextAlignment(Qt::AlignHCenter);
|
||||
(data.visible) ? item->setIcon(VTheme::GetIconResource(resource, QStringLiteral("16x16/open_eye.png")))
|
||||
|
|
|
@ -837,7 +837,7 @@ void MainWindow::SetToolButton(bool checked, Tool t, const QString &cursor, cons
|
|||
if (VValentinaSettings *settings = VAbstractValApplication::VApp()->ValentinaSettings();
|
||||
settings->GetPointerMode() == VToolPointerMode::ToolIcon)
|
||||
{
|
||||
const QString resource = QStringLiteral("toolcursor");
|
||||
const auto resource = QStringLiteral("toolcursor");
|
||||
auto cursorResource = VTheme::GetResourceName(resource, cursor);
|
||||
if (qApp->devicePixelRatio() >= 2) // NOLINT(cppcoreguidelines-pro-type-static-cast-downcast)
|
||||
{
|
||||
|
@ -2904,7 +2904,7 @@ void MainWindow::ToolBarOption()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ToolBarStages()
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
m_leftGoToStage = new QLabel(this);
|
||||
m_leftGoToStage->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/go-next-skip.png")));
|
||||
|
@ -3648,7 +3648,7 @@ void MainWindow::CancelTool()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::SetupDrawToolsIcons()
|
||||
{
|
||||
const QString resource = QStringLiteral("toolicon");
|
||||
const auto resource = QStringLiteral("toolicon");
|
||||
|
||||
// This check helps to find missed tools
|
||||
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 61, "Not all tools were handled.");
|
||||
|
@ -3840,7 +3840,7 @@ void MainWindow::ActionDraw(bool checked)
|
|||
qCDebug(vMainWindow, "Show draw scene");
|
||||
ArrowTool(true);
|
||||
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
m_leftGoToStage->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/go-next-skip.png")));
|
||||
m_rightGoToStage->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/go-next.png")));
|
||||
|
@ -3900,7 +3900,7 @@ void MainWindow::ActionDetails(bool checked)
|
|||
}
|
||||
m_comboBoxDraws->setCurrentIndex(m_comboBoxDraws->count() - 1); // Need to get data about all details
|
||||
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
m_leftGoToStage->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/go-previous.png")));
|
||||
m_rightGoToStage->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/go-next.png")));
|
||||
|
||||
|
@ -3982,7 +3982,7 @@ void MainWindow::ActionLayout(bool checked)
|
|||
}
|
||||
m_comboBoxDraws->setCurrentIndex(m_comboBoxDraws->count() - 1); // Need to get data about all details
|
||||
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
m_leftGoToStage->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/go-previous.png")));
|
||||
m_rightGoToStage->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/go-previous-skip.png")));
|
||||
|
||||
|
@ -6478,7 +6478,7 @@ auto MainWindow::LoadPattern(QString fileName, const QString &customMeasureFile)
|
|||
// See issue #976. Pattern can lost link to measurements
|
||||
if (path.isEmpty() && doc->RequiresMeasurements())
|
||||
{
|
||||
const QString fakeName = QStringLiteral("unknown_measurements.vit");
|
||||
const auto fakeName = QStringLiteral("unknown_measurements.vit");
|
||||
// Check if exist
|
||||
fixedMPath = CheckPathToMeasurements(fileName, fakeName);
|
||||
if (fixedMPath.isEmpty())
|
||||
|
@ -7546,7 +7546,7 @@ auto MainWindow::GetMeasurementFileName() -> QString
|
|||
return {};
|
||||
}
|
||||
|
||||
QString shownName = QStringLiteral(" [");
|
||||
auto shownName = QStringLiteral(" [");
|
||||
shownName += QFileInfo(AbsoluteMPath(VAbstractValApplication::VApp()->GetPatternPath(), doc->MPath())).fileName();
|
||||
|
||||
if (m_mChanges)
|
||||
|
@ -7903,7 +7903,7 @@ void MainWindow::PrintPatternMessage(QEvent *event)
|
|||
}
|
||||
|
||||
const QString time = QDateTime::currentDateTime().toString(QStringLiteral("hh:mm:ss"));
|
||||
const QString message = QStringLiteral("%1: [%2] %3").arg(time, severity, patternMessage->Message());
|
||||
const auto message = QStringLiteral("%1: [%2] %3").arg(time, severity, patternMessage->Message());
|
||||
ui->plainTextEditPatternMessages->appendPlainText(message);
|
||||
if (not m_unreadPatternMessage.isNull())
|
||||
{
|
||||
|
|
|
@ -226,7 +226,7 @@ auto MainWindowsNoGUI::GenerateLayout(VLayoutGenerator &lGenerator) -> bool
|
|||
connect(progressTimer, &QTimer::timeout, this,
|
||||
[timer, &lGenerator, progressTimer]()
|
||||
{
|
||||
const int timeout = static_cast<int>(lGenerator.GetNestingTimeMSecs() - timer.elapsed());
|
||||
const auto timeout = static_cast<int>(lGenerator.GetNestingTimeMSecs() - timer.elapsed());
|
||||
|
||||
if (timeout <= 1000)
|
||||
{
|
||||
|
|
|
@ -1566,52 +1566,52 @@ auto VPattern::GetLabelBase(quint32 index) const -> QString
|
|||
{
|
||||
case 0: // de
|
||||
{
|
||||
const QString al = QStringLiteral("A,Ä,B,C,D,E,F,G,H,I,J,K,L,M,N,O,Ö,P,Q,R,S,ß,T,U,Ü,V,W,X,Y,Z");
|
||||
const auto al = QStringLiteral("A,Ä,B,C,D,E,F,G,H,I,J,K,L,M,N,O,Ö,P,Q,R,S,ß,T,U,Ü,V,W,X,Y,Z");
|
||||
alphabet = al.split(','_L1);
|
||||
break;
|
||||
}
|
||||
case 2: // fr
|
||||
{
|
||||
const QString al = QStringLiteral("A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z");
|
||||
const auto al = QStringLiteral("A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z");
|
||||
alphabet = al.split(','_L1);
|
||||
break;
|
||||
}
|
||||
case 3: // ru
|
||||
{
|
||||
const QString al = QStringLiteral("А,Б,В,Г,Д,Е,Ж,З,И,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Э,Ю,Я");
|
||||
const auto al = QStringLiteral("А,Б,В,Г,Д,Е,Ж,З,И,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Э,Ю,Я");
|
||||
alphabet = al.split(','_L1);
|
||||
break;
|
||||
}
|
||||
case 4: // uk
|
||||
{
|
||||
const QString al = QStringLiteral("А,Б,В,Г,Д,Е,Ж,З,І,Ї,Й,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Є,Ю,Я");
|
||||
const auto al = QStringLiteral("А,Б,В,Г,Д,Е,Ж,З,І,Ї,Й,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Є,Ю,Я");
|
||||
alphabet = al.split(','_L1);
|
||||
break;
|
||||
}
|
||||
case 5: // hr
|
||||
case 7: // bs
|
||||
{
|
||||
const QString al = QStringLiteral("A,B,C,Č,Ć,D,Dž,Ð,E,F,G,H,I,J,K,L,Lj,M,N,Nj,O,P,R,S,Š,T,U,V,Z,Ž");
|
||||
const auto al = QStringLiteral("A,B,C,Č,Ć,D,Dž,Ð,E,F,G,H,I,J,K,L,Lj,M,N,Nj,O,P,R,S,Š,T,U,V,Z,Ž");
|
||||
alphabet = al.split(','_L1);
|
||||
break;
|
||||
}
|
||||
case 6: // sr
|
||||
{
|
||||
const QString al = QStringLiteral("А,Б,В,Г,Д,Ђ,Е,Ж,З,И,Ј,К,Л,Љ,М,Н,Њ,О,П,Р,С,Т,Ћ,У,Ф,Х,Ц,Ч,Џ,Ш");
|
||||
const auto al = QStringLiteral("А,Б,В,Г,Д,Ђ,Е,Ж,З,И,Ј,К,Л,Љ,М,Н,Њ,О,П,Р,С,Т,Ћ,У,Ф,Х,Ц,Ч,Џ,Ш");
|
||||
alphabet = al.split(','_L1);
|
||||
break;
|
||||
}
|
||||
case 8: // cs
|
||||
{
|
||||
const QString al = QStringLiteral("a,á,b,c,č,d,ď,e,é,ě,f,g,h,ch,i,í,j,k,l,m,n,ň,o,ó,p,q,r,ř,s,š,t,ť,u,ú,ů,"
|
||||
"v,w,x,y,ý,z,ž");
|
||||
const auto al = QStringLiteral("a,á,b,c,č,d,ď,e,é,ě,f,g,h,ch,i,í,j,k,l,m,n,ň,o,ó,p,q,r,ř,s,š,t,ť,u,ú,ů,"
|
||||
"v,w,x,y,ý,z,ž");
|
||||
alphabet = al.split(','_L1);
|
||||
break;
|
||||
}
|
||||
case 1: // en
|
||||
default: // en
|
||||
{
|
||||
const QString al = QStringLiteral("A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z");
|
||||
const auto al = QStringLiteral("A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z");
|
||||
alphabet = al.split(','_L1);
|
||||
break;
|
||||
}
|
||||
|
@ -1619,7 +1619,7 @@ auto VPattern::GetLabelBase(quint32 index) const -> QString
|
|||
|
||||
QString base;
|
||||
const int count = qFloor(index / static_cast<quint32>(alphabet.size()));
|
||||
const int number = static_cast<int>(index) - static_cast<int>(alphabet.size()) * count;
|
||||
const auto number = static_cast<int>(index) - static_cast<int>(alphabet.size()) * count;
|
||||
int i = 0;
|
||||
do
|
||||
{
|
||||
|
|
|
@ -429,7 +429,7 @@ auto FvUpdater::xmlParseFeed() -> bool
|
|||
else if (m_xml.name() == "enclosure"_L1)
|
||||
{
|
||||
const QXmlStreamAttributes attribs = m_xml.attributes();
|
||||
const QString fervorPlatform = QStringLiteral("fervor:platform");
|
||||
const auto fervorPlatform = QStringLiteral("fervor:platform");
|
||||
|
||||
if (attribs.hasAttribute(fervorPlatform))
|
||||
{
|
||||
|
@ -437,7 +437,7 @@ auto FvUpdater::xmlParseFeed() -> bool
|
|||
{
|
||||
xmlEnclosurePlatform = attribs.value(fervorPlatform).toString().trimmed();
|
||||
|
||||
const QString attributeUrl = QStringLiteral("url");
|
||||
const auto attributeUrl = QStringLiteral("url");
|
||||
if (attribs.hasAttribute(attributeUrl))
|
||||
{
|
||||
xmlEnclosureUrl = attribs.value(attributeUrl).toString().trimmed();
|
||||
|
@ -447,7 +447,7 @@ auto FvUpdater::xmlParseFeed() -> bool
|
|||
xmlEnclosureUrl.clear();
|
||||
}
|
||||
|
||||
const QString fervorVersion = QStringLiteral("fervor:version");
|
||||
const auto fervorVersion = QStringLiteral("fervor:version");
|
||||
if (attribs.hasAttribute(fervorVersion))
|
||||
{
|
||||
const QString candidateVersion = attribs.value(fervorVersion).toString().trimmed();
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractMConverter::VAbstractMConverter(const QString &fileName)
|
||||
:VAbstractConverter(fileName)
|
||||
: VAbstractConverter(fileName)
|
||||
{
|
||||
m_ver = GetFormatVersion(GetFormatVersionStr());
|
||||
}
|
||||
|
@ -55,8 +55,7 @@ auto VAbstractMConverter::Units() const -> Unit
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractMConverter::AddRootComment()
|
||||
{
|
||||
const QString rootComment =
|
||||
QStringLiteral("Measurements created with Valentina (https://smart-pattern.com.ua/).");
|
||||
const auto rootComment = QStringLiteral("Measurements created with Valentina (https://smart-pattern.com.ua/).");
|
||||
|
||||
QDomElement rootElement = this->documentElement();
|
||||
rootElement.insertBefore(createComment(rootComment), rootElement.firstChild());
|
||||
|
@ -79,7 +78,7 @@ auto VAbstractMConverter::OldNamesToNewNames_InV0_3_0() -> QMultiMap<QString, QS
|
|||
names.insert(QStringLiteral("height_waist_front"), QStringLiteral("front_waist_to_floor"));
|
||||
names.insert(QStringLiteral("height_bustpoint"), QStringLiteral("height_nipple_point"));
|
||||
|
||||
QString name = QStringLiteral("height_shoulder_tip");
|
||||
auto name = QStringLiteral("height_shoulder_tip");
|
||||
names.insert(name, QStringLiteral("shoulder_height"));
|
||||
names.insert(name, QStringLiteral("height_shoulder_point"));
|
||||
|
||||
|
|
|
@ -2150,7 +2150,7 @@ auto VAbstractPattern::GetMaterials(const QDomElement &element) const -> QMap<in
|
|||
{
|
||||
if (tagMaterial.tagName() == TagMaterial)
|
||||
{
|
||||
const int number = static_cast<int>(GetParametrUInt(tagMaterial, AttrNumber, QChar('0')));
|
||||
const auto number = static_cast<int>(GetParametrUInt(tagMaterial, AttrNumber, QChar('0')));
|
||||
const QString name = GetParametrEmptyString(tagMaterial, AttrName);
|
||||
|
||||
if (number > 0 && number <= userMaterialPlaceholdersQuantity)
|
||||
|
|
|
@ -1262,7 +1262,7 @@ auto VPatternConverter::OldNamesToNewNames_InV0_2_0() -> QMap<QString, QString>
|
|||
names.insert(QStringLiteral("front_waist_to_floor"), QStringLiteral("height_waist_front"));
|
||||
names.insert(QStringLiteral("height_nipple_point"), QStringLiteral("height_bustpoint"));
|
||||
|
||||
QString name = QStringLiteral("height_shoulder_tip");
|
||||
auto name = QStringLiteral("height_shoulder_tip");
|
||||
names.insert(QStringLiteral("shoulder_height"), name);
|
||||
names.insert(QStringLiteral("height_shoulder_point"), name);
|
||||
|
||||
|
@ -1965,7 +1965,7 @@ void VPatternConverter::PortPieceLabelstoV0_6_0()
|
|||
|
||||
QString line;
|
||||
|
||||
const int material = static_cast<int>(GetParametrUInt(domMCP, *strMaterial, QChar('0')));
|
||||
const auto material = static_cast<int>(GetParametrUInt(domMCP, *strMaterial, QChar('0')));
|
||||
switch (material)
|
||||
{
|
||||
case 0:
|
||||
|
@ -1988,7 +1988,7 @@ void VPatternConverter::PortPieceLabelstoV0_6_0()
|
|||
|
||||
line.append(", %wCut% ");
|
||||
|
||||
const int cutNumber = static_cast<int>(GetParametrUInt(domMCP, *strCutNumber, QChar('1')));
|
||||
const auto cutNumber = static_cast<int>(GetParametrUInt(domMCP, *strCutNumber, QChar('1')));
|
||||
|
||||
if (firstLine)
|
||||
{
|
||||
|
|
|
@ -196,7 +196,7 @@ void VVITConverter::ConvertMeasurementsToV0_3_0()
|
|||
// TODO. Delete if minimal supported version is 0.3.0
|
||||
Q_STATIC_ASSERT_X(VVITConverter::MeasurementMinVer < FormatVersion(0, 3, 0), "Time to refactor the code.");
|
||||
|
||||
const QString tagBM = QStringLiteral("body-measurements");
|
||||
const auto tagBM = QStringLiteral("body-measurements");
|
||||
|
||||
QDomElement bm = createElement(tagBM);
|
||||
|
||||
|
@ -293,7 +293,7 @@ void VVITConverter::ConvertMeasurementsToV0_3_3()
|
|||
|
||||
for (int ii = 0; ii < nodeList.size(); ++ii)
|
||||
{
|
||||
const QString attrName = QStringLiteral("name");
|
||||
const auto attrName = QStringLiteral("name");
|
||||
QDomElement element = nodeList.at(ii).toElement();
|
||||
const QString name = GetParametrString(element, attrName);
|
||||
if (name == i.value())
|
||||
|
|
|
@ -214,7 +214,7 @@ void VVSTConverter::ConvertMeasurementsToV0_4_0()
|
|||
// TODO. Delete if minimal supported version is 0.4.0
|
||||
Q_STATIC_ASSERT_X(VVSTConverter::MeasurementMinVer < FormatVersion(0, 4, 0), "Time to refactor the code.");
|
||||
|
||||
const QString tagBM = QStringLiteral("body-measurements");
|
||||
const auto tagBM = QStringLiteral("body-measurements");
|
||||
|
||||
QDomElement bm = createElement(tagBM);
|
||||
|
||||
|
@ -309,7 +309,7 @@ void VVSTConverter::ConvertMeasurementsToV0_4_2()
|
|||
|
||||
for (int ii = 0; ii < nodeList.size(); ++ii)
|
||||
{
|
||||
const QString attrName = QStringLiteral("name");
|
||||
const auto attrName = QStringLiteral("name");
|
||||
QDomElement element = nodeList.at(ii).toElement();
|
||||
const QString name = GetParametrString(element, attrName);
|
||||
if (name == i.value())
|
||||
|
@ -352,9 +352,9 @@ void VVSTConverter::AddNewTagsForV0_5_0()
|
|||
const Unit units = Units();
|
||||
|
||||
{
|
||||
const int step = static_cast<int>(UnitConvertor(6, Unit::Cm, units));
|
||||
const int min = static_cast<int>(UnitConvertor(50, Unit::Cm, units));
|
||||
const int max = static_cast<int>(UnitConvertor(200, Unit::Cm, units));
|
||||
const auto step = static_cast<int>(UnitConvertor(6, Unit::Cm, units));
|
||||
const auto min = static_cast<int>(UnitConvertor(50, Unit::Cm, units));
|
||||
const auto max = static_cast<int>(UnitConvertor(200, Unit::Cm, units));
|
||||
|
||||
QDomElement dimensionX = createElement(QStringLiteral("dimension"));
|
||||
SetAttribute(dimensionX, QStringLiteral("type"), QChar('x'));
|
||||
|
@ -366,9 +366,9 @@ void VVSTConverter::AddNewTagsForV0_5_0()
|
|||
}
|
||||
|
||||
{
|
||||
const int step = static_cast<int>(UnitConvertor(2, Unit::Cm, units));
|
||||
const int min = static_cast<int>(UnitConvertor(22, Unit::Cm, units));
|
||||
const int max = static_cast<int>(UnitConvertor(72, Unit::Cm, units));
|
||||
const auto step = static_cast<int>(UnitConvertor(2, Unit::Cm, units));
|
||||
const auto min = static_cast<int>(UnitConvertor(22, Unit::Cm, units));
|
||||
const auto max = static_cast<int>(UnitConvertor(72, Unit::Cm, units));
|
||||
|
||||
QDomElement dimensionY = createElement(QStringLiteral("dimension"));
|
||||
SetAttribute(dimensionY, QStringLiteral("type"), QChar('y'));
|
||||
|
|
|
@ -92,7 +92,7 @@ void QmuFormulaBase::InitCharSets()
|
|||
};
|
||||
|
||||
// Defining identifier character sets
|
||||
QString nameChars = QStringLiteral("0123456789\\_@#'") + symbolsStr;
|
||||
auto nameChars = QStringLiteral("0123456789\\_@#'") + symbolsStr;
|
||||
|
||||
AddNotCanonical(nameChars, sign0, '0');
|
||||
AddNotCanonical(nameChars, sign1, '1');
|
||||
|
@ -107,7 +107,7 @@ void QmuFormulaBase::InitCharSets()
|
|||
|
||||
DefineNameChars(nameChars);
|
||||
|
||||
const QString opChars = QStringLiteral("+-*^/?<>=!$%&|~'_");
|
||||
const auto opChars = QStringLiteral("+-*^/?<>=!$%&|~'_");
|
||||
|
||||
QString oprtChars = symbolsStr + opChars;
|
||||
AddNotCanonical(oprtChars, positiveSign, '+');
|
||||
|
|
|
@ -415,7 +415,7 @@ void DRW_Ellipse::toPolyline(DRW_Polyline *pol, int parts)
|
|||
sinRot = sin(incAngle);
|
||||
incAngle = M_PIx2 / parts;
|
||||
curAngle = staparam;
|
||||
int i = static_cast<int>(curAngle / incAngle);
|
||||
auto i = static_cast<int>(curAngle / incAngle);
|
||||
do
|
||||
{
|
||||
if (curAngle > endparam)
|
||||
|
|
|
@ -140,7 +140,7 @@ void VSingleLineOutlineChar::ExportCorrections(const QString &dirPath) const
|
|||
}
|
||||
}
|
||||
|
||||
QString const filename = QStringLiteral("%1/%2.json").arg(dirPath, m_font.family());
|
||||
auto const filename = QStringLiteral("%1/%2.json").arg(dirPath, m_font.family());
|
||||
QFile jsonFile(filename);
|
||||
if (!jsonFile.open(QIODevice::WriteOnly | QIODevice::Text))
|
||||
{
|
||||
|
@ -158,7 +158,7 @@ void VSingleLineOutlineChar::ExportCorrections(const QString &dirPath) const
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VSingleLineOutlineChar::LoadCorrections(const QString &dirPath) const
|
||||
{
|
||||
QString const fileName = QStringLiteral("%1.json").arg(m_font.family());
|
||||
auto const fileName = QStringLiteral("%1.json").arg(m_font.family());
|
||||
|
||||
QDir directory(dirPath);
|
||||
directory.setNameFilters(QStringList(fileName));
|
||||
|
|
|
@ -478,7 +478,7 @@ auto VGAnalytics::CountryCode() -> QString
|
|||
|
||||
eventLoop.exec();
|
||||
|
||||
QString country = QStringLiteral("Unknown");
|
||||
auto country = QStringLiteral("Unknown");
|
||||
|
||||
if (timer.isActive())
|
||||
{
|
||||
|
|
|
@ -215,7 +215,7 @@ auto VGAnalyticsWorker::SendAnalytics() -> QNetworkReply *
|
|||
// queue has messages -> stop timer and start sending
|
||||
m_timer.stop();
|
||||
|
||||
QString connection = QStringLiteral("close");
|
||||
auto connection = QStringLiteral("close");
|
||||
if (m_messageQueue.count() > 1)
|
||||
{
|
||||
connection = "keep-alive"_L1;
|
||||
|
@ -245,7 +245,7 @@ auto VGAnalyticsWorker::SendAnalytics() -> QNetworkReply *
|
|||
LogMessage(VGAnalytics::Error, QStringLiteral("google analytics api seceret was not set!"));
|
||||
}
|
||||
|
||||
QString requestUrl = QStringLiteral("https://www.google-analytics.com/mp/collect?measurement_id=%1&api_secret=%2");
|
||||
auto requestUrl = QStringLiteral("https://www.google-analytics.com/mp/collect?measurement_id=%1&api_secret=%2");
|
||||
requestUrl = requestUrl.arg(m_measurementId, m_apiSecret);
|
||||
m_request.setUrl(QUrl(requestUrl));
|
||||
|
||||
|
|
|
@ -243,7 +243,7 @@ auto VAbstractArc::GetPath() const -> QPainterPath
|
|||
else
|
||||
{
|
||||
QPointF const center = GetCenter().toQPointF();
|
||||
QRectF rec = QRectF(center.x(), center.y(), accuracyPointOnLine * 2, accuracyPointOnLine * 2);
|
||||
auto rec = QRectF(center.x(), center.y(), accuracyPointOnLine * 2, accuracyPointOnLine * 2);
|
||||
rec.translate(-rec.center().x(), -rec.center().y());
|
||||
path.addEllipse(rec);
|
||||
}
|
||||
|
|
|
@ -492,7 +492,7 @@ auto VAbstractCurve::CurveIntersectAxis(const QPointF &point, qreal angle, const
|
|||
angle = line.angle();
|
||||
}
|
||||
|
||||
QRectF rec = QRectF(0, 0, INT_MAX, INT_MAX);
|
||||
auto rec = QRectF(0, 0, INT_MAX, INT_MAX);
|
||||
rec.translate(-INT_MAX / 2.0, -INT_MAX / 2.0);
|
||||
|
||||
// Instead of using axis compare two rays. See issue #963.
|
||||
|
|
|
@ -435,7 +435,7 @@ auto VArc::OptimalApproximationScale(qreal radius, qreal f1, qreal f2, qreal tol
|
|||
void VArc::CreateName()
|
||||
{
|
||||
QString name = ARC_ + this->GetCenter().name();
|
||||
const QString nameStr = QStringLiteral("_%1");
|
||||
const auto nameStr = QStringLiteral("_%1");
|
||||
|
||||
if (getMode() == Draw::Modeling && getIdObject() != NULL_ID)
|
||||
{
|
||||
|
|
|
@ -613,7 +613,7 @@ auto VEllipticalArc::CutArc(qreal length, const QString &pointName) const -> QPo
|
|||
void VEllipticalArc::CreateName()
|
||||
{
|
||||
QString name = ELARC_ + this->GetCenter().name();
|
||||
const QString nameStr = QStringLiteral("_%1");
|
||||
const auto nameStr = QStringLiteral("_%1");
|
||||
|
||||
if (getMode() == Draw::Modeling && getIdObject() != NULL_ID)
|
||||
{
|
||||
|
|
|
@ -84,8 +84,8 @@ void DialogLayoutScale::SetTiledMargins(QMarginsF margins)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto DialogLayoutScale::GetTiledMargins() const -> QMarginsF
|
||||
{
|
||||
QMarginsF const margins = QMarginsF(ui->doubleSpinBoxLeftField->value(), ui->doubleSpinBoxTopField->value(),
|
||||
ui->doubleSpinBoxRightField->value(), ui->doubleSpinBoxBottomField->value());
|
||||
auto const margins = QMarginsF(ui->doubleSpinBoxLeftField->value(), ui->doubleSpinBoxTopField->value(),
|
||||
ui->doubleSpinBoxRightField->value(), ui->doubleSpinBoxBottomField->value());
|
||||
|
||||
return UnitConvertor(margins, VAbstractValApplication::VApp()->patternUnits(), Unit::Mm);
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ void DialogLayoutScale::WriteSettings() const
|
|||
const Unit unit = VAbstractValApplication::VApp()->patternUnits();
|
||||
|
||||
// write Margins top, right, bottom, left
|
||||
QMarginsF const margins = QMarginsF(ui->doubleSpinBoxLeftField->value(), ui->doubleSpinBoxTopField->value(),
|
||||
ui->doubleSpinBoxRightField->value(), ui->doubleSpinBoxBottomField->value());
|
||||
auto const margins = QMarginsF(ui->doubleSpinBoxLeftField->value(), ui->doubleSpinBoxTopField->value(),
|
||||
ui->doubleSpinBoxRightField->value(), ui->doubleSpinBoxBottomField->value());
|
||||
settings->SetTiledPDFMargins(margins, unit);
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ void VAbstractLayoutDialog::InitTemplates(QComboBox *comboBoxTemplates)
|
|||
SCASSERT(comboBoxTemplates != nullptr)
|
||||
const QIcon icoPaper("://icon/16x16/template.png"_L1);
|
||||
const QIcon icoRoll("://icon/16x16/roll.png"_L1);
|
||||
const QString pdi = QStringLiteral("(%1ppi)").arg(PrintDPI);
|
||||
const auto pdi = QStringLiteral("(%1ppi)").arg(PrintDPI);
|
||||
|
||||
auto cntr = static_cast<VIndexType>(PaperSizeTemplate::A0);
|
||||
for (const auto &v : PageFormatNames())
|
||||
|
@ -79,7 +79,7 @@ void VAbstractLayoutDialog::InitTileTemplates(QComboBox *comboBoxTemplates, bool
|
|||
InitTemplates(comboBoxTemplates);
|
||||
|
||||
// remove unused formats
|
||||
for (int i = static_cast<int>(PaperSizeTemplate::Roll24in); i <= static_cast<int>(PaperSizeTemplate::Custom); ++i)
|
||||
for (auto i = static_cast<int>(PaperSizeTemplate::Roll24in); i <= static_cast<int>(PaperSizeTemplate::Custom); ++i)
|
||||
{
|
||||
if (keepCustom && i == static_cast<int>(PaperSizeTemplate::Custom))
|
||||
{
|
||||
|
|
|
@ -156,7 +156,7 @@ auto VRawLayout::ReadFile(QIODevice *ioDevice, VRawLayoutData &data) -> bool
|
|||
// bytes of the stream will be the size of the array, we might end up attempting to allocate
|
||||
// a large amount of memory if the wrong file type was read. Instead, we'll just read the
|
||||
// same number of bytes that are in the array we are comparing it to. No size was written.
|
||||
const int len = static_cast<int>(fileHeaderByteArray.size());
|
||||
const auto len = static_cast<int>(fileHeaderByteArray.size());
|
||||
QByteArray actualFileHeaderByteArray(len, '\0');
|
||||
dataStream.readRawData(actualFileHeaderByteArray.data(), len);
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ auto SplitTextByWidth(const QString &text, const QFont &font, int maxWidth) -> Q
|
|||
QStringList substrings;
|
||||
substrings.reserve(2);
|
||||
|
||||
const int textLength = static_cast<int>(text.length());
|
||||
const auto textLength = static_cast<int>(text.length());
|
||||
int lineWidth = 0;
|
||||
|
||||
for (int endIndex = 0; endIndex < textLength; ++endIndex)
|
||||
|
@ -141,7 +141,7 @@ auto SplitTextByWidth(const QString &text, const VSvgFont &font, int maxWidth, q
|
|||
QStringList substrings;
|
||||
substrings.reserve(2);
|
||||
|
||||
const int textLength = static_cast<int>(text.length());
|
||||
const auto textLength = static_cast<int>(text.length());
|
||||
qreal lineWidth = 0;
|
||||
|
||||
for (int endIndex = 0; endIndex < textLength; ++endIndex)
|
||||
|
|
|
@ -75,24 +75,24 @@ Q_REQUIRED_RESULT auto AppSettings(const QString &appName) -> VCommonSettings *
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto AppCrashVersion() -> QString
|
||||
{
|
||||
QString const version = QStringLiteral("%1_%2_%3").arg(MAJOR_VERSION).arg(MINOR_VERSION).arg(DEBUG_VERSION);
|
||||
QString const qtVersion = QStringLiteral("Qt_%1_%2").arg(QT_VERSION_MAJOR).arg(QT_VERSION_MINOR);
|
||||
auto const version = QStringLiteral("%1_%2_%3").arg(MAJOR_VERSION).arg(MINOR_VERSION).arg(DEBUG_VERSION);
|
||||
auto const qtVersion = QStringLiteral("Qt_%1_%2").arg(QT_VERSION_MAJOR).arg(QT_VERSION_MINOR);
|
||||
QString multibundle; // NOLINT(misc-const-correctness)
|
||||
|
||||
#if defined(Q_OS_MACOS)
|
||||
QString const platform = QStringLiteral("macos");
|
||||
auto const platform = QStringLiteral("macos");
|
||||
#if defined(MULTI_BUNDLE)
|
||||
multibundle = QStringLiteral("-multibundle");
|
||||
#endif
|
||||
#elif defined(Q_OS_WIN)
|
||||
QString const platform = QStringLiteral("windows");
|
||||
auto const platform = QStringLiteral("windows");
|
||||
#elif defined(Q_OS_LINUX)
|
||||
QString const platform = QStringLiteral("linux");
|
||||
auto const platform = QStringLiteral("linux");
|
||||
#else
|
||||
QString const platform = QStringLiteral("unknown");
|
||||
auto const platform = QStringLiteral("unknown");
|
||||
#endif
|
||||
|
||||
QString revision = QStringLiteral(VCS_REPO_STATE_REVISION);
|
||||
auto revision = QStringLiteral(VCS_REPO_STATE_REVISION);
|
||||
if (!revision.startsWith('g'))
|
||||
{ // assume always git
|
||||
revision.prepend('g');
|
||||
|
@ -226,9 +226,9 @@ auto InitializeCrashpad(const QString &appName) -> bool
|
|||
MakeDir(metricsPath);
|
||||
base::FilePath const metricsDir(VCrashPaths::GetPlatformString(metricsPath));
|
||||
|
||||
QString const dbName = QStringLiteral("valentina");
|
||||
auto const dbName = QStringLiteral("valentina");
|
||||
// Configure url with your BugSplat database
|
||||
QString const url = QStringLiteral("https://%1.bugsplat.com/post/bp/crash/crashpad.php").arg(dbName);
|
||||
auto const url = QStringLiteral("https://%1.bugsplat.com/post/bp/crash/crashpad.php").arg(dbName);
|
||||
|
||||
// Metadata that will be posted to BugSplat
|
||||
QMap<std::string, std::string> annotations;
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace
|
|||
{
|
||||
auto LogDirPath(const QString &appName) -> QString
|
||||
{
|
||||
const QString logs = QStringLiteral("Logs");
|
||||
const auto logs = QStringLiteral("Logs");
|
||||
|
||||
QString logDirPath = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation);
|
||||
if (logDirPath.isEmpty())
|
||||
|
@ -81,9 +81,9 @@ auto VCrashPaths::GetAttachmentPath(const QString &appName) -> QString
|
|||
auto VCrashPaths::GetHandlerPath() const -> QString
|
||||
{
|
||||
#if defined(Q_OS_WINDOWS)
|
||||
const QString handler = QStringLiteral("crashpad_handler.exe");
|
||||
const auto handler = QStringLiteral("crashpad_handler.exe");
|
||||
#elif defined(Q_OS_MAC) || defined(Q_OS_LINUX)
|
||||
const QString handler = QStringLiteral("crashpad_handler");
|
||||
const auto handler = QStringLiteral("crashpad_handler");
|
||||
#else
|
||||
#error GetHandlerPath not implemented on this platform
|
||||
#endif
|
||||
|
|
|
@ -119,7 +119,7 @@ void InitLanguageList(QComboBox *combobox)
|
|||
// English language is internal and doesn't have own *.qm file.
|
||||
// Since Qt 5.12 country names have spaces
|
||||
QIcon const ico(u"://flags/%1.png"_s.arg(TerritoryToString(QLocale::UnitedStates)));
|
||||
const QString en_US = QStringLiteral("en_US");
|
||||
const auto en_US = QStringLiteral("en_US");
|
||||
QString const lang = QLocale(en_US).nativeLanguageName();
|
||||
combobox->addItem(ico, lang, en_US);
|
||||
}
|
||||
|
@ -265,11 +265,11 @@ void ShowInGraphicalShell(const QString &filePath)
|
|||
QProcess::startDetached(QStringLiteral("explorer"), QStringList{"/select", QDir::toNativeSeparators(filePath)});
|
||||
#else
|
||||
const int timeout = 1000; // ms
|
||||
QString const command = QStringLiteral("dbus-send --reply-timeout=%1 --session --dest=org.freedesktop.FileManager1 "
|
||||
"--type=method_call /org/freedesktop/FileManager1 "
|
||||
"org.freedesktop.FileManager1.ShowItems array:string:\"%2\" string:\"\"")
|
||||
.arg(timeout)
|
||||
.arg(QUrl::fromLocalFile(filePath).toString());
|
||||
auto const command = QStringLiteral("dbus-send --reply-timeout=%1 --session --dest=org.freedesktop.FileManager1 "
|
||||
"--type=method_call /org/freedesktop/FileManager1 "
|
||||
"org.freedesktop.FileManager1.ShowItems array:string:\"%2\" string:\"\"")
|
||||
.arg(timeout)
|
||||
.arg(QUrl::fromLocalFile(filePath).toString());
|
||||
|
||||
// Sending message through dbus will highlighting file
|
||||
QProcess dbus;
|
||||
|
|
|
@ -287,7 +287,7 @@ void DialogExportToCSV::ShowFilePreview(const QString &fileName)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto DialogExportToCSV::MakeHelpCodecsList() -> QString
|
||||
{
|
||||
QString out = QStringLiteral("\n");
|
||||
auto out = QStringLiteral("\n");
|
||||
const QList<int> list = VTextCodec::availableMibs();
|
||||
for (int i = 0; i < list.size(); ++i)
|
||||
{
|
||||
|
|
|
@ -205,7 +205,7 @@ auto VSvgFontDatabase::Italic(const QString &family, SVGFontStyle style) const -
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VSvgFontDatabase::SystemSVGFontPath() -> QString
|
||||
{
|
||||
const QString fontPath = QStringLiteral("/svgfonts");
|
||||
const auto fontPath = QStringLiteral("/svgfonts");
|
||||
#ifdef Q_OS_WIN
|
||||
return QCoreApplication::applicationDirPath() + fontPath;
|
||||
#elif defined(Q_OS_MAC)
|
||||
|
|
|
@ -418,7 +418,7 @@ auto VSvgFontEngine::ElidedText(const QString &text, SVGTextElideMode mode, int
|
|||
// Perform middle ellipsis by splitting the text and keeping the first and last characters
|
||||
qreal remainingWidth = availableWidth;
|
||||
int leftIndex = 1;
|
||||
int rightIndex = static_cast<int>(elidedText.length() - 2);
|
||||
auto rightIndex = static_cast<int>(elidedText.length() - 2);
|
||||
|
||||
while (leftIndex < rightIndex && remainingWidth > 0)
|
||||
{
|
||||
|
|
|
@ -256,7 +256,7 @@ auto VApplicationStyle::StylesheetIcon(StandardPixmap standardIcon, const QStyle
|
|||
const QWidget *widget) const -> QIcon
|
||||
{
|
||||
static QHash<QStyle::StandardPixmap, QString> const icons = StandardIconPaths();
|
||||
QString const resource = QStringLiteral("://%1/%2").arg(VTheme::ThemeStylesheet(), icons.value(standardIcon));
|
||||
auto const resource = QStringLiteral("://%1/%2").arg(VTheme::ThemeStylesheet(), icons.value(standardIcon));
|
||||
if (QFileInfo::exists(resource))
|
||||
{
|
||||
return QIcon(resource);
|
||||
|
|
|
@ -83,7 +83,7 @@ void VStylesheetStyle::SetExportColorScheme(ExportColorScheme colorScheme)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VStylesheetStyle::GetResourceName() -> QString
|
||||
{
|
||||
const QString light = QStringLiteral("light");
|
||||
const auto light = QStringLiteral("light");
|
||||
QString colorSheme;
|
||||
|
||||
if (exportColorScheme == ExportColorScheme::BackAndWhite)
|
||||
|
|
|
@ -512,8 +512,8 @@ void VTheme::ResetThemeSettings() const
|
|||
auto VTheme::GetFallbackThemeIcon(const QString &iconName, QSize iconSize) -> QIcon
|
||||
{
|
||||
const QString themePrefix = (ColorSheme() == VColorSheme::Light ? QStringLiteral("Light") : QStringLiteral("Dark"));
|
||||
const QString themeName = QStringLiteral("Eleven-%1").arg(themePrefix);
|
||||
const QString filePath = QStringLiteral(":icons/%1/%2.svg").arg(themeName, iconName);
|
||||
const auto themeName = QStringLiteral("Eleven-%1").arg(themePrefix);
|
||||
const auto filePath = QStringLiteral(":icons/%1/%2.svg").arg(themeName, iconName);
|
||||
|
||||
QIcon icon;
|
||||
icon.addFile(filePath, iconSize, QIcon::Normal, QIcon::On);
|
||||
|
|
|
@ -187,7 +187,7 @@ VAbstractApplication::~VAbstractApplication()
|
|||
*/
|
||||
auto VAbstractApplication::translationsPath(const QString &locale) -> QString
|
||||
{
|
||||
const QString trPath = QStringLiteral("/translations");
|
||||
const auto trPath = QStringLiteral("/translations");
|
||||
#ifdef Q_OS_WIN
|
||||
Q_UNUSED(locale)
|
||||
return QCoreApplication::applicationDirPath() + trPath;
|
||||
|
@ -255,7 +255,7 @@ auto VAbstractApplication::translationsPath(const QString &locale) -> QString
|
|||
auto VAbstractApplication::QtTranslationsPath(const QString &locale) -> QString
|
||||
{
|
||||
#if defined(Q_OS_LINUX)
|
||||
const QString trPath = QStringLiteral("/translations");
|
||||
const auto trPath = QStringLiteral("/translations");
|
||||
|
||||
QDir dir(QCoreApplication::applicationDirPath() + trPath);
|
||||
if (dir.exists())
|
||||
|
@ -650,7 +650,7 @@ void VAbstractApplication::InitHighDpiScaling(int argc, char *argv[])
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VAbstractApplication::LogDirPath() -> QString
|
||||
{
|
||||
const QString logs = QStringLiteral("Logs");
|
||||
const auto logs = QStringLiteral("Logs");
|
||||
|
||||
QString const logDirPath = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation);
|
||||
if (logDirPath.isEmpty())
|
||||
|
|
|
@ -506,7 +506,7 @@ void VCommonSettings::SetAutosaveTime(const int &value)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VCommonSettings::IsLocaleSelected() const -> bool
|
||||
{
|
||||
const QString fakeLocale = QStringLiteral("Fake");
|
||||
const auto fakeLocale = QStringLiteral("Fake");
|
||||
QString const locale = value(*settingConfigurationLocale, fakeLocale).toString();
|
||||
|
||||
return locale != fakeLocale;
|
||||
|
|
|
@ -203,11 +203,11 @@ void VObjEngine::drawPath(const QPainterPath &path)
|
|||
{
|
||||
skipFace = false;
|
||||
}
|
||||
int const num_verts = static_cast<int>(res->faces[offset]);
|
||||
auto const num_verts = static_cast<int>(res->faces[offset]);
|
||||
offset++;
|
||||
for (int j = 0; j < num_verts; j++)
|
||||
{
|
||||
int const p0 = static_cast<int>(res->faces[offset + j]);
|
||||
auto const p0 = static_cast<int>(res->faces[offset + j]);
|
||||
pf[j] = QPointF(points[p0].x, points[p0].y);
|
||||
}
|
||||
if (skipFace == false)
|
||||
|
|
|
@ -1678,7 +1678,7 @@ auto VPiece::SeamAllowanceMirrorLine(const VContainer *data) const -> QLineF
|
|||
return seamMirrorLine;
|
||||
}
|
||||
|
||||
QRectF rec = QRectF(0, 0, INT_MAX, INT_MAX);
|
||||
auto rec = QRectF(0, 0, INT_MAX, INT_MAX);
|
||||
rec.translate(-INT_MAX / 2.0, -INT_MAX / 2.0);
|
||||
|
||||
QLineF axis =
|
||||
|
|
|
@ -101,9 +101,9 @@ void VTranslateVars::InitVariables()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VTranslateVars::InitFunctions()
|
||||
{
|
||||
const QString oneArgument = QStringLiteral("()");
|
||||
const QString twoArguments = QStringLiteral("(;)");
|
||||
const QString threeArguments = QStringLiteral("(;;)");
|
||||
const auto oneArgument = QStringLiteral("()");
|
||||
const auto twoArguments = QStringLiteral("(;)");
|
||||
const auto threeArguments = QStringLiteral("(;;)");
|
||||
|
||||
functions.insert(degTorad_F, translate("VTranslateVars", "degTorad", "converts degrees to radian"));
|
||||
functionsDescriptions.insert(degTorad_F,
|
||||
|
|
|
@ -106,9 +106,9 @@ void AbstractTest::PieceFromJson(const QString &json, VPiece &piece, QSharedPoin
|
|||
PrepareDocument(json, saveData);
|
||||
QJsonDocument const loadDoc(QJsonDocument::fromJson(saveData));
|
||||
|
||||
const QString testCaseKey = QStringLiteral("testCase");
|
||||
const QString bdKey = QStringLiteral("bd");
|
||||
const QString pieceKey = QStringLiteral("piece");
|
||||
const auto testCaseKey = QStringLiteral("testCase");
|
||||
const auto bdKey = QStringLiteral("bd");
|
||||
const auto pieceKey = QStringLiteral("piece");
|
||||
|
||||
QJsonObject testCaseObject = loadDoc.object();
|
||||
TestRoot(testCaseObject, testCaseKey, json);
|
||||
|
@ -121,7 +121,7 @@ void AbstractTest::PieceFromJson(const QString &json, VPiece &piece, QSharedPoin
|
|||
}
|
||||
else
|
||||
{
|
||||
const QString error = QStringLiteral("Test case json object does not contain db data.");
|
||||
const auto error = QStringLiteral("Test case json object does not contain db data.");
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
|
||||
|
@ -131,7 +131,7 @@ void AbstractTest::PieceFromJson(const QString &json, VPiece &piece, QSharedPoin
|
|||
}
|
||||
else
|
||||
{
|
||||
const QString error = QStringLiteral("Test case json object does not contain piece data.");
|
||||
const auto error = QStringLiteral("Test case json object does not contain piece data.");
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ void AbstractTest::PassmarkDataFromJson(const QString &json, VPiecePassmarkData
|
|||
PrepareDocument(json, saveData);
|
||||
QJsonDocument const loadDoc(QJsonDocument::fromJson(saveData));
|
||||
|
||||
const QString dataKey = QStringLiteral("data");
|
||||
const auto dataKey = QStringLiteral("data");
|
||||
|
||||
QJsonObject dataObject = loadDoc.object();
|
||||
TestRoot(dataObject, dataKey, json);
|
||||
|
@ -166,7 +166,7 @@ void AbstractTest::PassmarkDataFromJson(const QString &json, VPiecePassmarkData
|
|||
}
|
||||
catch (const VException &e)
|
||||
{
|
||||
const QString error = QStringLiteral("Invalid json file '%1'. %2").arg(json, e.ErrorMessage());
|
||||
const auto error = QStringLiteral("Invalid json file '%1'. %2").arg(json, e.ErrorMessage());
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
|
||||
|
@ -226,8 +226,8 @@ void AbstractTest::PassmarkShapeFromJson(const QString &json, QVector<QLineF> &s
|
|||
PrepareDocument(json, saveData);
|
||||
QJsonDocument const loadDoc(QJsonDocument::fromJson(saveData));
|
||||
|
||||
const QString shapeKey = QStringLiteral("shape");
|
||||
const QString typeKey = QStringLiteral("type");
|
||||
const auto shapeKey = QStringLiteral("shape");
|
||||
const auto typeKey = QStringLiteral("type");
|
||||
|
||||
QJsonObject shapeObject = loadDoc.object();
|
||||
TestRoot(shapeObject, shapeKey, json);
|
||||
|
@ -242,8 +242,8 @@ void AbstractTest::PassmarkShapeFromJson(const QString &json, QVector<QLineF> &s
|
|||
|
||||
if (type != "QLineF"_L1)
|
||||
{
|
||||
const QString error = QStringLiteral("Invalid json file '%1'. Unexpected class '%2'.")
|
||||
.arg(json, lineObject[typeKey].toString());
|
||||
const auto error = QStringLiteral("Invalid json file '%1'. Unexpected class '%2'.")
|
||||
.arg(json, lineObject[typeKey].toString());
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
|
||||
|
@ -299,12 +299,12 @@ void AbstractTest::ComparePathsDistance(const QVector<QPointF> &ekv, const QVect
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void AbstractTest::ComparePointsDistance(const QPointF &result, const QPointF &expected, qreal testAccuracy) const
|
||||
{
|
||||
const QString msg = QStringLiteral("Actual '%1;%2', Expected '%3;%4'. Distance between points %5 mm.")
|
||||
.arg(result.x())
|
||||
.arg(result.y())
|
||||
.arg(expected.x())
|
||||
.arg(expected.y())
|
||||
.arg(UnitConvertor(QLineF(result, expected).length(), Unit::Px, Unit::Mm));
|
||||
const auto msg = QStringLiteral("Actual '%1;%2', Expected '%3;%4'. Distance between points %5 mm.")
|
||||
.arg(result.x())
|
||||
.arg(result.y())
|
||||
.arg(expected.x())
|
||||
.arg(expected.y())
|
||||
.arg(UnitConvertor(QLineF(result, expected).length(), Unit::Px, Unit::Mm));
|
||||
// Check each point. Don't use comparison float values
|
||||
QVERIFY2(VFuzzyComparePoints(result, expected, testAccuracy), qUtf8Printable(msg));
|
||||
}
|
||||
|
@ -341,7 +341,7 @@ auto AbstractTest::PuzzlePath() const -> QString
|
|||
#ifdef QBS_BUILD
|
||||
return QStringLiteral(PUZZLE_BUILDDIR);
|
||||
#else
|
||||
const QString path = QStringLiteral("/../../../app/puzzle/bin/puzzle");
|
||||
const auto path = QStringLiteral("/../../../app/puzzle/bin/puzzle");
|
||||
#ifdef Q_OS_WIN
|
||||
return QCoreApplication::applicationDirPath() + path + ".exe"_L1;
|
||||
#else
|
||||
|
@ -356,7 +356,7 @@ auto AbstractTest::ValentinaPath() const -> QString
|
|||
#ifdef QBS_BUILD
|
||||
return QStringLiteral(VALENTINA_BUILDDIR);
|
||||
#else
|
||||
const QString path = QStringLiteral("/../../../app/valentina/bin/valentina");
|
||||
const auto path = QStringLiteral("/../../../app/valentina/bin/valentina");
|
||||
#ifdef Q_OS_WIN
|
||||
return QCoreApplication::applicationDirPath() + path + ".exe"_L1;
|
||||
#else
|
||||
|
@ -371,7 +371,7 @@ auto AbstractTest::TapePath() const -> QString
|
|||
#ifdef QBS_BUILD
|
||||
return QStringLiteral(TAPE_BUILDDIR);
|
||||
#else
|
||||
const QString path = QStringLiteral("/../../../app/tape/bin/tape");
|
||||
const auto path = QStringLiteral("/../../../app/tape/bin/tape");
|
||||
#ifdef Q_OS_WIN
|
||||
return QCoreApplication::applicationDirPath() + path + ".exe"_L1;
|
||||
#else
|
||||
|
@ -522,7 +522,7 @@ void AbstractTest::PrepareDocument(const QString &json, QByteArray &data)
|
|||
QFile loadFile(json);
|
||||
if (not loadFile.open(QIODevice::ReadOnly))
|
||||
{
|
||||
const QString error = QStringLiteral("Couldn't open json file. %1").arg(loadFile.errorString());
|
||||
const auto error = QStringLiteral("Couldn't open json file. %1").arg(loadFile.errorString());
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
|
||||
|
@ -534,7 +534,7 @@ void AbstractTest::TestRoot(const QJsonObject &root, const QString &attribute, c
|
|||
{
|
||||
if (not root.contains(attribute))
|
||||
{
|
||||
const QString error = QStringLiteral("Invalid json file '%1'. File doesn't contain root object.").arg(file);
|
||||
const auto error = QStringLiteral("Invalid json file '%1'. File doesn't contain root object.").arg(file);
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
}
|
||||
|
@ -552,7 +552,7 @@ void AbstractTest::ReadStringValue(const QJsonObject &itemObject, const QString
|
|||
}
|
||||
else
|
||||
{
|
||||
const QString error = QStringLiteral("%1 is not string '%2'.").arg(attribute, attributeValue.toString());
|
||||
const auto error = QStringLiteral("%1 is not string '%2'.").arg(attribute, attributeValue.toString());
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
}
|
||||
|
@ -564,7 +564,7 @@ void AbstractTest::ReadStringValue(const QJsonObject &itemObject, const QString
|
|||
}
|
||||
else
|
||||
{
|
||||
const QString error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute);
|
||||
const auto error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute);
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
}
|
||||
|
@ -583,7 +583,7 @@ void AbstractTest::ReadBooleanValue(const QJsonObject &itemObject, const QString
|
|||
}
|
||||
else
|
||||
{
|
||||
const QString error =
|
||||
const auto error =
|
||||
QStringLiteral("%1 is not boolean value '%2'.").arg(attribute, attributeValue.toString());
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
|
@ -597,7 +597,7 @@ void AbstractTest::ReadBooleanValue(const QJsonObject &itemObject, const QString
|
|||
|
||||
if (not ok)
|
||||
{
|
||||
const QString error = QStringLiteral("Cannot convert default value '%1' to int.").arg(defaultValue);
|
||||
const auto error = QStringLiteral("Cannot convert default value '%1' to int.").arg(defaultValue);
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
|
||||
|
@ -605,7 +605,7 @@ void AbstractTest::ReadBooleanValue(const QJsonObject &itemObject, const QString
|
|||
}
|
||||
else
|
||||
{
|
||||
const QString error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute);
|
||||
const auto error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute);
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
}
|
||||
|
@ -620,7 +620,7 @@ void AbstractTest::ReadPointValue(const QJsonObject &itemObject, const QString &
|
|||
}
|
||||
else
|
||||
{
|
||||
const QString error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute);
|
||||
const auto error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute);
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
}
|
||||
|
@ -643,7 +643,7 @@ void AbstractTest::ReadSplinePointValues(const QJsonObject &itemObject, const QS
|
|||
}
|
||||
else
|
||||
{
|
||||
const QString error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute);
|
||||
const auto error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute);
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
}
|
||||
|
@ -711,7 +711,7 @@ void AbstractTest::ReadDoubleValue(const QJsonObject &itemObject, const QString
|
|||
}
|
||||
else
|
||||
{
|
||||
const QString error = QStringLiteral("%1 is not double '%2'.").arg(attribute, attributeValue.toString());
|
||||
const auto error = QStringLiteral("%1 is not double '%2'.").arg(attribute, attributeValue.toString());
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
}
|
||||
|
@ -724,13 +724,13 @@ void AbstractTest::ReadDoubleValue(const QJsonObject &itemObject, const QString
|
|||
|
||||
if (not ok)
|
||||
{
|
||||
const QString error = QStringLiteral("Cannot convert default value '%1' to double.").arg(defaultValue);
|
||||
const auto error = QStringLiteral("Cannot convert default value '%1' to double.").arg(defaultValue);
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const QString error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute);
|
||||
const auto error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute);
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
}
|
||||
|
@ -750,7 +750,7 @@ void AbstractTest::ReadDoubleValue(const QJsonObject &itemObject, const QString
|
|||
}
|
||||
else
|
||||
{
|
||||
const QString error = QStringLiteral("%1 is not double '%2'.").arg(attribute, attributeValue.toString());
|
||||
const auto error = QStringLiteral("%1 is not double '%2'.").arg(attribute, attributeValue.toString());
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
}
|
||||
|
@ -763,13 +763,13 @@ void AbstractTest::ReadDoubleValue(const QJsonObject &itemObject, const QString
|
|||
|
||||
if (not ok)
|
||||
{
|
||||
const QString error = QStringLiteral("Cannot convert default value '%1' to int.").arg(defaultValue);
|
||||
const auto error = QStringLiteral("Cannot convert default value '%1' to int.").arg(defaultValue);
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const QString error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute);
|
||||
const auto error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute);
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
}
|
||||
|
@ -789,7 +789,7 @@ void AbstractTest::ReadDoubleValue(const QJsonObject &itemObject, const QString
|
|||
}
|
||||
else
|
||||
{
|
||||
const QString error = QStringLiteral("%1 is not double '%2'.").arg(attribute, attributeValue.toString());
|
||||
const auto error = QStringLiteral("%1 is not double '%2'.").arg(attribute, attributeValue.toString());
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
}
|
||||
|
@ -802,13 +802,13 @@ void AbstractTest::ReadDoubleValue(const QJsonObject &itemObject, const QString
|
|||
|
||||
if (not ok)
|
||||
{
|
||||
const QString error = QStringLiteral("Cannot convert default value '%1' to int.").arg(defaultValue);
|
||||
const auto error = QStringLiteral("Cannot convert default value '%1' to int.").arg(defaultValue);
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const QString error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute);
|
||||
const auto error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute);
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
}
|
||||
|
@ -895,7 +895,7 @@ void AbstractTest::SplinePathFromJson(const QJsonObject &itemObject, QSharedPoin
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void AbstractTest::DBFromJson(const QJsonObject &dbObject, QSharedPointer<VContainer> &data)
|
||||
{
|
||||
const QString itemsKey = QStringLiteral("items");
|
||||
const auto itemsKey = QStringLiteral("items");
|
||||
|
||||
if (dbObject.contains(itemsKey))
|
||||
{
|
||||
|
@ -932,7 +932,7 @@ void AbstractTest::DBFromJson(const QJsonObject &dbObject, QSharedPointer<VConta
|
|||
}
|
||||
else
|
||||
{
|
||||
const QString error = QStringLiteral("DB json object does not contain items.");
|
||||
const auto error = QStringLiteral("DB json object does not contain items.");
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
}
|
||||
|
@ -951,7 +951,7 @@ void AbstractTest::MainPathFromJson(const QJsonObject &pieceObject, VPiece &piec
|
|||
|
||||
piece.GetPath().Clear();
|
||||
|
||||
const QString nodesKey = QStringLiteral("nodes");
|
||||
const auto nodesKey = QStringLiteral("nodes");
|
||||
|
||||
if (pieceObject.contains(nodesKey))
|
||||
{
|
||||
|
@ -967,7 +967,7 @@ void AbstractTest::MainPathFromJson(const QJsonObject &pieceObject, VPiece &piec
|
|||
}
|
||||
else
|
||||
{
|
||||
const QString error = QStringLiteral("Piece json object does not contain nodes.");
|
||||
const auto error = QStringLiteral("Piece json object does not contain nodes.");
|
||||
QFAIL(qUtf8Printable(error));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ template <class T> inline auto AbstractTest::VectorFromJson(const QString &json)
|
|||
PrepareDocument(json, saveData);
|
||||
QJsonDocument const loadDoc(QJsonDocument::fromJson(saveData));
|
||||
|
||||
const QString vectorKey = QStringLiteral("vector");
|
||||
const auto vectorKey = QStringLiteral("vector");
|
||||
|
||||
QJsonObject vectorObject = loadDoc.object();
|
||||
TestRoot(vectorObject, vectorKey, json);
|
||||
|
@ -182,7 +182,7 @@ template <class T> inline auto AbstractTest::VectorFromJson(const QString &json)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
template <class T> inline void AbstractTest::CheckClassType(const QJsonObject &itemObject)
|
||||
{
|
||||
const QString typeKey = QStringLiteral("type");
|
||||
const auto typeKey = QStringLiteral("type");
|
||||
|
||||
QString type;
|
||||
AbstractTest::ReadStringValue(itemObject, typeKey, type);
|
||||
|
|
|
@ -596,7 +596,7 @@ void DialogEditWrongFormula::SetDescription(const QString &name, qreal value, bo
|
|||
}
|
||||
|
||||
const QString unit = specialUnits ? degreeSymbol : ' ' + unitName;
|
||||
const QString desc = QStringLiteral("%1(%2%3) - %4").arg(name).arg(value).arg(unit, description);
|
||||
const auto desc = QStringLiteral("%1(%2%3) - %4").arg(name).arg(value).arg(unit, description);
|
||||
ui->labelDescription->setText(desc);
|
||||
}
|
||||
|
||||
|
@ -611,7 +611,7 @@ auto DialogEditWrongFormula::Eval(const FormulaData &formulaData, bool &flag) ->
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogEditWrongFormula::InitIcons()
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
ui->label->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png")));
|
||||
}
|
||||
|
|
|
@ -341,7 +341,7 @@ void DialogAlongLine::FinishCreating()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogAlongLine::InitIcons()
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
ui->toolButtonExprLength->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png")));
|
||||
ui->labelEqual->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png")));
|
||||
|
|
|
@ -565,14 +565,14 @@ void DialogArc::FinishCreating()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::InitIcons()
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
const QString fxIcon = QStringLiteral("24x24/fx.png");
|
||||
const auto fxIcon = QStringLiteral("24x24/fx.png");
|
||||
ui->toolButtonExprRadius->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprF1->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprF2->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
|
||||
const QString equalIcon = QStringLiteral("24x24/equal.png");
|
||||
const auto equalIcon = QStringLiteral("24x24/equal.png");
|
||||
ui->label_2->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
ui->label_3->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
ui->label_5->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
|
|
|
@ -569,14 +569,14 @@ void DialogArcWithLength::FinishCreating()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArcWithLength::InitIcons()
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
const QString fxIcon = QStringLiteral("24x24/fx.png");
|
||||
const auto fxIcon = QStringLiteral("24x24/fx.png");
|
||||
ui->toolButtonExprRadius->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprF1->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprLength->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
|
||||
const QString equalIcon = QStringLiteral("24x24/equal.png");
|
||||
const auto equalIcon = QStringLiteral("24x24/equal.png");
|
||||
ui->label_6->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
ui->label_9->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
ui->label_10->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
|
|
|
@ -475,7 +475,7 @@ void DialogBisector::FinishCreating()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogBisector::InitIcons()
|
||||
{
|
||||
QString const resource = QStringLiteral("icon");
|
||||
auto const resource = QStringLiteral("icon");
|
||||
|
||||
ui->toolButtonExprLength->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png")));
|
||||
ui->label_3->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png")));
|
||||
|
|
|
@ -420,7 +420,7 @@ void DialogCurveIntersectAxis::ValidateAlias()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCurveIntersectAxis::InitIcons()
|
||||
{
|
||||
QString const resource = QStringLiteral("icon");
|
||||
auto const resource = QStringLiteral("icon");
|
||||
|
||||
ui->toolButtonExprAngle->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png")));
|
||||
ui->label_3->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png")));
|
||||
|
|
|
@ -308,7 +308,7 @@ void DialogCutArc::FinishCreating()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutArc::InitIcons()
|
||||
{
|
||||
QString const resource = QStringLiteral("icon");
|
||||
auto const resource = QStringLiteral("icon");
|
||||
|
||||
ui->toolButtonExprLength->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png")));
|
||||
ui->label_4->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png")));
|
||||
|
|
|
@ -297,7 +297,7 @@ void DialogCutSpline::FinishCreating()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutSpline::InitIcons()
|
||||
{
|
||||
QString const resource = QStringLiteral("icon");
|
||||
auto const resource = QStringLiteral("icon");
|
||||
|
||||
ui->toolButtonExprLength->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png")));
|
||||
ui->label_4->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png")));
|
||||
|
|
|
@ -297,7 +297,7 @@ void DialogCutSplinePath::FinishCreating()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutSplinePath::InitIcons()
|
||||
{
|
||||
QString const resource = QStringLiteral("icon");
|
||||
auto const resource = QStringLiteral("icon");
|
||||
|
||||
ui->toolButtonExprLength->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png")));
|
||||
ui->label_4->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png")));
|
||||
|
|
|
@ -450,16 +450,16 @@ void DialogEllipticalArc::FinishCreating()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogEllipticalArc::InitIcons()
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
const QString fxIcon = QStringLiteral("24x24/fx.png");
|
||||
const auto fxIcon = QStringLiteral("24x24/fx.png");
|
||||
ui->toolButtonExprRadius1->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprRadius2->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprF1->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprF2->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprRotationAngle->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
|
||||
const QString equalIcon = QStringLiteral("24x24/equal.png");
|
||||
const auto equalIcon = QStringLiteral("24x24/equal.png");
|
||||
ui->label_1->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
ui->label_7->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
ui->label_8->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
|
|
|
@ -427,13 +427,13 @@ void DialogEndLine::FinishCreating()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogEndLine::InitIcons()
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
const QString fxIcon = QStringLiteral("24x24/fx.png");
|
||||
const auto fxIcon = QStringLiteral("24x24/fx.png");
|
||||
ui->toolButtonExprLength->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprAngle->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
|
||||
const QString equalIcon = QStringLiteral("24x24/equal.png");
|
||||
const auto equalIcon = QStringLiteral("24x24/equal.png");
|
||||
ui->label_4->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
ui->label_5->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
}
|
||||
|
|
|
@ -449,7 +449,7 @@ void DialogLineIntersectAxis::changeEvent(QEvent *event)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersectAxis::InitIcons()
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
ui->toolButtonExprAngle->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png")));
|
||||
ui->label_3->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png")));
|
||||
|
|
|
@ -911,14 +911,14 @@ void DialogMove::SetAliasValid(quint32 id, bool valid)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogMove::InitIcons()
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
const QString fxIcon = QStringLiteral("24x24/fx.png");
|
||||
const auto fxIcon = QStringLiteral("24x24/fx.png");
|
||||
ui->toolButtonExprAngle->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprLength->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprRotationAngle->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
|
||||
const QString equalIcon = QStringLiteral("24x24/equal.png");
|
||||
const auto equalIcon = QStringLiteral("24x24/equal.png");
|
||||
ui->label_2->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
ui->label_3->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
ui->label_4->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
|
|
|
@ -300,7 +300,7 @@ void DialogNormal::FinishCreating()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogNormal::InitIcons()
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
ui->toolButtonExprLength->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png")));
|
||||
ui->label_3->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png")));
|
||||
|
|
|
@ -404,7 +404,7 @@ void DialogPointFromCircleAndTangent::FinishCreating()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointFromCircleAndTangent::InitIcons()
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
ui->toolButtonExprRadius->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png")));
|
||||
ui->label_3->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png")));
|
||||
|
|
|
@ -343,7 +343,7 @@ void DialogPointOfContact::FinishCreating()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfContact::InitIcons()
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
ui->toolButtonExprRadius->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png")));
|
||||
ui->label->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png")));
|
||||
|
|
|
@ -523,13 +523,13 @@ void DialogPointOfIntersectionCircles::FinishCreating()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfIntersectionCircles::InitIcons()
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
const QString fxIcon = QStringLiteral("24x24/fx.png");
|
||||
const auto fxIcon = QStringLiteral("24x24/fx.png");
|
||||
ui->toolButtonExprCircle1Radius->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprCircle2Radius->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
|
||||
const QString equalIcon = QStringLiteral("24x24/equal.png");
|
||||
const auto equalIcon = QStringLiteral("24x24/equal.png");
|
||||
ui->label_2->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
ui->label_3->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
}
|
||||
|
|
|
@ -644,7 +644,7 @@ void DialogRotation::SetAliasValid(quint32 id, bool valid)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogRotation::InitIcons()
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
ui->toolButtonExprAngle->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png")));
|
||||
ui->label_2->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png")));
|
||||
|
|
|
@ -317,7 +317,7 @@ void DialogShoulderPoint::FinishCreating()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogShoulderPoint::InitIcons()
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
ui->toolButtonExprLength->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png")));
|
||||
ui->label_3->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png")));
|
||||
|
|
|
@ -491,15 +491,15 @@ auto DialogSpline::CurrentSpline() const -> VSpline
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSpline::InitIcons()
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
const QString fxIcon = QStringLiteral("24x24/fx.png");
|
||||
const auto fxIcon = QStringLiteral("24x24/fx.png");
|
||||
ui->toolButtonExprLength1->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprAngle1->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprLength2->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprAngle2->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
|
||||
const QString equalIcon = QStringLiteral("24x24/equal.png");
|
||||
const auto equalIcon = QStringLiteral("24x24/equal.png");
|
||||
ui->label_5->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
ui->label_8->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
ui->label_9->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
|
|
|
@ -1100,15 +1100,15 @@ void DialogSplinePath::ShowPointIssue(const QString &pName)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::InitIcons()
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
const QString fxIcon = QStringLiteral("24x24/fx.png");
|
||||
const auto fxIcon = QStringLiteral("24x24/fx.png");
|
||||
ui->toolButtonExprLength1->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprAngle1->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprLength2->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprAngle2->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
|
||||
const QString equalIcon = QStringLiteral("24x24/equal.png");
|
||||
const auto equalIcon = QStringLiteral("24x24/equal.png");
|
||||
ui->label_8->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
ui->label_9->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
ui->label_10->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
|
|
|
@ -2245,9 +2245,9 @@ void DialogPiecePath::InitPassmarkAngleType(const VPieceNode &node)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPiecePath::InitIcons()
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
const QString fxIcon = QStringLiteral("24x24/fx.png");
|
||||
const auto fxIcon = QStringLiteral("24x24/fx.png");
|
||||
ui->toolButtonExprWidth->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprBefore->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprAfter->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
|
@ -2256,7 +2256,7 @@ void DialogPiecePath::InitIcons()
|
|||
ui->toolButtonExprAngle->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprVisible->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
|
||||
const QString equalIcon = QStringLiteral("24x24/equal.png");
|
||||
const auto equalIcon = QStringLiteral("24x24/equal.png");
|
||||
ui->label_2->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
ui->label_6->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
ui->label_10->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
|
|
|
@ -556,15 +556,15 @@ void DialogPlaceLabel::CheckPoint()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPlaceLabel::InitIcons()
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
const QString fxIcon = QStringLiteral("24x24/fx.png");
|
||||
const auto fxIcon = QStringLiteral("24x24/fx.png");
|
||||
ui->toolButtonExprWidth->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprHeight->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprAngle->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
ui->toolButtonExprVisible->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
|
||||
const QString equalIcon = QStringLiteral("24x24/equal.png");
|
||||
const auto equalIcon = QStringLiteral("24x24/equal.png");
|
||||
ui->label_4->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
ui->label_5->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
ui->label_6->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
|
|
|
@ -5264,9 +5264,9 @@ void DialogSeamAllowance::InitPassmarkAngleType(const VPieceNode &node)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSeamAllowance::InitIcons()
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
const QString fxIcon = QStringLiteral("24x24/fx.png");
|
||||
const auto fxIcon = QStringLiteral("24x24/fx.png");
|
||||
uiTabGrainline->pushButtonRot->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
uiTabGrainline->pushButtonLen->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
uiTabLabels->pushButtonDLWidth->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
|
@ -5282,7 +5282,7 @@ void DialogSeamAllowance::InitIcons()
|
|||
uiTabPaths->toolButtonExprBefore->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
uiTabPaths->toolButtonExprAfter->setIcon(VTheme::GetIconResource(resource, fxIcon));
|
||||
|
||||
const QString equalIcon = QStringLiteral("24x24/equal.png");
|
||||
const auto equalIcon = QStringLiteral("24x24/equal.png");
|
||||
uiTabGrainline->labelEqual->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
uiTabGrainline->labelEqual_2->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
uiTabLabels->labelEqual_3->setPixmap(VTheme::GetPixmapResource(resource, equalIcon));
|
||||
|
|
|
@ -482,16 +482,16 @@ void VBackgroundImageControls::InitPixmaps()
|
|||
|
||||
auto InitPixmap = [this](BIHandleCornerType type, const QString &imageName)
|
||||
{
|
||||
const QString resource = QStringLiteral("icon");
|
||||
const auto resource = QStringLiteral("icon");
|
||||
|
||||
const QString fileName = QStringLiteral("32x32/%1.png").arg(imageName);
|
||||
const auto fileName = QStringLiteral("32x32/%1.png").arg(imageName);
|
||||
QPixmap const handlePixmap = VTheme::GetPixmapResource(resource, fileName);
|
||||
|
||||
if (QGuiApplication::primaryScreen()->devicePixelRatio() >= 2)
|
||||
{
|
||||
const QString fileName2x = QStringLiteral("32x32/%1@2x.png").arg(imageName);
|
||||
const QString fileName2xHover = QStringLiteral("32x32/%1-hover@2x.png").arg(imageName);
|
||||
const QString fileName2xDisabled = QStringLiteral("32x32/%1-disabled@2x.png").arg(imageName);
|
||||
const auto fileName2x = QStringLiteral("32x32/%1@2x.png").arg(imageName);
|
||||
const auto fileName2xHover = QStringLiteral("32x32/%1-hover@2x.png").arg(imageName);
|
||||
const auto fileName2xDisabled = QStringLiteral("32x32/%1-disabled@2x.png").arg(imageName);
|
||||
|
||||
m_handlePixmaps.insert(type, VTheme::GetPixmapResource(resource, fileName2x));
|
||||
m_handleHoverPixmaps.insert(type, VTheme::GetPixmapResource(resource, fileName2xHover));
|
||||
|
@ -499,8 +499,8 @@ void VBackgroundImageControls::InitPixmaps()
|
|||
}
|
||||
else
|
||||
{
|
||||
const QString fileNameHover = QStringLiteral("32x32/%1-hover.png").arg(imageName);
|
||||
const QString fileNameDisabled = QStringLiteral("32x32/%1-disabled.png").arg(imageName);
|
||||
const auto fileNameHover = QStringLiteral("32x32/%1-hover.png").arg(imageName);
|
||||
const auto fileNameDisabled = QStringLiteral("32x32/%1-disabled.png").arg(imageName);
|
||||
|
||||
m_handlePixmaps.insert(type, handlePixmap);
|
||||
m_handleHoverPixmaps.insert(type, VTheme::GetPixmapResource(resource, fileNameHover));
|
||||
|
|
|
@ -528,7 +528,7 @@ void FancyTabBar::PaintTab(QPainter *painter, int tabIndex) const
|
|||
if (!selected && enabled)
|
||||
{
|
||||
painter->save();
|
||||
int const fader = static_cast<int>(m_attachedTabs[tabIndex]->fader());
|
||||
auto const fader = static_cast<int>(m_attachedTabs[tabIndex]->fader());
|
||||
QLinearGradient grad(GetCorner(rect, OutsideBeginning), GetCorner(rect, InsideBeginning));
|
||||
|
||||
grad.setColorAt(0, Qt::transparent);
|
||||
|
|
|
@ -65,7 +65,7 @@ auto SceneScale(QGraphicsScene *scene) -> qreal
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto PointRect(qreal radius) -> QRectF
|
||||
{
|
||||
QRectF rec = QRectF(0, 0, radius * 2, radius * 2);
|
||||
auto rec = QRectF(0, 0, radius * 2, radius * 2);
|
||||
rec.translate(-rec.center().x(), -rec.center().y());
|
||||
return rec;
|
||||
}
|
||||
|
|
|
@ -243,7 +243,7 @@ void VAbstractMainWindow::UpdateRecentFileActions()
|
|||
const QString &recent = recentFiles.at(i);
|
||||
if (not recent.isEmpty())
|
||||
{
|
||||
const QString text = QStringLiteral("&%1. %2").arg(i + 1).arg(recentFiles.at(i));
|
||||
const auto text = QStringLiteral("&%1. %2").arg(i + 1).arg(recentFiles.at(i));
|
||||
m_recentFileActs.at(i)->setText(text);
|
||||
m_recentFileActs.at(i)->setData(files.at(i));
|
||||
m_recentFileActs.at(i)->setVisible(true);
|
||||
|
|
|
@ -31,10 +31,10 @@
|
|||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VComboBoxDelegate::VComboBoxDelegate(const QStringList &items, QObject *parent)
|
||||
: QItemDelegate(parent),
|
||||
m_items(items)
|
||||
: QItemDelegate(parent),
|
||||
m_items(items)
|
||||
{
|
||||
const QString dashDash = QStringLiteral("--");
|
||||
const auto dashDash = QStringLiteral("--");
|
||||
m_items.prepend(dashDash + tr("Select material") + dashDash);
|
||||
}
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ void VLineEdit::focusInEvent(QFocusEvent *e)
|
|||
void VLineEdit::focusOutEvent(QFocusEvent *e)
|
||||
{
|
||||
const int start = selectionStart();
|
||||
const int selectionLength = static_cast<int>(selectedText().length());
|
||||
const auto selectionLength = static_cast<int>(selectedText().length());
|
||||
const bool wasTextSelected = hasSelectedText();
|
||||
|
||||
QLineEdit::focusOutEvent(e);
|
||||
|
|
|
@ -331,7 +331,7 @@ void GraphicsViewZoom::FictiveSceneRect(QGraphicsScene *sc, QGraphicsView *view)
|
|||
// to receive the currently visible area, map the widgets bounds to the scene
|
||||
const QPointF a = view->mapToScene(0, 0);
|
||||
const QPointF b = view->mapToScene(view->viewport()->width(), view->viewport()->height());
|
||||
QRectF viewRect = QRectF(a, b);
|
||||
auto viewRect = QRectF(a, b);
|
||||
|
||||
// Scale view
|
||||
QLineF topLeftRay(viewRect.center(), viewRect.topLeft());
|
||||
|
|
|
@ -214,7 +214,7 @@ void TST_ValentinaCommandLine::TestOpenCollection_data() const
|
|||
|
||||
const QString tmp = QCoreApplication::applicationDirPath() + QDir::separator() + *tmpTestCollectionFolder;
|
||||
const QString testGOST = u"--test;;-m;;%1"_s.arg(tmp + QDir::separator() + "GOST_man_ru.vst"_L1);
|
||||
const QString keyTest = QStringLiteral("--test");
|
||||
const auto keyTest = QStringLiteral("--test");
|
||||
|
||||
QTest::newRow("bra") << "bra.val" << keyTest << V_EX_OK;
|
||||
#ifdef Q_OS_WIN
|
||||
|
|
|
@ -191,11 +191,11 @@ void TST_AbstractRegExp::CallTestForValidCharacters()
|
|||
const vsizetype pos = FindFirstNotOf(translated, validNameChars);
|
||||
if (pos != -1)
|
||||
{
|
||||
const QString message = QStringLiteral("Translated string '%1' contains invalid character '%2' at "
|
||||
"position '%3'.")
|
||||
.arg(translated)
|
||||
.arg(translated.at(pos))
|
||||
.arg(pos);
|
||||
const auto message = QStringLiteral("Translated string '%1' contains invalid character '%2' at "
|
||||
"position '%3'.")
|
||||
.arg(translated)
|
||||
.arg(translated.at(pos))
|
||||
.arg(pos);
|
||||
QFAIL(qUtf8Printable(message));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -231,7 +231,7 @@ void TST_BuitInRegExp::TestCheckInternalVaribleRegExp()
|
|||
QFETCH(QString, var);
|
||||
QFETCH(QString, originalName);
|
||||
|
||||
static const QString regex = QStringLiteral("(.){1,}_(.){1,}$");
|
||||
static const auto regex = QStringLiteral("(.){1,}_(.){1,}$");
|
||||
|
||||
const QString sourceRegex = '^'_L1 + var + regex;
|
||||
const QRegularExpression sourceRe(sourceRegex);
|
||||
|
@ -243,14 +243,14 @@ void TST_BuitInRegExp::TestCheckInternalVaribleRegExp()
|
|||
{
|
||||
if (sourceRe.match(originalName).hasMatch() || translationRe.match(originalName).hasMatch())
|
||||
{
|
||||
const QString message = QStringLiteral("Invalid original string '%1'").arg(originalName);
|
||||
const auto message = QStringLiteral("Invalid original string '%1'").arg(originalName);
|
||||
QFAIL(qUtf8Printable(message));
|
||||
}
|
||||
|
||||
const QString translatedMessage = m_trMs->VarToUser(originalName);
|
||||
if (sourceRe.match(translatedMessage).hasMatch() || translationRe.match(translatedMessage).hasMatch())
|
||||
{
|
||||
const QString message = QStringLiteral("Invalid translation string '%1'").arg(translatedMessage);
|
||||
const auto message = QStringLiteral("Invalid translation string '%1'").arg(translatedMessage);
|
||||
QFAIL(qUtf8Printable(message));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,7 +133,7 @@ void TST_QmuParserErrorMsg::TestEErrorCodes()
|
|||
|
||||
const QString translated = (*msg)[code];
|
||||
// cppcheck-suppress unreadVariable
|
||||
const QString message = QStringLiteral("String: '%1'.").arg(translated);
|
||||
const auto message = QStringLiteral("String: '%1'.").arg(translated);
|
||||
|
||||
QVERIFY2((translated.indexOf("$TOK$"_L1) != -1) == tok, qUtf8Printable(message));
|
||||
QVERIFY2((translated.indexOf("$POS$"_L1) != -1) == pos, qUtf8Printable(message));
|
||||
|
|
|
@ -50,7 +50,7 @@ void TST_TSLocaleTranslation::CheckPlaceMarkerExist_data()
|
|||
QTest::addColumn<QString>("translation");
|
||||
QTest::addColumn<Qt::LayoutDirection>("direction");
|
||||
|
||||
const QString filename = QStringLiteral("valentina_%1.ts").arg(m_locale);
|
||||
const auto filename = QStringLiteral("valentina_%1.ts").arg(m_locale);
|
||||
QLocale const locale(m_locale);
|
||||
|
||||
const QDomNodeList messages = LoadTSFile(filename);
|
||||
|
@ -91,7 +91,7 @@ void TST_TSLocaleTranslation::CheckPlaceMarkerExist_data()
|
|||
}
|
||||
else
|
||||
{
|
||||
const QString caseName = QStringLiteral("File '%2'. Message %1 is null.").arg(i).arg(filename);
|
||||
const auto caseName = QStringLiteral("File '%2'. Message %1 is null.").arg(i).arg(filename);
|
||||
QFAIL(qUtf8Printable(caseName));
|
||||
}
|
||||
}
|
||||
|
@ -187,12 +187,12 @@ void TST_TSLocaleTranslation::TestPunctuation_data()
|
|||
continue;
|
||||
}
|
||||
|
||||
const QString caseName = QStringLiteral("File '%1'.").arg(filename);
|
||||
const auto caseName = QStringLiteral("File '%1'.").arg(filename);
|
||||
QTest::newRow(qUtf8Printable(caseName)) << m_locale << source << translation;
|
||||
}
|
||||
else
|
||||
{
|
||||
const QString caseName = QStringLiteral("File '%2'. Message %1 is null.").arg(i).arg(filename);
|
||||
const auto caseName = QStringLiteral("File '%2'. Message %1 is null.").arg(i).arg(filename);
|
||||
QFAIL(qUtf8Printable(caseName));
|
||||
}
|
||||
}
|
||||
|
@ -296,12 +296,12 @@ void TST_TSLocaleTranslation::TestHTMLTags_data()
|
|||
continue;
|
||||
}
|
||||
|
||||
const QString caseName = QStringLiteral("File '%1'.").arg(filename);
|
||||
const auto caseName = QStringLiteral("File '%1'.").arg(filename);
|
||||
QTest::newRow(qUtf8Printable(caseName)) << source << translation;
|
||||
}
|
||||
else
|
||||
{
|
||||
const QString caseName = QStringLiteral("File '%2'. Message %1 is null.").arg(i).arg(filename);
|
||||
const auto caseName = QStringLiteral("File '%2'. Message %1 is null.").arg(i).arg(filename);
|
||||
QFAIL(qUtf8Printable(caseName));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -151,7 +151,7 @@ void TST_TSTranslation::PrepareOriginalStrings()
|
|||
QTest::addColumn<QString>("source");
|
||||
QTest::addColumn<QDomElement>("message");
|
||||
|
||||
const QString fileName = QStringLiteral("valentina.ts");
|
||||
const auto fileName = QStringLiteral("valentina.ts");
|
||||
const QDomNodeList messages = LoadTSFile(fileName);
|
||||
if (messages.isEmpty())
|
||||
{
|
||||
|
@ -169,13 +169,12 @@ void TST_TSTranslation::PrepareOriginalStrings()
|
|||
continue;
|
||||
}
|
||||
|
||||
const QString tag =
|
||||
QStringLiteral("File '%1'. Check modification source message '%2'.").arg(fileName, source);
|
||||
const auto tag = QStringLiteral("File '%1'. Check modification source message '%2'.").arg(fileName, source);
|
||||
QTest::newRow(qUtf8Printable(tag)) << source << message;
|
||||
}
|
||||
else
|
||||
{
|
||||
const QString errorMessage = QStringLiteral("Message %1 is null.").arg(i);
|
||||
const auto errorMessage = QStringLiteral("Message %1 is null.").arg(i);
|
||||
QFAIL(qUtf8Printable(errorMessage));
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user