Refactoring.
Code style.
This commit is contained in:
parent
edd15cbbc0
commit
53dc4135e3
|
@ -28,15 +28,17 @@
|
||||||
#ifndef VPSHEET_H
|
#ifndef VPSHEET_H
|
||||||
#define VPSHEET_H
|
#define VPSHEET_H
|
||||||
|
|
||||||
#include <QSizeF>
|
|
||||||
#include <QMarginsF>
|
|
||||||
#include <QList>
|
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
|
#include <QList>
|
||||||
|
#include <QMarginsF>
|
||||||
|
#include <QPageLayout>
|
||||||
|
#include <QSizeF>
|
||||||
#include <QUuid>
|
#include <QUuid>
|
||||||
|
|
||||||
#include "def.h"
|
|
||||||
#include "layoutdef.h"
|
#include "layoutdef.h"
|
||||||
|
|
||||||
|
#include "../vmisc/def.h"
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||||
#include "../vmisc/defglobal.h"
|
#include "../vmisc/defglobal.h"
|
||||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
#endif // QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||||
|
@ -50,6 +52,7 @@ class VPGraphicsPiece;
|
||||||
class VPGraphicsTileGrid;
|
class VPGraphicsTileGrid;
|
||||||
class VPGraphicsSheet;
|
class VPGraphicsSheet;
|
||||||
class VLayoutPiece;
|
class VLayoutPiece;
|
||||||
|
class QGraphicsItem;
|
||||||
|
|
||||||
class VPSheetSceneData
|
class VPSheetSceneData
|
||||||
{
|
{
|
||||||
|
@ -136,6 +139,7 @@ private:
|
||||||
class VPSheet : public QObject
|
class VPSheet : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT // NOLINT
|
Q_OBJECT // NOLINT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit VPSheet(const VPLayoutPtr &layout, QObject *parent = nullptr);
|
explicit VPSheet(const VPLayoutPtr &layout, QObject *parent = nullptr);
|
||||||
|
|
||||||
|
@ -314,7 +318,6 @@ private:
|
||||||
VPSheetSceneData *m_sceneData{nullptr};
|
VPSheetSceneData *m_sceneData{nullptr};
|
||||||
|
|
||||||
auto SheetUnits() const -> Unit;
|
auto SheetUnits() const -> Unit;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(VPSheetPtr) // NOLINT
|
Q_DECLARE_METATYPE(VPSheetPtr) // NOLINT
|
||||||
|
|
|
@ -27,10 +27,10 @@
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
#include "tapepreferencesconfigurationpage.h"
|
#include "tapepreferencesconfigurationpage.h"
|
||||||
#include "ui_tapepreferencesconfigurationpage.h"
|
|
||||||
#include "../../mapplication.h"
|
#include "../../mapplication.h"
|
||||||
#include "../../vtapesettings.h"
|
#include "../../vtapesettings.h"
|
||||||
#include "../vpatterndb/pmsystems.h"
|
#include "../vpatterndb/pmsystems.h"
|
||||||
|
#include "ui_tapepreferencesconfigurationpage.h"
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
|
||||||
#include "../vmisc/backport/qoverload.h"
|
#include "../vmisc/backport/qoverload.h"
|
||||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
|
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
|
||||||
|
@ -47,10 +47,10 @@ TapePreferencesConfigurationPage::TapePreferencesConfigurationPage(QWidget *pare
|
||||||
RetranslateUi();
|
RetranslateUi();
|
||||||
|
|
||||||
InitLanguages(ui->langCombo);
|
InitLanguages(ui->langCombo);
|
||||||
connect(ui->langCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this]()
|
connect(ui->langCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
|
||||||
{
|
[this]() { m_langChanged = true; });
|
||||||
m_langChanged = true;
|
|
||||||
});
|
VTapeSettings *settings = MApplication::VApp()->TapeSettings();
|
||||||
|
|
||||||
//-------------------- Decimal separator setup
|
//-------------------- Decimal separator setup
|
||||||
ui->osOptionCheck->setChecked(MApplication::VApp()->TapeSettings()->GetOsSeparator());
|
ui->osOptionCheck->setChecked(MApplication::VApp()->TapeSettings()->GetOsSeparator());
|
||||||
|
@ -63,11 +63,12 @@ TapePreferencesConfigurationPage::TapePreferencesConfigurationPage(QWidget *pare
|
||||||
|
|
||||||
//---------------------- Pattern making system
|
//---------------------- Pattern making system
|
||||||
ui->systemBookValueLabel->setFixedHeight(4 * QFontMetrics(ui->systemBookValueLabel->font()).lineSpacing());
|
ui->systemBookValueLabel->setFixedHeight(4 * QFontMetrics(ui->systemBookValueLabel->font()).lineSpacing());
|
||||||
connect(ui->systemCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this]()
|
connect(ui->systemCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
|
||||||
|
[this]()
|
||||||
{
|
{
|
||||||
m_systemChanged = true;
|
m_systemChanged = true;
|
||||||
QString text = VAbstractApplication::VApp()->TrVars()
|
QString text =
|
||||||
->PMSystemAuthor(ui->systemCombo->currentData().toString());
|
VAbstractApplication::VApp()->TrVars()->PMSystemAuthor(ui->systemCombo->currentData().toString());
|
||||||
ui->systemAuthorValueLabel->setText(text);
|
ui->systemAuthorValueLabel->setText(text);
|
||||||
ui->systemAuthorValueLabel->setToolTip(text);
|
ui->systemAuthorValueLabel->setToolTip(text);
|
||||||
|
|
||||||
|
@ -83,10 +84,8 @@ TapePreferencesConfigurationPage::TapePreferencesConfigurationPage(QWidget *pare
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------- Measurements Editing
|
//----------------------------- Measurements Editing
|
||||||
connect(ui->resetWarningsButton, &QPushButton::released, this, []()
|
connect(ui->resetWarningsButton, &QPushButton::released, this,
|
||||||
{
|
[]() { MApplication::VApp()->TapeSettings()->SetConfirmFormatRewriting(true); });
|
||||||
MApplication::VApp()->TapeSettings()->SetConfirmFormatRewriting(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
//----------------------- Toolbar
|
//----------------------- Toolbar
|
||||||
ui->toolBarStyleCheck->setChecked(MApplication::VApp()->TapeSettings()->GetToolBarStyle());
|
ui->toolBarStyleCheck->setChecked(MApplication::VApp()->TapeSettings()->GetToolBarStyle());
|
||||||
|
|
|
@ -27,25 +27,25 @@
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
#include "mainwindowsnogui.h"
|
#include "mainwindowsnogui.h"
|
||||||
#include "core/vapplication.h"
|
#include "../ifc/xml/vvitconverter.h"
|
||||||
#include "../vpatterndb/vcontainer.h"
|
#include "../ifc/xml/vvstconverter.h"
|
||||||
#include "dialogs/dialoglayoutsettings.h"
|
#include "../vdxf/libdxfrw/drw_base.h"
|
||||||
#include "../vwidgets/vmaingraphicsscene.h"
|
#include "../vformat/vmeasurements.h"
|
||||||
|
#include "../vlayout/vlayoutexporter.h"
|
||||||
|
#include "../vlayout/vlayoutgenerator.h"
|
||||||
|
#include "../vmisc/compatibility.h"
|
||||||
#include "../vmisc/dialogs/dialogexporttocsv.h"
|
#include "../vmisc/dialogs/dialogexporttocsv.h"
|
||||||
#include "../vmisc/qxtcsvmodel.h"
|
#include "../vmisc/qxtcsvmodel.h"
|
||||||
#include "../vmisc/compatibility.h"
|
|
||||||
#include "../vmisc/vsysexits.h"
|
#include "../vmisc/vsysexits.h"
|
||||||
#include "../vformat/vmeasurements.h"
|
|
||||||
#include "../vlayout/vlayoutgenerator.h"
|
|
||||||
#include "dialogs/dialoglayoutprogress.h"
|
|
||||||
#include "dialogs/dialogsavelayout.h"
|
|
||||||
#include "../vlayout/vlayoutexporter.h"
|
|
||||||
#include "../vpatterndb/calculator.h"
|
|
||||||
#include "../vtools/tools/vabstracttool.h"
|
|
||||||
#include "../ifc/xml/vvstconverter.h"
|
|
||||||
#include "../ifc/xml/vvitconverter.h"
|
|
||||||
#include "../vmisc/vvalentinasettings.h"
|
#include "../vmisc/vvalentinasettings.h"
|
||||||
#include "../vdxf/libdxfrw/drw_base.h"
|
#include "../vpatterndb/calculator.h"
|
||||||
|
#include "../vpatterndb/vcontainer.h"
|
||||||
|
#include "../vtools/tools/vabstracttool.h"
|
||||||
|
#include "../vwidgets/vmaingraphicsscene.h"
|
||||||
|
#include "core/vapplication.h"
|
||||||
|
#include "dialogs/dialoglayoutprogress.h"
|
||||||
|
#include "dialogs/dialoglayoutsettings.h"
|
||||||
|
#include "dialogs/dialogsavelayout.h"
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
#include "../vmisc/vtextcodec.h"
|
#include "../vmisc/vtextcodec.h"
|
||||||
|
@ -53,21 +53,21 @@
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QGraphicsScene>
|
#include <QGraphicsScene>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QProcess>
|
|
||||||
#include <QToolButton>
|
|
||||||
#include <QtSvg>
|
|
||||||
#include <QPrintPreviewDialog>
|
|
||||||
#include <QPrintDialog>
|
|
||||||
#include <QPrinterInfo>
|
|
||||||
#include <QtConcurrent>
|
|
||||||
#include <functional>
|
|
||||||
#include <QPageSize>
|
#include <QPageSize>
|
||||||
#include <QDebug>
|
#include <QPrintDialog>
|
||||||
|
#include <QPrintPreviewDialog>
|
||||||
|
#include <QPrinterInfo>
|
||||||
|
#include <QProcess>
|
||||||
#include <QProgressDialog>
|
#include <QProgressDialog>
|
||||||
|
#include <QToolButton>
|
||||||
|
#include <QtConcurrent>
|
||||||
|
#include <QtSvg>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||||
#include <QWinTaskbarButton>
|
#include <QWinTaskbarButton>
|
||||||
|
@ -123,7 +123,7 @@ void InsertGlobalContours(const QList<QGraphicsScene *> &scenes, const QList<QGr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
} // namespace
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
MainWindowsNoGUI::MainWindowsNoGUI(QWidget *parent)
|
MainWindowsNoGUI::MainWindowsNoGUI(QWidget *parent)
|
||||||
|
@ -131,7 +131,8 @@ MainWindowsNoGUI::MainWindowsNoGUI(QWidget *parent)
|
||||||
pattern(new VContainer(VAbstractApplication::VApp()->TrVars(), VAbstractValApplication::VApp()->patternUnitsP(),
|
pattern(new VContainer(VAbstractApplication::VApp()->TrVars(), VAbstractValApplication::VApp()->patternUnitsP(),
|
||||||
valentinaNamespace))
|
valentinaNamespace))
|
||||||
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||||
,m_taskbarButton(new QWinTaskbarButton(this))
|
,
|
||||||
|
m_taskbarButton(new QWinTaskbarButton(this))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
InitTempLayoutScene();
|
InitTempLayoutScene();
|
||||||
|
@ -200,10 +201,8 @@ auto MainWindowsNoGUI::GenerateLayout(VLayoutGenerator &lGenerator) -> bool
|
||||||
m_taskbarProgress->setValue(0);
|
m_taskbarProgress->setValue(0);
|
||||||
m_taskbarProgress->setMaximum(lGenerator.GetNestingTime() * 60);
|
m_taskbarProgress->setMaximum(lGenerator.GetNestingTime() * 60);
|
||||||
progressTimer = new QTimer(this);
|
progressTimer = new QTimer(this);
|
||||||
connect(progressTimer, &QTimer::timeout, this, [this, timer]()
|
connect(progressTimer, &QTimer::timeout, this,
|
||||||
{
|
[this, timer]() { m_taskbarProgress->setValue(static_cast<int>(timer.elapsed() / 1000)); });
|
||||||
m_taskbarProgress->setValue(static_cast<int>(timer.elapsed()/1000));
|
|
||||||
});
|
|
||||||
progressTimer->start(1000);
|
progressTimer->start(1000);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -219,7 +218,8 @@ auto MainWindowsNoGUI::GenerateLayout(VLayoutGenerator &lGenerator) -> bool
|
||||||
{
|
{
|
||||||
// Because the progress bar dialog will not terminate nesting we must create separate timer for this
|
// Because the progress bar dialog will not terminate nesting we must create separate timer for this
|
||||||
auto *progressTimer = new QTimer(this);
|
auto *progressTimer = new QTimer(this);
|
||||||
connect(progressTimer, &QTimer::timeout, this, [timer, &lGenerator, progressTimer]()
|
connect(progressTimer, &QTimer::timeout, this,
|
||||||
|
[timer, &lGenerator, progressTimer]()
|
||||||
{
|
{
|
||||||
const int timeout = static_cast<int>(lGenerator.GetNestingTimeMSecs() - timer.elapsed());
|
const int timeout = static_cast<int>(lGenerator.GetNestingTimeMSecs() - timer.elapsed());
|
||||||
|
|
||||||
|
@ -320,8 +320,8 @@ auto MainWindowsNoGUI::GenerateLayout(VLayoutGenerator &lGenerator) -> bool
|
||||||
}
|
}
|
||||||
m_layoutSettings->SetIgnorePrinterMargins(not lGenerator.IsUsePrinterFields());
|
m_layoutSettings->SetIgnorePrinterMargins(not lGenerator.IsUsePrinterFields());
|
||||||
m_layoutSettings->SetLayoutMargins(lGenerator.GetPrinterFields());
|
m_layoutSettings->SetLayoutMargins(lGenerator.GetPrinterFields());
|
||||||
m_layoutSettings->SetLayoutPaperSize(QSizeF(lGenerator.GetPaperWidth(),
|
m_layoutSettings->SetLayoutPaperSize(
|
||||||
lGenerator.GetPaperHeight()));
|
QSizeF(lGenerator.GetPaperWidth(), lGenerator.GetPaperHeight()));
|
||||||
m_layoutSettings->SetAutoCropLength(lGenerator.GetAutoCropLength());
|
m_layoutSettings->SetAutoCropLength(lGenerator.GetAutoCropLength());
|
||||||
m_layoutSettings->SetAutoCropWidth(lGenerator.GetAutoCropWidth());
|
m_layoutSettings->SetAutoCropWidth(lGenerator.GetAutoCropWidth());
|
||||||
m_layoutSettings->SetUnitePages(lGenerator.IsUnitePages());
|
m_layoutSettings->SetUnitePages(lGenerator.IsUnitePages());
|
||||||
|
@ -381,10 +381,10 @@ auto MainWindowsNoGUI::GenerateLayout(VLayoutGenerator &lGenerator) -> bool
|
||||||
|
|
||||||
nestingState = lGenerator.State();
|
nestingState = lGenerator.State();
|
||||||
|
|
||||||
if (nestingState == LayoutErrors::PrepareLayoutError || nestingState == LayoutErrors::ProcessStoped
|
if (nestingState == LayoutErrors::PrepareLayoutError || nestingState == LayoutErrors::ProcessStoped ||
|
||||||
|| nestingState == LayoutErrors::TerminatedByException
|
nestingState == LayoutErrors::TerminatedByException ||
|
||||||
|| (nestingState == LayoutErrors::NoError && not qFuzzyIsNull(lGenerator.GetEfficiencyCoefficient())
|
(nestingState == LayoutErrors::NoError && not qFuzzyIsNull(lGenerator.GetEfficiencyCoefficient()) &&
|
||||||
&& efficiency >= lGenerator.GetEfficiencyCoefficient()))
|
efficiency >= lGenerator.GetEfficiencyCoefficient()))
|
||||||
{
|
{
|
||||||
if (not lGenerator.IsPreferOneSheetSolution() || lGenerator.PapersCount() == 1)
|
if (not lGenerator.IsPreferOneSheetSolution() || lGenerator.PapersCount() == 1)
|
||||||
{
|
{
|
||||||
|
@ -494,10 +494,11 @@ void MainWindowsNoGUI::ExportData(const QVector<VLayoutPiece> &listDetails)
|
||||||
for (int i = 0; i < detailsOnLayout.size(); ++i)
|
for (int i = 0; i < detailsOnLayout.size(); ++i)
|
||||||
{
|
{
|
||||||
const QString name = m_dialogSaveLayout->Path() + '/' + m_dialogSaveLayout->FileName() +
|
const QString name = m_dialogSaveLayout->Path() + '/' + m_dialogSaveLayout->FileName() +
|
||||||
QString::number(i+1) + VLayoutExporter::ExportFormatSuffix(m_dialogSaveLayout->Format());
|
QString::number(i + 1) +
|
||||||
|
VLayoutExporter::ExportFormatSuffix(m_dialogSaveLayout->Format());
|
||||||
|
|
||||||
QGraphicsRectItem *paper = qgraphicsitem_cast<QGraphicsRectItem *>(
|
QGraphicsRectItem *paper =
|
||||||
m_layoutSettings->LayoutPapers().at(i));
|
qgraphicsitem_cast<QGraphicsRectItem *>(m_layoutSettings->LayoutPapers().at(i));
|
||||||
SCASSERT(paper != nullptr)
|
SCASSERT(paper != nullptr)
|
||||||
|
|
||||||
ExportApparelLayout(detailsOnLayout.at(i), name, paper->rect().size().toSize());
|
ExportApparelLayout(detailsOnLayout.at(i), name, paper->rect().size().toSize());
|
||||||
|
@ -524,8 +525,8 @@ void MainWindowsNoGUI::ExportData(const QVector<VLayoutPiece> &listDetails)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void MainWindowsNoGUI::ExportFlatLayout(const QList<QGraphicsScene *> &scenes,
|
void MainWindowsNoGUI::ExportFlatLayout(const QList<QGraphicsScene *> &scenes, const QList<QGraphicsItem *> &papers,
|
||||||
const QList<QGraphicsItem *> &papers, const QList<QGraphicsItem *> &shadows,
|
const QList<QGraphicsItem *> &shadows,
|
||||||
const QList<QList<QGraphicsItem *>> &details, bool ignorePrinterFields,
|
const QList<QList<QGraphicsItem *>> &details, bool ignorePrinterFields,
|
||||||
const QMarginsF &margins)
|
const QMarginsF &margins)
|
||||||
{
|
{
|
||||||
|
@ -751,8 +752,8 @@ void MainWindowsNoGUI::ExportDetailsAsApparelLayout(QVector<VLayoutPiece> listDe
|
||||||
listDetails[i].SetMatrix(moveMatrix);
|
listDetails[i].SetMatrix(moveMatrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString name = m_dialogSaveLayout->Path() + '/' + m_dialogSaveLayout->FileName() +
|
const QString name = m_dialogSaveLayout->Path() + '/' + m_dialogSaveLayout->FileName() + QString::number(1) +
|
||||||
QString::number(1) + VLayoutExporter::ExportFormatSuffix(m_dialogSaveLayout->Format());
|
VLayoutExporter::ExportFormatSuffix(m_dialogSaveLayout->Format());
|
||||||
|
|
||||||
ExportApparelLayout(listDetails, name, rect.size());
|
ExportApparelLayout(listDetails, name, rect.size());
|
||||||
}
|
}
|
||||||
|
@ -782,8 +783,8 @@ void MainWindowsNoGUI::PrintPreviewTiled()
|
||||||
VValentinaSettings *settings = VAbstractValApplication::VApp()->ValentinaSettings();
|
VValentinaSettings *settings = VAbstractValApplication::VApp()->ValentinaSettings();
|
||||||
m_layoutSettings->SetTiledMargins(settings->GetTiledPDFMargins(Unit::Mm));
|
m_layoutSettings->SetTiledMargins(settings->GetTiledPDFMargins(Unit::Mm));
|
||||||
m_layoutSettings->SetTiledPDFOrientation(settings->GetTiledPDFOrientation());
|
m_layoutSettings->SetTiledPDFOrientation(settings->GetTiledPDFOrientation());
|
||||||
m_layoutSettings->SetTiledPDFPaperSize(QSizeF(settings->GetTiledPDFPaperWidth(Unit::Mm),
|
m_layoutSettings->SetTiledPDFPaperSize(
|
||||||
settings->GetTiledPDFPaperHeight(Unit::Mm)));
|
QSizeF(settings->GetTiledPDFPaperWidth(Unit::Mm), settings->GetTiledPDFPaperHeight(Unit::Mm)));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_layoutSettings->SetWatermarkPath(
|
m_layoutSettings->SetWatermarkPath(
|
||||||
|
@ -816,8 +817,8 @@ void MainWindowsNoGUI::PrintTiled()
|
||||||
VValentinaSettings *settings = VAbstractValApplication::VApp()->ValentinaSettings();
|
VValentinaSettings *settings = VAbstractValApplication::VApp()->ValentinaSettings();
|
||||||
m_layoutSettings->SetTiledMargins(settings->GetTiledPDFMargins(Unit::Mm));
|
m_layoutSettings->SetTiledMargins(settings->GetTiledPDFMargins(Unit::Mm));
|
||||||
m_layoutSettings->SetTiledPDFOrientation(settings->GetTiledPDFOrientation());
|
m_layoutSettings->SetTiledPDFOrientation(settings->GetTiledPDFOrientation());
|
||||||
m_layoutSettings->SetTiledPDFPaperSize(QSizeF(settings->GetTiledPDFPaperWidth(Unit::Mm),
|
m_layoutSettings->SetTiledPDFPaperSize(
|
||||||
settings->GetTiledPDFPaperHeight(Unit::Mm)));
|
QSizeF(settings->GetTiledPDFPaperWidth(Unit::Mm), settings->GetTiledPDFPaperHeight(Unit::Mm)));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_layoutSettings->SetWatermarkPath(
|
m_layoutSettings->SetWatermarkPath(
|
||||||
|
@ -902,8 +903,8 @@ auto MainWindowsNoGUI::ScenePreview(int i, QSize iconSize, PreviewQuatilty quali
|
||||||
{
|
{
|
||||||
const QRectF r = paper->rect();
|
const QRectF r = paper->rect();
|
||||||
// Create the image with the exact size of the shrunk scene
|
// Create the image with the exact size of the shrunk scene
|
||||||
image = QImage(QSize(static_cast<qint32>(r.width()), static_cast<qint32>(r.height())),
|
image =
|
||||||
QImage::Format_RGB32);
|
QImage(QSize(static_cast<qint32>(r.width()), static_cast<qint32>(r.height())), QImage::Format_RGB32);
|
||||||
|
|
||||||
if (not image.isNull())
|
if (not image.isNull())
|
||||||
{
|
{
|
||||||
|
@ -1003,8 +1004,8 @@ void MainWindowsNoGUI::PdfTiledFile(const QString &name)
|
||||||
VValentinaSettings *settings = VAbstractValApplication::VApp()->ValentinaSettings();
|
VValentinaSettings *settings = VAbstractValApplication::VApp()->ValentinaSettings();
|
||||||
m_layoutSettings->SetTiledMargins(QMarginsF(settings->GetTiledPDFMargins(Unit::Mm)));
|
m_layoutSettings->SetTiledMargins(QMarginsF(settings->GetTiledPDFMargins(Unit::Mm)));
|
||||||
m_layoutSettings->SetTiledPDFOrientation(settings->GetTiledPDFOrientation());
|
m_layoutSettings->SetTiledPDFOrientation(settings->GetTiledPDFOrientation());
|
||||||
m_layoutSettings->SetTiledPDFPaperSize(QSizeF(settings->GetTiledPDFPaperWidth(Unit::Mm),
|
m_layoutSettings->SetTiledPDFPaperSize(
|
||||||
settings->GetTiledPDFPaperHeight(Unit::Mm)));
|
QSizeF(settings->GetTiledPDFPaperWidth(Unit::Mm), settings->GetTiledPDFPaperHeight(Unit::Mm)));
|
||||||
m_layoutSettings->SetXScale(1);
|
m_layoutSettings->SetXScale(1);
|
||||||
m_layoutSettings->SetYScale(1);
|
m_layoutSettings->SetYScale(1);
|
||||||
}
|
}
|
||||||
|
@ -1015,10 +1016,9 @@ void MainWindowsNoGUI::PdfTiledFile(const QString &name)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void MainWindowsNoGUI::ExportScene(const QList<QGraphicsScene *> &scenes,
|
void MainWindowsNoGUI::ExportScene(const QList<QGraphicsScene *> &scenes, const QList<QGraphicsItem *> &papers,
|
||||||
const QList<QGraphicsItem *> &papers, const QList<QGraphicsItem *> &shadows,
|
const QList<QGraphicsItem *> &shadows, const QList<QList<QGraphicsItem *>> &details,
|
||||||
const QList<QList<QGraphicsItem *> > &details, bool ignorePrinterFields,
|
bool ignorePrinterFields, const QMarginsF &margins) const
|
||||||
const QMarginsF &margins) const
|
|
||||||
{
|
{
|
||||||
QT_WARNING_PUSH
|
QT_WARNING_PUSH
|
||||||
QT_WARNING_DISABLE_GCC("-Wnoexcept")
|
QT_WARNING_DISABLE_GCC("-Wnoexcept")
|
||||||
|
@ -1042,7 +1042,8 @@ void MainWindowsNoGUI::ExportScene(const QList<QGraphicsScene *> &scenes,
|
||||||
if (paper != nullptr)
|
if (paper != nullptr)
|
||||||
{
|
{
|
||||||
const QString name = m_dialogSaveLayout->Path() + '/' + m_dialogSaveLayout->FileName() +
|
const QString name = m_dialogSaveLayout->Path() + '/' + m_dialogSaveLayout->FileName() +
|
||||||
QString::number(i+1) + VLayoutExporter::ExportFormatSuffix(m_dialogSaveLayout->Format());
|
QString::number(i + 1) +
|
||||||
|
VLayoutExporter::ExportFormatSuffix(m_dialogSaveLayout->Format());
|
||||||
auto *brush = new QBrush();
|
auto *brush = new QBrush();
|
||||||
brush->setColor(QColor(Qt::white));
|
brush->setColor(QColor(Qt::white));
|
||||||
QGraphicsScene *scene = scenes.at(i);
|
QGraphicsScene *scene = scenes.at(i);
|
||||||
|
@ -1163,7 +1164,8 @@ auto MainWindowsNoGUI::FileName() const -> QString
|
||||||
{
|
{
|
||||||
QString fileName;
|
QString fileName;
|
||||||
VAbstractValApplication::VApp()->GetPatternPath().isEmpty()
|
VAbstractValApplication::VApp()->GetPatternPath().isEmpty()
|
||||||
? fileName = tr("unnamed") : fileName = VAbstractValApplication::VApp()->GetPatternPath();
|
? fileName = tr("unnamed")
|
||||||
|
: fileName = VAbstractValApplication::VApp()->GetPatternPath();
|
||||||
return QFileInfo(fileName).baseName();
|
return QFileInfo(fileName).baseName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1206,9 +1208,10 @@ auto MainWindowsNoGUI::ExportFMeasurementsToCSVData(const QString &fileName, boo
|
||||||
|
|
||||||
if (qIsInf(result) || qIsNaN(result))
|
if (qIsInf(result) || qIsNaN(result))
|
||||||
{
|
{
|
||||||
qCritical("%s\n\n%s", qUtf8Printable(tr("Export final measurements error.")),
|
qCritical(
|
||||||
qUtf8Printable(tr("Value in line %1 is infinite or NaN. Please, check your calculations.")
|
"%s\n\n%s", qUtf8Printable(tr("Export final measurements error.")),
|
||||||
.arg(i+1)));
|
qUtf8Printable(
|
||||||
|
tr("Value in line %1 is infinite or NaN. Please, check your calculations.").arg(i + 1)));
|
||||||
if (not VApplication::IsGUIMode())
|
if (not VApplication::IsGUIMode())
|
||||||
{
|
{
|
||||||
QCoreApplication::exit(V_EX_DATAERR);
|
QCoreApplication::exit(V_EX_DATAERR);
|
||||||
|
@ -1307,8 +1310,8 @@ auto MainWindowsNoGUI::OpenMeasurementFile(const QString &path) const -> QShared
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void MainWindowsNoGUI::CheckRequiredMeasurements(const VMeasurements *m) const
|
void MainWindowsNoGUI::CheckRequiredMeasurements(const VMeasurements *m) const
|
||||||
{
|
{
|
||||||
const QSet<QString> match = ConvertToSet<QString>(doc->ListMeasurements())
|
const QSet<QString> match =
|
||||||
.subtract(ConvertToSet<QString>(m->ListAll()));
|
ConvertToSet<QString>(doc->ListMeasurements()).subtract(ConvertToSet<QString>(m->ListAll()));
|
||||||
|
|
||||||
if (not match.isEmpty())
|
if (not match.isEmpty())
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,8 +43,9 @@ class VAbstractValApplication : public VAbstractApplication
|
||||||
{
|
{
|
||||||
Q_OBJECT // NOLINT
|
Q_OBJECT // NOLINT
|
||||||
|
|
||||||
public : VAbstractValApplication(int &argc, char **argv);
|
public:
|
||||||
virtual ~VAbstractValApplication() = default;
|
VAbstractValApplication(int &argc, char **argv);
|
||||||
|
~VAbstractValApplication() override = default;
|
||||||
|
|
||||||
auto GetCustomerName() const -> QString;
|
auto GetCustomerName() const -> QString;
|
||||||
void SetCustomerName(const QString &name);
|
void SetCustomerName(const QString &name);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user