Use auto to avoid duplicating the type name.

This commit is contained in:
Roman Telezhynskyi 2024-02-19 18:15:42 +02:00
parent 0adb49a427
commit 643deeb521
90 changed files with 217 additions and 225 deletions

View File

@ -2787,8 +2787,7 @@ void VPattern::ParseToolSpline(VMainGraphicsScene *scene, QDomElement &domElemen
if (spl != nullptr) if (spl != nullptr)
{ {
VAbstractMainWindow *window = auto *window = qobject_cast<VAbstractMainWindow *>(VAbstractValApplication::VApp()->getMainWindow());
qobject_cast<VAbstractMainWindow *>(VAbstractValApplication::VApp()->getMainWindow());
SCASSERT(window != nullptr) SCASSERT(window != nullptr)
connect(spl, &VToolSpline::ToolTip, window, &VAbstractMainWindow::ShowToolTip); connect(spl, &VToolSpline::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
} }
@ -2997,8 +2996,7 @@ void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement
if (spl != nullptr) if (spl != nullptr)
{ {
VAbstractMainWindow *window = auto *window = qobject_cast<VAbstractMainWindow *>(VAbstractValApplication::VApp()->getMainWindow());
qobject_cast<VAbstractMainWindow *>(VAbstractValApplication::VApp()->getMainWindow());
SCASSERT(window != nullptr) SCASSERT(window != nullptr)
connect(spl, &VToolSplinePath::ToolTip, window, &VAbstractMainWindow::ShowToolTip); connect(spl, &VToolSplinePath::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
} }
@ -3121,14 +3119,14 @@ void VPattern::ParseNodeSpline(const QDomElement &domElement, const Document &pa
const auto obj = initData.data->GetGObject(initData.idObject); const auto obj = initData.data->GetGObject(initData.idObject);
if (obj->getType() == GOType::Spline) if (obj->getType() == GOType::Spline)
{ {
VSpline *spl = new VSpline(*data->GeometricObject<VSpline>(initData.idObject)); auto *spl = new VSpline(*data->GeometricObject<VSpline>(initData.idObject));
spl->setIdObject(initData.idObject); spl->setIdObject(initData.idObject);
spl->setMode(Draw::Modeling); spl->setMode(Draw::Modeling);
initData.data->UpdateGObject(initData.id, spl); initData.data->UpdateGObject(initData.id, spl);
} }
else else
{ {
VCubicBezier *spl = new VCubicBezier(*initData.data->GeometricObject<VCubicBezier>(initData.idObject)); auto *spl = new VCubicBezier(*initData.data->GeometricObject<VCubicBezier>(initData.idObject));
spl->setIdObject(initData.idObject); spl->setIdObject(initData.idObject);
spl->setMode(Draw::Modeling); spl->setMode(Draw::Modeling);
initData.data->UpdateGObject(initData.id, spl); initData.data->UpdateGObject(initData.id, spl);
@ -3169,15 +3167,14 @@ void VPattern::ParseNodeSplinePath(const QDomElement &domElement, const Document
const auto obj = initData.data->GetGObject(initData.idObject); const auto obj = initData.data->GetGObject(initData.idObject);
if (obj->getType() == GOType::SplinePath) if (obj->getType() == GOType::SplinePath)
{ {
VSplinePath *path = new VSplinePath(*initData.data->GeometricObject<VSplinePath>(initData.idObject)); auto *path = new VSplinePath(*initData.data->GeometricObject<VSplinePath>(initData.idObject));
path->setIdObject(initData.idObject); path->setIdObject(initData.idObject);
path->setMode(Draw::Modeling); path->setMode(Draw::Modeling);
initData.data->UpdateGObject(initData.id, path); initData.data->UpdateGObject(initData.id, path);
} }
else else
{ {
VCubicBezierPath *spl = auto *spl = new VCubicBezierPath(*initData.data->GeometricObject<VCubicBezierPath>(initData.idObject));
new VCubicBezierPath(*initData.data->GeometricObject<VCubicBezierPath>(initData.idObject));
spl->setIdObject(initData.idObject); spl->setIdObject(initData.idObject);
spl->setMode(Draw::Modeling); spl->setMode(Draw::Modeling);
initData.data->UpdateGObject(initData.id, spl); initData.data->UpdateGObject(initData.id, spl);

View File

@ -1035,7 +1035,7 @@ auto VPatternConverter::FixIncrementInFormulaToV0_2_0(const QString &formula, co
// TODO. Delete if minimal supported version is 0.2.0 // TODO. Delete if minimal supported version is 0.2.0
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 2, 0), "Time to refactor the code."); Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 2, 0), "Time to refactor the code.");
qmu::QmuTokenParser *cal = new qmu::QmuTokenParser(formula, false, false); // Eval formula auto *cal = new qmu::QmuTokenParser(formula, false, false); // Eval formula
QMap<vsizetype, QString> tokens = cal->GetTokens(); // Tokens (variables, measurements) QMap<vsizetype, QString> tokens = cal->GetTokens(); // Tokens (variables, measurements)
delete cal; delete cal;

View File

@ -137,7 +137,7 @@ void dx_iface::writeBlocks()
{ {
dxfW->writeBlock(bk); dxfW->writeBlock(bk);
// and write each entity in block // and write each entity in block
for (std::list<DRW_Entity *>::const_iterator it = bk->ent.begin(); it != bk->ent.end(); ++it) for (auto it = bk->ent.begin(); it != bk->ent.end(); ++it)
writeEntity(*it); writeEntity(*it);
} }
} }
@ -150,7 +150,7 @@ void dx_iface::writeBlockRecords()
void dx_iface::writeEntities() void dx_iface::writeEntities()
{ {
for (std::list<DRW_Entity *>::const_iterator it = cData.mBlock->ent.begin(); it != cData.mBlock->ent.end(); ++it) for (auto it = cData.mBlock->ent.begin(); it != cData.mBlock->ent.end(); ++it)
writeEntity(*it); writeEntity(*it);
} }

View File

@ -56,7 +56,7 @@ public:
virtual ~dx_ifaceBlock() virtual ~dx_ifaceBlock()
{ {
for (std::list<DRW_Entity *>::const_iterator it = ent.begin(); it != ent.end(); ++it) for (auto it = ent.begin(); it != ent.end(); ++it)
delete *it; delete *it;
} }
std::list<DRW_Entity *> ent; // stores the entities list std::list<DRW_Entity *> ent; // stores the entities list
@ -83,7 +83,7 @@ public:
~dx_data() ~dx_data()
{ {
// cleanup, // cleanup,
for (std::list<dx_ifaceBlock *>::const_iterator it = blocks.begin(); it != blocks.end(); ++it) for (auto it = blocks.begin(); it != blocks.end(); ++it)
delete *it; delete *it;
delete mBlock; delete mBlock;
} }

View File

@ -80,10 +80,10 @@ public:
extData(), extData(),
curr(nullptr) curr(nullptr)
{ {
for (std::vector<DRW_Variant *>::const_iterator it = e.extData.begin(); it != e.extData.end(); ++it) for (auto it = e.extData.begin(); it != e.extData.end(); ++it)
{ {
DRW_Variant *src = *it; DRW_Variant *src = *it;
DRW_Variant *dst = new DRW_Variant(*src); auto *dst = new DRW_Variant(*src);
extData.push_back(dst); extData.push_back(dst);
if (src == e.curr) if (src == e.curr)
{ {

View File

@ -275,7 +275,7 @@ auto VPoster::TextWatermark(QGraphicsItem *parent, const PosterData &img, const
QVector<QGraphicsItem *> data; QVector<QGraphicsItem *> data;
QGraphicsSimpleTextItem *text = new QGraphicsSimpleTextItem(watermarkData.text, parent); auto *text = new QGraphicsSimpleTextItem(watermarkData.text, parent);
text->setFont(watermarkData.font); text->setFont(watermarkData.font);
QPen pen = text->pen(); QPen pen = text->pen();

View File

@ -231,7 +231,7 @@ void DialogExportToCSV::ShowPreview()
{ {
for (int column = 0; column < columns; ++column) for (int column = 0; column < columns; ++column)
{ {
QTableWidgetItem *header = new QTableWidgetItem(csv.headerText(column)); auto *header = new QTableWidgetItem(csv.headerText(column));
ui->tableWidget->setHorizontalHeaderItem(column, header); ui->tableWidget->setHorizontalHeaderItem(column, header);
} }
ui->tableWidget->horizontalHeader()->setStretchLastSection(true); ui->tableWidget->horizontalHeader()->setStretchLastSection(true);
@ -241,7 +241,7 @@ void DialogExportToCSV::ShowPreview()
{ {
for (int column = 0; column < columns; ++column) for (int column = 0; column < columns; ++column)
{ {
QTableWidgetItem *item = new QTableWidgetItem(csv.text(row, column)); auto *item = new QTableWidgetItem(csv.text(row, column));
item->setToolTip(csv.text(row, column)); item->setToolTip(csv.text(row, column));
// set the item non-editable (view only), and non-selectable // set the item non-editable (view only), and non-selectable

View File

@ -85,7 +85,7 @@ void VObjPaintDevice::setFileName(const QString &value)
owns_iodevice = static_cast<int>(true); owns_iodevice = static_cast<int>(true);
fileName = value; fileName = value;
QFile *file = new QFile(fileName); auto *file = new QFile(fileName);
engine->setOutputDevice(file); engine->setOutputDevice(file);
} }

View File

@ -97,7 +97,7 @@ auto Calculator::EvalFormula(const QHash<QString, QSharedPointer<VInternalVariab
auto Calculator::VarFactory(const QString &a_szName, void *a_pUserData) -> qreal * auto Calculator::VarFactory(const QString &a_szName, void *a_pUserData) -> qreal *
{ {
Q_UNUSED(a_szName) Q_UNUSED(a_szName)
Calculator *calc = static_cast<Calculator *>(a_pUserData); auto *calc = static_cast<Calculator *>(a_pUserData);
if (calc->m_vars != nullptr && calc->m_vars->contains(a_szName)) if (calc->m_vars != nullptr && calc->m_vars->contains(a_szName))
{ {

View File

@ -66,7 +66,7 @@ public:
pixmapLabel->setSizePolicy(sizePolicy); pixmapLabel->setSizePolicy(sizePolicy);
pixmapLabel->setVisible(false); pixmapLabel->setVisible(false);
QSpacerItem *pixmapSpacer = new QSpacerItem(0, 5, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding); auto *pixmapSpacer = new QSpacerItem(0, 5, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding);
messageLabel = new QLabel(q); messageLabel = new QLabel(q);
messageLabel->setMinimumSize(QSize(300, 0)); messageLabel->setMinimumSize(QSize(300, 0));
@ -74,8 +74,8 @@ public:
messageLabel->setOpenExternalLinks(true); messageLabel->setOpenExternalLinks(true);
messageLabel->setTextInteractionFlags(Qt::LinksAccessibleByKeyboard | Qt::LinksAccessibleByMouse); messageLabel->setTextInteractionFlags(Qt::LinksAccessibleByKeyboard | Qt::LinksAccessibleByMouse);
QSpacerItem *checkBoxRightSpacer = new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum); auto *checkBoxRightSpacer = new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum);
QSpacerItem *buttonSpacer = new QSpacerItem(0, 1, QSizePolicy::Minimum, QSizePolicy::Minimum); auto *buttonSpacer = new QSpacerItem(0, 1, QSizePolicy::Minimum, QSizePolicy::Minimum);
checkBox = new QCheckBox(q); checkBox = new QCheckBox(q);
checkBox->setText(CheckableMessageBox::tr("Do not ask again")); checkBox->setText(CheckableMessageBox::tr("Do not ask again"));
@ -84,19 +84,19 @@ public:
buttonBox->setOrientation(Qt::Horizontal); buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok); buttonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);
QVBoxLayout *verticalLayout = new QVBoxLayout(); auto *verticalLayout = new QVBoxLayout();
verticalLayout->addWidget(pixmapLabel); verticalLayout->addWidget(pixmapLabel);
verticalLayout->addItem(pixmapSpacer); verticalLayout->addItem(pixmapSpacer);
QHBoxLayout *horizontalLayout_2 = new QHBoxLayout(); auto *horizontalLayout_2 = new QHBoxLayout();
horizontalLayout_2->addLayout(verticalLayout); horizontalLayout_2->addLayout(verticalLayout);
horizontalLayout_2->addWidget(messageLabel); horizontalLayout_2->addWidget(messageLabel);
QHBoxLayout *horizontalLayout = new QHBoxLayout(); auto *horizontalLayout = new QHBoxLayout();
horizontalLayout->addWidget(checkBox); horizontalLayout->addWidget(checkBox);
horizontalLayout->addItem(checkBoxRightSpacer); horizontalLayout->addItem(checkBoxRightSpacer);
QVBoxLayout *verticalLayout_2 = new QVBoxLayout(q); auto *verticalLayout_2 = new QVBoxLayout(q);
verticalLayout_2->addLayout(horizontalLayout_2); verticalLayout_2->addLayout(horizontalLayout_2);
verticalLayout_2->addLayout(horizontalLayout); verticalLayout_2->addLayout(horizontalLayout);
verticalLayout_2->addItem(buttonSpacer); verticalLayout_2->addItem(buttonSpacer);
@ -230,7 +230,7 @@ auto CheckableMessageBox::defaultButton() const -> QDialogButtonBox::StandardBut
const QList<QAbstractButton *> buttons = d->buttonBox->buttons(); const QList<QAbstractButton *> buttons = d->buttonBox->buttons();
for (auto *b : buttons) for (auto *b : buttons)
{ {
if (QPushButton *pb = qobject_cast<QPushButton *>(b)) if (auto *pb = qobject_cast<QPushButton *>(b))
{ {
if (pb->isDefault()) if (pb->isDefault())
{ {

View File

@ -67,7 +67,7 @@ auto VPE::VColorProperty::createEditor(QWidget *parent, const QStyleOptionViewIt
Q_UNUSED(options) Q_UNUSED(options)
Q_UNUSED(delegate) Q_UNUSED(delegate)
VColorPropertyEditor* tmpWidget = new VColorPropertyEditor(parent); auto *tmpWidget = new VColorPropertyEditor(parent);
tmpWidget->setLocale(parent->locale()); tmpWidget->setLocale(parent->locale());
tmpWidget->SetColor(d_ptr->VariantValue.value<QColor>()); tmpWidget->SetColor(d_ptr->VariantValue.value<QColor>());
return tmpWidget; return tmpWidget;
@ -76,7 +76,7 @@ auto VPE::VColorProperty::createEditor(QWidget *parent, const QStyleOptionViewIt
//! Sets the property's data to the editor (returns false, if the standard delegate should do that) //! Sets the property's data to the editor (returns false, if the standard delegate should do that)
auto VPE::VColorProperty::setEditorData(QWidget *editor) -> bool auto VPE::VColorProperty::setEditorData(QWidget *editor) -> bool
{ {
VColorPropertyEditor* tmpWidget = qobject_cast<VColorPropertyEditor*>(editor); auto *tmpWidget = qobject_cast<VColorPropertyEditor *>(editor);
if (tmpWidget) if (tmpWidget)
{ {
tmpWidget->SetColor(d_ptr->VariantValue.value<QColor>()); tmpWidget->SetColor(d_ptr->VariantValue.value<QColor>());
@ -90,7 +90,7 @@ auto VPE::VColorProperty::setEditorData(QWidget *editor) -> bool
//! Gets the data from the widget //! Gets the data from the widget
auto VPE::VColorProperty::getEditorData(const QWidget *editor) const -> QVariant auto VPE::VColorProperty::getEditorData(const QWidget *editor) const -> QVariant
{ {
const VColorPropertyEditor* tmpWidget = qobject_cast<const VColorPropertyEditor*>(editor); const auto *tmpWidget = qobject_cast<const VColorPropertyEditor *>(editor);
if (tmpWidget) if (tmpWidget)
{ {
return tmpWidget->GetColor(); return tmpWidget->GetColor();

View File

@ -60,7 +60,7 @@ VPE::VColorPropertyEditor::VColorPropertyEditor(QWidget *parent)
Spacer = new QSpacerItem(1, 0, QSizePolicy::Expanding, QSizePolicy::Ignored); Spacer = new QSpacerItem(1, 0, QSizePolicy::Expanding, QSizePolicy::Ignored);
// The layout (a horizontal layout) // The layout (a horizontal layout)
QHBoxLayout* layout = new QHBoxLayout(this); auto *layout = new QHBoxLayout(this);
layout->setSpacing(3); layout->setSpacing(3);
layout->setContentsMargins(0, 0, 0, 0); layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(ColorLabel); layout->addWidget(ColorLabel);
@ -101,7 +101,7 @@ void VPE::VColorPropertyEditor::onToolButtonClicked()
{ {
SetColor(newColor); SetColor(newColor);
emit dataChangedByUser(Color, this); emit dataChangedByUser(Color, this);
UserChangeEvent *event = new UserChangeEvent(); auto *event = new UserChangeEvent();
QCoreApplication::postEvent ( this, event ); QCoreApplication::postEvent ( this, event );
} }
} }

View File

@ -79,7 +79,7 @@ auto VPE::VEnumProperty::createEditor(QWidget *parent, const QStyleOptionViewIte
{ {
Q_UNUSED(options) Q_UNUSED(options)
Q_UNUSED(delegate) Q_UNUSED(delegate)
QComboBox* tmpEditor = new QComboBox(parent); auto *tmpEditor = new QComboBox(parent);
tmpEditor->clear(); tmpEditor->clear();
tmpEditor->setLocale(parent->locale()); tmpEditor->setLocale(parent->locale());
tmpEditor->addItems(EnumerationLiterals); tmpEditor->addItems(EnumerationLiterals);
@ -93,7 +93,7 @@ auto VPE::VEnumProperty::createEditor(QWidget *parent, const QStyleOptionViewIte
//! Gets the data from the widget //! Gets the data from the widget
auto VPE::VEnumProperty::getEditorData(const QWidget *editor) const -> QVariant auto VPE::VEnumProperty::getEditorData(const QWidget *editor) const -> QVariant
{ {
const QComboBox* tmpEditor = qobject_cast<const QComboBox*>(editor); const auto *tmpEditor = qobject_cast<const QComboBox *>(editor);
if (tmpEditor) if (tmpEditor)
{ {
return tmpEditor->currentIndex(); return tmpEditor->currentIndex();
@ -173,6 +173,6 @@ auto VPE::VEnumProperty::getSettingKeys() const -> QStringList
void VPE::VEnumProperty::currentIndexChanged(int index) void VPE::VEnumProperty::currentIndexChanged(int index)
{ {
Q_UNUSED(index) Q_UNUSED(index)
UserChangeEvent *event = new UserChangeEvent(); auto *event = new UserChangeEvent();
QCoreApplication::postEvent ( VProperty::d_ptr->editor, event ); QCoreApplication::postEvent ( VProperty::d_ptr->editor, event );
} }

View File

@ -63,7 +63,7 @@ VPE::VFileEditWidget::VFileEditWidget(QWidget *parent, bool is_directory)
FileLineEdit->installEventFilter(this); FileLineEdit->installEventFilter(this);
// The layout (a horizontal layout) // The layout (a horizontal layout)
QHBoxLayout *layout = new QHBoxLayout(this); auto *layout = new QHBoxLayout(this);
layout->setSpacing(0); layout->setSpacing(0);
layout->setContentsMargins(0, 0, 0, 0); layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(FileLineEdit); layout->addWidget(FileLineEdit);

View File

@ -77,7 +77,7 @@ auto VPE::VLabelProperty::createEditor(QWidget *parent, const QStyleOptionViewIt
Q_UNUSED(options) Q_UNUSED(options)
Q_UNUSED(delegate) Q_UNUSED(delegate)
QLabel *tmpEditor = new QLabel(parent); auto *tmpEditor = new QLabel(parent);
tmpEditor->setLocale(parent->locale()); tmpEditor->setLocale(parent->locale());
tmpEditor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); tmpEditor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
tmpEditor->setText(d_ptr->VariantValue.toString()); tmpEditor->setText(d_ptr->VariantValue.toString());
@ -88,7 +88,7 @@ auto VPE::VLabelProperty::createEditor(QWidget *parent, const QStyleOptionViewIt
auto VPE::VLabelProperty::setEditorData(QWidget *editor) -> bool auto VPE::VLabelProperty::setEditorData(QWidget *editor) -> bool
{ {
if (QLabel *tmpWidget = qobject_cast<QLabel *>(editor)) if (auto *tmpWidget = qobject_cast<QLabel *>(editor))
{ {
tmpWidget->setText(d_ptr->VariantValue.toString()); tmpWidget->setText(d_ptr->VariantValue.toString());
return true; return true;
@ -99,7 +99,7 @@ auto VPE::VLabelProperty::setEditorData(QWidget *editor) -> bool
auto VPE::VLabelProperty::getEditorData(const QWidget *editor) const -> QVariant auto VPE::VLabelProperty::getEditorData(const QWidget *editor) const -> QVariant
{ {
const QLabel *tmpEditor = qobject_cast<const QLabel *>(editor); const auto *tmpEditor = qobject_cast<const QLabel *>(editor);
if (tmpEditor) if (tmpEditor)
{ {
return tmpEditor->text(); return tmpEditor->text();

View File

@ -52,7 +52,7 @@ auto VPE::VObjectProperty::data(int column, int role) const -> QVariant
return QVariant(); return QVariant();
} }
QComboBox* tmpEditor = qobject_cast<QComboBox*>(VProperty::d_ptr->editor); auto *tmpEditor = qobject_cast<QComboBox *>(VProperty::d_ptr->editor);
if (column == DPC_Data && Qt::DisplayRole == role) if (column == DPC_Data && Qt::DisplayRole == role)
{ {
@ -72,7 +72,7 @@ auto VPE::VObjectProperty::createEditor(QWidget *parent, const QStyleOptionViewI
{ {
Q_UNUSED(options) Q_UNUSED(options)
Q_UNUSED(delegate) Q_UNUSED(delegate)
QComboBox* tmpEditor = new QComboBox(parent); auto *tmpEditor = new QComboBox(parent);
tmpEditor->clear(); tmpEditor->clear();
tmpEditor->setLocale(parent->locale()); tmpEditor->setLocale(parent->locale());
FillList(tmpEditor, objects); FillList(tmpEditor, objects);
@ -91,7 +91,7 @@ auto VPE::VObjectProperty::setEditorData(QWidget *editor) -> bool
return false; return false;
} }
QComboBox* tmpEditor = qobject_cast<QComboBox*>(editor); auto *tmpEditor = qobject_cast<QComboBox *>(editor);
if (tmpEditor) if (tmpEditor)
{ {
quint32 const objId = VProperty::d_ptr->VariantValue.toUInt(); quint32 const objId = VProperty::d_ptr->VariantValue.toUInt();
@ -113,7 +113,7 @@ auto VPE::VObjectProperty::setEditorData(QWidget *editor) -> bool
//! Gets the data from the widget //! Gets the data from the widget
auto VPE::VObjectProperty::getEditorData(const QWidget *editor) const -> QVariant auto VPE::VObjectProperty::getEditorData(const QWidget *editor) const -> QVariant
{ {
const QComboBox* tmpEditor = qobject_cast<const QComboBox*>(editor); const auto *tmpEditor = qobject_cast<const QComboBox *>(editor);
if (tmpEditor) if (tmpEditor)
{ {
return tmpEditor->itemData(tmpEditor->currentIndex()); return tmpEditor->itemData(tmpEditor->currentIndex());
@ -165,7 +165,7 @@ auto VPE::VObjectProperty::clone(bool include_children, VProperty *container) co
void VPE::VObjectProperty::currentIndexChanged(int index) void VPE::VObjectProperty::currentIndexChanged(int index)
{ {
Q_UNUSED(index) Q_UNUSED(index)
UserChangeEvent *event = new UserChangeEvent(); auto *event = new UserChangeEvent();
QCoreApplication::postEvent ( VProperty::d_ptr->editor, event ); QCoreApplication::postEvent ( VProperty::d_ptr->editor, event );
} }

View File

@ -42,11 +42,11 @@ VPE::VPointFProperty::VPointFProperty(const QString &name)
d_ptr->VariantValue.convert(QVariant::PointF); d_ptr->VariantValue.convert(QVariant::PointF);
#endif #endif
VDoubleProperty* tmpX = new VDoubleProperty("X"); auto *tmpX = new VDoubleProperty("X");
addChild(tmpX); addChild(tmpX);
tmpX->setUpdateBehaviour(true, false); tmpX->setUpdateBehaviour(true, false);
VDoubleProperty* tmpY = new VDoubleProperty("Y"); auto *tmpY = new VDoubleProperty("Y");
addChild(tmpY); addChild(tmpY);
tmpY->setUpdateBehaviour(true, false); tmpY->setUpdateBehaviour(true, false);

View File

@ -58,7 +58,7 @@ auto VPE::VShortcutProperty::createEditor(QWidget *parent, const QStyleOptionVie
{ {
Q_UNUSED(options) Q_UNUSED(options)
VShortcutEditWidget* tmpWidget = new VShortcutEditWidget(parent); auto *tmpWidget = new VShortcutEditWidget(parent);
if (delegate) if (delegate)
{ {
VShortcutEditWidget::connect(tmpWidget, SIGNAL(commitData(QWidget*)), delegate, SIGNAL(commitData(QWidget*))); VShortcutEditWidget::connect(tmpWidget, SIGNAL(commitData(QWidget*)), delegate, SIGNAL(commitData(QWidget*)));
@ -69,7 +69,7 @@ auto VPE::VShortcutProperty::createEditor(QWidget *parent, const QStyleOptionVie
auto VPE::VShortcutProperty::setEditorData(QWidget *editor) -> bool auto VPE::VShortcutProperty::setEditorData(QWidget *editor) -> bool
{ {
VShortcutEditWidget* tmpWidget = qobject_cast<VShortcutEditWidget*>(editor); auto *tmpWidget = qobject_cast<VShortcutEditWidget *>(editor);
if (tmpWidget) if (tmpWidget)
{ {
tmpWidget->setShortcut(d_ptr->VariantValue.toString(), false); tmpWidget->setShortcut(d_ptr->VariantValue.toString(), false);
@ -82,7 +82,7 @@ auto VPE::VShortcutProperty::setEditorData(QWidget *editor) -> bool
auto VPE::VShortcutProperty::getEditorData(const QWidget *editor) const -> QVariant auto VPE::VShortcutProperty::getEditorData(const QWidget *editor) const -> QVariant
{ {
const VShortcutEditWidget* tmpWidget = qobject_cast<const VShortcutEditWidget*>(editor); const auto *tmpWidget = qobject_cast<const VShortcutEditWidget *>(editor);
if (tmpWidget) if (tmpWidget)
{ {
return tmpWidget->getShortcutAsString(); return tmpWidget->getShortcutAsString();

View File

@ -40,7 +40,7 @@ VPE::VShortcutEditWidget::VShortcutEditWidget(QWidget *parent)
connect(LineEdit, &QLineEdit::textEdited, this, &VShortcutEditWidget::onTextEdited); connect(LineEdit, &QLineEdit::textEdited, this, &VShortcutEditWidget::onTextEdited);
// The layout (a horizontal layout) // The layout (a horizontal layout)
QHBoxLayout *layout = new QHBoxLayout(this); auto *layout = new QHBoxLayout(this);
layout->setSpacing(0); layout->setSpacing(0);
layout->setContentsMargins(0, 0, 0, 0); layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(LineEdit); layout->addWidget(LineEdit);
@ -57,7 +57,7 @@ auto VPE::VShortcutEditWidget::eventFilter(QObject *obj, QEvent *event) -> bool
{ {
if (event->type() == QEvent::KeyPress) if (event->type() == QEvent::KeyPress)
{ {
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event); auto *keyEvent = static_cast<QKeyEvent *>(event);
int keys = keyEvent->key(); int keys = keyEvent->key();

View File

@ -64,7 +64,7 @@ auto VPE::VStringProperty::createEditor(QWidget *parent, const QStyleOptionViewI
Q_UNUSED(options) Q_UNUSED(options)
Q_UNUSED(delegate) Q_UNUSED(delegate)
QLineEdit* tmpEditor = new QLineEdit(parent); auto *tmpEditor = new QLineEdit(parent);
tmpEditor->setLocale(parent->locale()); tmpEditor->setLocale(parent->locale());
tmpEditor->setReadOnly(readOnly); tmpEditor->setReadOnly(readOnly);
tmpEditor->installEventFilter(this); tmpEditor->installEventFilter(this);
@ -78,7 +78,7 @@ auto VPE::VStringProperty::createEditor(QWidget *parent, const QStyleOptionViewI
auto VPE::VStringProperty::setEditorData(QWidget *editor) -> bool auto VPE::VStringProperty::setEditorData(QWidget *editor) -> bool
{ {
if (QLineEdit* tmpWidget = qobject_cast<QLineEdit*>(editor)) if (auto *tmpWidget = qobject_cast<QLineEdit *>(editor))
{ {
if (not readOnly) if (not readOnly)
{ {
@ -92,7 +92,7 @@ auto VPE::VStringProperty::setEditorData(QWidget *editor) -> bool
auto VPE::VStringProperty::getEditorData(const QWidget *editor) const -> QVariant auto VPE::VStringProperty::getEditorData(const QWidget *editor) const -> QVariant
{ {
const QLineEdit* tmpEditor = qobject_cast<const QLineEdit*>(editor); const auto *tmpEditor = qobject_cast<const QLineEdit *>(editor);
if (tmpEditor) if (tmpEditor)
{ {
return tmpEditor->text(); return tmpEditor->text();
@ -177,11 +177,11 @@ void VPE::VStringProperty::setTypeForParent(int value)
auto VPE::VStringProperty::eventFilter(QObject *object, QEvent *event) -> bool auto VPE::VStringProperty::eventFilter(QObject *object, QEvent *event) -> bool
{ {
if (QLineEdit *textEdit = qobject_cast<QLineEdit *>(object)) if (auto *textEdit = qobject_cast<QLineEdit *>(object))
{ {
if (event->type() == QEvent::KeyPress) if (event->type() == QEvent::KeyPress)
{ {
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event); auto *keyEvent = static_cast<QKeyEvent *>(event);
if ((keyEvent->key() == Qt::Key_Period) && (keyEvent->modifiers() & Qt::KeypadModifier)) if ((keyEvent->key() == Qt::Key_Period) && (keyEvent->modifiers() & Qt::KeypadModifier))
{ {
if (m_osSeparator) if (m_osSeparator)

View File

@ -79,7 +79,7 @@ auto VPE::VTextProperty::createEditor(QWidget *parent, const QStyleOptionViewIte
Q_UNUSED(options) Q_UNUSED(options)
Q_UNUSED(delegate) Q_UNUSED(delegate)
QPlainTextEdit *tmpEditor = new QPlainTextEdit(parent); auto *tmpEditor = new QPlainTextEdit(parent);
tmpEditor->setLocale(parent->locale()); tmpEditor->setLocale(parent->locale());
tmpEditor->setReadOnly(readOnly); tmpEditor->setReadOnly(readOnly);
tmpEditor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); tmpEditor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
@ -92,7 +92,7 @@ auto VPE::VTextProperty::createEditor(QWidget *parent, const QStyleOptionViewIte
auto VPE::VTextProperty::setEditorData(QWidget *editor) -> bool auto VPE::VTextProperty::setEditorData(QWidget *editor) -> bool
{ {
if (QPlainTextEdit *tmpWidget = qobject_cast<QPlainTextEdit *>(editor)) if (auto *tmpWidget = qobject_cast<QPlainTextEdit *>(editor))
{ {
tmpWidget->setPlainText(d_ptr->VariantValue.toString()); tmpWidget->setPlainText(d_ptr->VariantValue.toString());
return true; return true;
@ -103,7 +103,7 @@ auto VPE::VTextProperty::setEditorData(QWidget *editor) -> bool
auto VPE::VTextProperty::getEditorData(const QWidget *editor) const -> QVariant auto VPE::VTextProperty::getEditorData(const QWidget *editor) const -> QVariant
{ {
const QPlainTextEdit *tmpEditor = qobject_cast<const QPlainTextEdit *>(editor); const auto *tmpEditor = qobject_cast<const QPlainTextEdit *>(editor);
if (tmpEditor) if (tmpEditor)
{ {
return tmpEditor->toPlainText(); return tmpEditor->toPlainText();

View File

@ -52,7 +52,7 @@ auto VPE::VWidgetProperty::getWidget() const -> QWidget *
void VPE::VWidgetProperty::setWidget(QWidget* widget) void VPE::VWidgetProperty::setWidget(QWidget* widget)
{ {
VWidgetPropertyPrivate* tmpDPtr = static_cast<VWidgetPropertyPrivate*>(d_ptr); auto *tmpDPtr = static_cast<VWidgetPropertyPrivate *>(d_ptr);
QWidget* tmpOldWidget = tmpDPtr->Widget.data(); QWidget* tmpOldWidget = tmpDPtr->Widget.data();
if (tmpOldWidget) if (tmpOldWidget)
{ {

View File

@ -117,7 +117,7 @@ auto VPE::VProperty::createEditor(QWidget *parent, const QStyleOptionViewItem &o
Q_UNUSED(options) Q_UNUSED(options)
Q_UNUSED(delegate) Q_UNUSED(delegate)
QItemEditorFactory *factory = new QItemEditorFactory; auto *factory = new QItemEditorFactory;
QItemEditorCreatorBase *lineCreator = new QStandardItemEditorCreator<QLineEdit>(); QItemEditorCreatorBase *lineCreator = new QStandardItemEditorCreator<QLineEdit>();
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
factory->registerEditor(QMetaType::QString, lineCreator); factory->registerEditor(QMetaType::QString, lineCreator);

View File

@ -49,7 +49,7 @@ auto VPE::VPropertyDelegate::createEditor(QWidget *parent, const QStyleOptionVie
QWidget* tmpWidget = nullptr; QWidget* tmpWidget = nullptr;
if (index.isValid()) if (index.isValid())
{ {
VProperty* tmpProperty = reinterpret_cast<VProperty*>(index.internalPointer()); auto *tmpProperty = reinterpret_cast<VProperty *>(index.internalPointer());
tmpWidget = tmpProperty->createEditor(parent, option, this); tmpWidget = tmpProperty->createEditor(parent, option, this);
} }
@ -63,7 +63,7 @@ void VPE::VPropertyDelegate::setEditorData (QWidget * editor, const QModelIndex
bool done = false; bool done = false;
if (index.isValid() && editor) if (index.isValid() && editor)
{ {
VProperty* tmpProperty = reinterpret_cast<VProperty*>(index.internalPointer()); auto *tmpProperty = reinterpret_cast<VProperty *>(index.internalPointer());
done = tmpProperty->setEditorData(editor); done = tmpProperty->setEditorData(editor);
} }
@ -80,7 +80,7 @@ void VPE::VPropertyDelegate::setModelData (QWidget * editor, QAbstractItemModel
QVariant tmpData; QVariant tmpData;
if (index.isValid() && editor) if (index.isValid() && editor)
{ {
VProperty* tmpProperty = reinterpret_cast<VProperty*>(index.internalPointer()); auto *tmpProperty = reinterpret_cast<VProperty *>(index.internalPointer());
tmpData = tmpProperty->getEditorData(editor); tmpData = tmpProperty->getEditorData(editor);
} }

View File

@ -141,7 +141,7 @@ void VPE::VPropertyFormWidget::build()
else else
{ {
// Child properties, the property itself is not being added // Child properties, the property itself is not being added
VPropertyFormWidget *tmpNewFormWidget = new VPropertyFormWidget(tmpProperty, this); auto *tmpNewFormWidget = new VPropertyFormWidget(tmpProperty, this);
tmpFormLayout->addRow(tmpNewFormWidget); tmpFormLayout->addRow(tmpNewFormWidget);
d_ptr->EditorWidgets.append(VPropertyFormWidgetPrivate::SEditorWidget(tmpNewFormWidget)); d_ptr->EditorWidgets.append(VPropertyFormWidgetPrivate::SEditorWidget(tmpNewFormWidget));
tmpNewFormWidget->setCommitBehaviour(d_ptr->UpdateEditors); tmpNewFormWidget->setCommitBehaviour(d_ptr->UpdateEditors);
@ -149,7 +149,7 @@ void VPE::VPropertyFormWidget::build()
} }
else if (tmpProperty->type() == "widget") else if (tmpProperty->type() == "widget")
{ {
VWidgetProperty *tmpWidgetProperty = static_cast<VWidgetProperty *>(tmpProperty); auto *tmpWidgetProperty = static_cast<VWidgetProperty *>(tmpProperty);
tmpFormLayout->addRow(tmpWidgetProperty->getWidget()); tmpFormLayout->addRow(tmpWidgetProperty->getWidget());
d_ptr->EditorWidgets.append(VPropertyFormWidgetPrivate::SEditorWidget(tmpWidgetProperty->getWidget())); d_ptr->EditorWidgets.append(VPropertyFormWidgetPrivate::SEditorWidget(tmpWidgetProperty->getWidget()));
} }

View File

@ -83,7 +83,7 @@ auto VPE::VPropertyModel::addProperty(VProperty *property, const QString &id, co
auto VPE::VPropertyModel::createProperty(const QString &id, const QString &name, const QString &parentid, auto VPE::VPropertyModel::createProperty(const QString &id, const QString &name, const QString &parentid,
const QVariant &data) -> VPE::VProperty * const QVariant &data) -> VPE::VProperty *
{ {
VProperty* tmpProp = new VProperty(name); auto *tmpProp = new VProperty(name);
tmpProp->setValue(data); tmpProp->setValue(data);
if (addProperty(tmpProp, id, parentid)) if (addProperty(tmpProp, id, parentid))
{ {
@ -263,7 +263,7 @@ auto VPE::VPropertyModel::getProperty(const QModelIndex &index) const -> VPE::VP
{ {
if (index.isValid()) if (index.isValid())
{ {
VProperty* prop = static_cast<VProperty*>(index.internalPointer()); auto *prop = static_cast<VProperty *>(index.internalPointer());
if (prop) if (prop)
{ {

View File

@ -204,7 +204,7 @@ auto VPE::VPropertySet::getRootPropertyCount() const -> vpesizetype
auto VPE::VPropertySet::clone() const -> VPE::VPropertySet * auto VPE::VPropertySet::clone() const -> VPE::VPropertySet *
{ {
VPropertySet* tmpResult = new VPropertySet(); auto *tmpResult = new VPropertySet();
const QList<VProperty*> rootProperties = d_ptr->RootProperties; const QList<VProperty*> rootProperties = d_ptr->RootProperties;
for (auto *tmpProperty : rootProperties) for (auto *tmpProperty : rootProperties)

View File

@ -865,8 +865,8 @@ void AbstractTest::SplineFromJson(const QJsonObject &itemObject, QSharedPointer<
ReadPointValue(itemObject, QStringLiteral("p4"), p4); ReadPointValue(itemObject, QStringLiteral("p4"), p4);
data->UpdateGObject(p4.id(), new VPointF(p4)); data->UpdateGObject(p4.id(), new VPointF(p4));
VSpline *spl = new VSpline(p1, p4, angle1, angle1Formula, angle2, angle2Formula, c1Length, c1LengthFormula, auto *spl = new VSpline(p1, p4, angle1, angle1Formula, angle2, angle2Formula, c1Length, c1LengthFormula, c2Length,
c2Length, c2LengthFormula); c2LengthFormula);
spl->SetApproximationScale(aScale); spl->SetApproximationScale(aScale);
data->UpdateGObject(id, spl); data->UpdateGObject(id, spl);
} }
@ -887,7 +887,7 @@ void AbstractTest::SplinePathFromJson(const QJsonObject &itemObject, QSharedPoin
data->UpdateGObject(point.P().id(), new VPointF(point.P())); data->UpdateGObject(point.P().id(), new VPointF(point.P()));
} }
VSplinePath *path = new VSplinePath(points); auto *path = new VSplinePath(points);
path->SetApproximationScale(aScale); path->SetApproximationScale(aScale);
data->UpdateGObject(id, path); data->UpdateGObject(id, path);
} }

View File

@ -245,11 +245,11 @@ void DeployFormula(QDialog *dialog, QPlainTextEdit *formula, QPushButton *button
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
auto FilterObject(QObject *object, QEvent *event) -> bool auto FilterObject(QObject *object, QEvent *event) -> bool
{ {
if (QPlainTextEdit *plainTextEdit = qobject_cast<QPlainTextEdit *>(object)) if (auto *plainTextEdit = qobject_cast<QPlainTextEdit *>(object))
{ {
if (event->type() == QEvent::KeyPress) if (event->type() == QEvent::KeyPress)
{ {
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event); auto *keyEvent = static_cast<QKeyEvent *>(event);
if ((keyEvent->key() == Qt::Key_Period) && (keyEvent->modifiers() & Qt::KeypadModifier)) if ((keyEvent->key() == Qt::Key_Period) && (keyEvent->modifiers() & Qt::KeypadModifier))
{ {
if (VAbstractApplication::VApp()->Settings()->GetOsSeparator()) if (VAbstractApplication::VApp()->Settings()->GetOsSeparator())

View File

@ -170,8 +170,7 @@ void DialogCubicBezierPath::ChosenObject(quint32 id, const SceneObject &type)
if (path.CountPoints() == 1) if (path.CountPoints() == 1)
{ {
visPath->VisualMode(NULL_ID); visPath->VisualMode(NULL_ID);
VAbstractMainWindow *window = auto *window = qobject_cast<VAbstractMainWindow *>(VAbstractValApplication::VApp()->getMainWindow());
qobject_cast<VAbstractMainWindow *>(VAbstractValApplication::VApp()->getMainWindow());
SCASSERT(window != nullptr) SCASSERT(window != nullptr)
connect(visPath, &VisToolCubicBezierPath::ToolTip, window, &VAbstractMainWindow::ShowToolTip); connect(visPath, &VisToolCubicBezierPath::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
} }
@ -253,7 +252,7 @@ void DialogCubicBezierPath::PointChanged(int row)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogCubicBezierPath::currentPointChanged(int index) void DialogCubicBezierPath::currentPointChanged(int index)
{ {
const quint32 id = qvariant_cast<quint32>(ui->comboBoxPoint->itemData(index)); const auto id = qvariant_cast<quint32>(ui->comboBoxPoint->itemData(index));
try try
{ {

View File

@ -113,7 +113,7 @@ auto DialogFlippingByAxis::GetOriginPointId() const -> quint32
void DialogFlippingByAxis::SetOriginPointId(quint32 value) void DialogFlippingByAxis::SetOriginPointId(quint32 value)
{ {
ChangeCurrentData(ui->comboBoxOriginPoint, value); ChangeCurrentData(ui->comboBoxOriginPoint, value);
VisToolFlippingByAxis *operation = qobject_cast<VisToolFlippingByAxis *>(vis); auto *operation = qobject_cast<VisToolFlippingByAxis *>(vis);
SCASSERT(operation != nullptr) SCASSERT(operation != nullptr)
operation->SetOriginPointId(value); operation->SetOriginPointId(value);
} }
@ -206,12 +206,11 @@ void DialogFlippingByAxis::ShowDialog(bool click)
stage1 = false; stage1 = false;
VMainGraphicsScene *scene = auto *scene = qobject_cast<VMainGraphicsScene *>(VAbstractValApplication::VApp()->getCurrentScene());
qobject_cast<VMainGraphicsScene *>(VAbstractValApplication::VApp()->getCurrentScene());
SCASSERT(scene != nullptr) SCASSERT(scene != nullptr)
scene->clearSelection(); scene->clearSelection();
VisToolFlippingByAxis *operation = qobject_cast<VisToolFlippingByAxis *>(vis); auto *operation = qobject_cast<VisToolFlippingByAxis *>(vis);
SCASSERT(operation != nullptr) SCASSERT(operation != nullptr)
operation->SetObjects(SourceToObjects(sourceObjects)); operation->SetObjects(SourceToObjects(sourceObjects));
operation->VisualMode(); operation->VisualMode();
@ -253,7 +252,7 @@ void DialogFlippingByAxis::SetSourceObjects(const QVector<SourceItem> &value)
sourceObjects = value; sourceObjects = value;
FillSourceList(); FillSourceList();
VisToolFlippingByAxis *operation = qobject_cast<VisToolFlippingByAxis *>(vis); auto *operation = qobject_cast<VisToolFlippingByAxis *>(vis);
SCASSERT(operation != nullptr) SCASSERT(operation != nullptr)
operation->SetObjects(SourceToObjects(sourceObjects)); operation->SetObjects(SourceToObjects(sourceObjects));
} }
@ -276,7 +275,7 @@ void DialogFlippingByAxis::ChosenObject(quint32 id, const SceneObject &type)
if (SetObject(id, ui->comboBoxOriginPoint, QString())) if (SetObject(id, ui->comboBoxOriginPoint, QString()))
{ {
VisToolFlippingByAxis *operation = qobject_cast<VisToolFlippingByAxis *>(vis); auto *operation = qobject_cast<VisToolFlippingByAxis *>(vis);
SCASSERT(operation != nullptr) SCASSERT(operation != nullptr)
operation->SetOriginPointId(id); operation->SetOriginPointId(id);
operation->RefreshGeometry(); operation->RefreshGeometry();
@ -317,7 +316,7 @@ void DialogFlippingByAxis::SelectedObject(bool selected, quint32 object, quint32
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogFlippingByAxis::SuffixChanged() void DialogFlippingByAxis::SuffixChanged()
{ {
QLineEdit *edit = qobject_cast<QLineEdit *>(sender()); auto *edit = qobject_cast<QLineEdit *>(sender());
if (edit) if (edit)
{ {
const QString suffix = edit->text(); const QString suffix = edit->text();
@ -357,7 +356,7 @@ void DialogFlippingByAxis::SuffixChanged()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogFlippingByAxis::GroupNameChanged() void DialogFlippingByAxis::GroupNameChanged()
{ {
QLineEdit *edit = qobject_cast<QLineEdit *>(sender()); auto *edit = qobject_cast<QLineEdit *>(sender());
if (edit) if (edit)
{ {
const QString name = edit->text(); const QString name = edit->text();
@ -532,7 +531,7 @@ void DialogFlippingByAxis::SaveData()
} }
} }
VisToolFlippingByAxis *operation = qobject_cast<VisToolFlippingByAxis *>(vis); auto *operation = qobject_cast<VisToolFlippingByAxis *>(vis);
SCASSERT(operation != nullptr) SCASSERT(operation != nullptr)
operation->SetObjects(SourceToObjects(sourceObjects)); operation->SetObjects(SourceToObjects(sourceObjects));

View File

@ -112,7 +112,7 @@ auto DialogFlippingByLine::GetFirstLinePointId() const -> quint32
void DialogFlippingByLine::SetFirstLinePointId(quint32 value) void DialogFlippingByLine::SetFirstLinePointId(quint32 value)
{ {
ChangeCurrentData(ui->comboBoxFirstLinePoint, value); ChangeCurrentData(ui->comboBoxFirstLinePoint, value);
VisToolFlippingByLine *operation = qobject_cast<VisToolFlippingByLine *>(vis); auto *operation = qobject_cast<VisToolFlippingByLine *>(vis);
SCASSERT(operation != nullptr) SCASSERT(operation != nullptr)
operation->SetFirstLinePointId(value); operation->SetFirstLinePointId(value);
} }
@ -127,7 +127,7 @@ auto DialogFlippingByLine::GetSecondLinePointId() const -> quint32
void DialogFlippingByLine::SetSecondLinePointId(quint32 value) void DialogFlippingByLine::SetSecondLinePointId(quint32 value)
{ {
ChangeCurrentData(ui->comboBoxSecondLinePoint, value); ChangeCurrentData(ui->comboBoxSecondLinePoint, value);
VisToolFlippingByLine *operation = qobject_cast<VisToolFlippingByLine *>(vis); auto *operation = qobject_cast<VisToolFlippingByLine *>(vis);
SCASSERT(operation != nullptr) SCASSERT(operation != nullptr)
operation->SetSecondLinePointId(value); operation->SetSecondLinePointId(value);
} }
@ -200,12 +200,11 @@ void DialogFlippingByLine::ShowDialog(bool click)
stage1 = false; stage1 = false;
VMainGraphicsScene *scene = auto *scene = qobject_cast<VMainGraphicsScene *>(VAbstractValApplication::VApp()->getCurrentScene());
qobject_cast<VMainGraphicsScene *>(VAbstractValApplication::VApp()->getCurrentScene());
SCASSERT(scene != nullptr) SCASSERT(scene != nullptr)
scene->clearSelection(); scene->clearSelection();
VisToolFlippingByLine *operation = qobject_cast<VisToolFlippingByLine *>(vis); auto *operation = qobject_cast<VisToolFlippingByLine *>(vis);
SCASSERT(operation != nullptr) SCASSERT(operation != nullptr)
operation->SetObjects(SourceToObjects(sourceObjects)); operation->SetObjects(SourceToObjects(sourceObjects));
operation->VisualMode(); operation->VisualMode();
@ -246,7 +245,7 @@ void DialogFlippingByLine::SetSourceObjects(const QVector<SourceItem> &value)
sourceObjects = value; sourceObjects = value;
FillSourceList(); FillSourceList();
VisToolFlippingByLine *operation = qobject_cast<VisToolFlippingByLine *>(vis); auto *operation = qobject_cast<VisToolFlippingByLine *>(vis);
SCASSERT(operation != nullptr) SCASSERT(operation != nullptr)
operation->SetObjects(SourceToObjects(sourceObjects)); operation->SetObjects(SourceToObjects(sourceObjects));
} }
@ -272,7 +271,7 @@ void DialogFlippingByLine::ChosenObject(quint32 id, const SceneObject &type)
if (SetObject(id, ui->comboBoxFirstLinePoint, tr("Select second line point"))) if (SetObject(id, ui->comboBoxFirstLinePoint, tr("Select second line point")))
{ {
number++; number++;
VisToolFlippingByLine *operation = qobject_cast<VisToolFlippingByLine *>(vis); auto *operation = qobject_cast<VisToolFlippingByLine *>(vis);
SCASSERT(operation != nullptr) SCASSERT(operation != nullptr)
operation->SetFirstLinePointId(id); operation->SetFirstLinePointId(id);
operation->RefreshGeometry(); operation->RefreshGeometry();
@ -294,7 +293,7 @@ void DialogFlippingByLine::ChosenObject(quint32 id, const SceneObject &type)
number = 0; number = 0;
prepare = true; prepare = true;
VisToolFlippingByLine *operation = qobject_cast<VisToolFlippingByLine *>(vis); auto *operation = qobject_cast<VisToolFlippingByLine *>(vis);
SCASSERT(operation != nullptr) SCASSERT(operation != nullptr)
operation->SetSecondLinePointId(id); operation->SetSecondLinePointId(id);
operation->RefreshGeometry(); operation->RefreshGeometry();
@ -339,7 +338,7 @@ void DialogFlippingByLine::SelectedObject(bool selected, quint32 object, quint32
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogFlippingByLine::SuffixChanged() void DialogFlippingByLine::SuffixChanged()
{ {
QLineEdit *edit = qobject_cast<QLineEdit *>(sender()); auto *edit = qobject_cast<QLineEdit *>(sender());
if (edit) if (edit)
{ {
const QString suffix = edit->text(); const QString suffix = edit->text();
@ -379,7 +378,7 @@ void DialogFlippingByLine::SuffixChanged()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogFlippingByLine::GroupNameChanged() void DialogFlippingByLine::GroupNameChanged()
{ {
QLineEdit *edit = qobject_cast<QLineEdit *>(sender()); auto *edit = qobject_cast<QLineEdit *>(sender());
if (edit) if (edit)
{ {
const QString name = edit->text(); const QString name = edit->text();
@ -555,7 +554,7 @@ void DialogFlippingByLine::SaveData()
} }
} }
VisToolFlippingByLine *operation = qobject_cast<VisToolFlippingByLine *>(vis); auto *operation = qobject_cast<VisToolFlippingByLine *>(vis);
SCASSERT(operation != nullptr) SCASSERT(operation != nullptr)
operation->SetObjects(SourceToObjects(sourceObjects)); operation->SetObjects(SourceToObjects(sourceObjects));

View File

@ -91,7 +91,7 @@ void DialogLine::SetSecondPoint(quint32 value)
{ {
setCurrentPointId(ui->comboBoxSecondPoint, value); setCurrentPointId(ui->comboBoxSecondPoint, value);
VisToolLine *line = qobject_cast<VisToolLine *>(vis); auto *line = qobject_cast<VisToolLine *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->SetPoint2Id(value); line->SetPoint2Id(value);
} }
@ -128,7 +128,7 @@ void DialogLine::SetFirstPoint(quint32 value)
{ {
setCurrentPointId(ui->comboBoxFirstPoint, value); setCurrentPointId(ui->comboBoxFirstPoint, value);
VisToolLine *line = qobject_cast<VisToolLine *>(vis); auto *line = qobject_cast<VisToolLine *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->SetPoint1Id(value); line->SetPoint1Id(value);
} }
@ -161,7 +161,7 @@ void DialogLine::ShowVisualization()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogLine::SaveData() void DialogLine::SaveData()
{ {
VisToolLine *line = qobject_cast<VisToolLine *>(vis); auto *line = qobject_cast<VisToolLine *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->SetPoint1Id(GetFirstPoint()); line->SetPoint1Id(GetFirstPoint());

View File

@ -112,7 +112,7 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type)
{ {
if (type == SceneObject::Point) if (type == SceneObject::Point)
{ {
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis); auto *line = qobject_cast<VisToolLineIntersect *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
switch (number) switch (number)
@ -193,7 +193,7 @@ void DialogLineIntersect::SaveData()
{ {
pointName = ui->lineEditNamePoint->text(); pointName = ui->lineEditNamePoint->text();
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis); auto *line = qobject_cast<VisToolLineIntersect *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->SetLine1P1Id(GetP1Line1()); line->SetLine1P1Id(GetP1Line1());
@ -298,7 +298,7 @@ void DialogLineIntersect::SetP2Line2(quint32 value)
{ {
setCurrentPointId(ui->comboBoxP2Line2, value); setCurrentPointId(ui->comboBoxP2Line2, value);
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis); auto *line = qobject_cast<VisToolLineIntersect *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->SetLine2P2Id(value); line->SetLine2P2Id(value);
} }
@ -318,7 +318,7 @@ void DialogLineIntersect::SetP1Line2(quint32 value)
{ {
setCurrentPointId(ui->comboBoxP1Line2, value); setCurrentPointId(ui->comboBoxP1Line2, value);
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis); auto *line = qobject_cast<VisToolLineIntersect *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->SetLine2P1Id(value); line->SetLine2P1Id(value);
} }
@ -332,7 +332,7 @@ void DialogLineIntersect::SetP2Line1(quint32 value)
{ {
setCurrentPointId(ui->comboBoxP2Line1, value); setCurrentPointId(ui->comboBoxP2Line1, value);
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis); auto *line = qobject_cast<VisToolLineIntersect *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->SetLine1P2Id(value); line->SetLine1P2Id(value);
} }
@ -346,7 +346,7 @@ void DialogLineIntersect::SetP1Line1(quint32 value)
{ {
setCurrentPointId(ui->comboBoxP1Line1, value); setCurrentPointId(ui->comboBoxP1Line1, value);
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis); auto *line = qobject_cast<VisToolLineIntersect *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->SetLine1P1Id(value); line->SetLine1P1Id(value);
} }

View File

@ -169,7 +169,7 @@ void DialogLineIntersectAxis::SetAngle(const QString &value)
} }
ui->plainTextEditFormula->setPlainText(formulaAngle); ui->plainTextEditFormula->setPlainText(formulaAngle);
VisToolLineIntersectAxis *line = qobject_cast<VisToolLineIntersectAxis *>(vis); auto *line = qobject_cast<VisToolLineIntersectAxis *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->SetAngle(formulaAngle); line->SetAngle(formulaAngle);
@ -187,7 +187,7 @@ void DialogLineIntersectAxis::SetBasePointId(quint32 value)
{ {
setCurrentPointId(ui->comboBoxAxisPoint, value); setCurrentPointId(ui->comboBoxAxisPoint, value);
VisToolLineIntersectAxis *line = qobject_cast<VisToolLineIntersectAxis *>(vis); auto *line = qobject_cast<VisToolLineIntersectAxis *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->SetAxisPointId(value); line->SetAxisPointId(value);
} }
@ -203,7 +203,7 @@ void DialogLineIntersectAxis::SetFirstPointId(quint32 value)
{ {
setCurrentPointId(ui->comboBoxFirstLinePoint, value); setCurrentPointId(ui->comboBoxFirstLinePoint, value);
VisToolLineIntersectAxis *line = qobject_cast<VisToolLineIntersectAxis *>(vis); auto *line = qobject_cast<VisToolLineIntersectAxis *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->SetPoint1Id(value); line->SetPoint1Id(value);
} }
@ -219,7 +219,7 @@ void DialogLineIntersectAxis::SetSecondPointId(quint32 value)
{ {
setCurrentPointId(ui->comboBoxSecondLinePoint, value); setCurrentPointId(ui->comboBoxSecondLinePoint, value);
VisToolLineIntersectAxis *line = qobject_cast<VisToolLineIntersectAxis *>(vis); auto *line = qobject_cast<VisToolLineIntersectAxis *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->SetPoint2Id(value); line->SetPoint2Id(value);
} }
@ -410,7 +410,7 @@ void DialogLineIntersectAxis::SaveData()
pointName = ui->lineEditNamePoint->text(); pointName = ui->lineEditNamePoint->text();
formulaAngle = ui->plainTextEditFormula->toPlainText(); formulaAngle = ui->plainTextEditFormula->toPlainText();
VisToolLineIntersectAxis *line = qobject_cast<VisToolLineIntersectAxis *>(vis); auto *line = qobject_cast<VisToolLineIntersectAxis *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->SetPoint1Id(GetFirstPointId()); line->SetPoint1Id(GetFirstPointId());

View File

@ -101,7 +101,7 @@ void DialogPointFromArcAndTangent::SetArcId(quint32 value)
{ {
setCurrentArcId(ui->comboBoxArc, value); setCurrentArcId(ui->comboBoxArc, value);
VisToolPointFromArcAndTangent *point = qobject_cast<VisToolPointFromArcAndTangent *>(vis); auto *point = qobject_cast<VisToolPointFromArcAndTangent *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->SetArcId(value); point->SetArcId(value);
} }
@ -136,7 +136,7 @@ void DialogPointFromArcAndTangent::SetCrossCirclesPoint(CrossCirclesPoint p)
{ {
ui->comboBoxResult->setCurrentIndex(index); ui->comboBoxResult->setCurrentIndex(index);
VisToolPointFromArcAndTangent *point = qobject_cast<VisToolPointFromArcAndTangent *>(vis); auto *point = qobject_cast<VisToolPointFromArcAndTangent *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->SetCrossPoint(p); point->SetCrossPoint(p);
} }
@ -149,7 +149,7 @@ void DialogPointFromArcAndTangent::ChosenObject(quint32 id, const SceneObject &t
{ {
if (type == SceneObject::Point || type == SceneObject::Arc) if (type == SceneObject::Point || type == SceneObject::Arc)
{ {
VisToolPointFromArcAndTangent *point = qobject_cast<VisToolPointFromArcAndTangent *>(vis); auto *point = qobject_cast<VisToolPointFromArcAndTangent *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
switch (number) switch (number)

View File

@ -104,7 +104,7 @@ void DialogPointOfIntersection::SetSecondPointId(quint32 value)
{ {
setCurrentPointId(ui->comboBoxSecondPoint, value); setCurrentPointId(ui->comboBoxSecondPoint, value);
VisToolPointOfIntersection *line = qobject_cast<VisToolPointOfIntersection *>(vis); auto *line = qobject_cast<VisToolPointOfIntersection *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->SetPoint2Id(value); line->SetPoint2Id(value);
} }
@ -121,7 +121,7 @@ void DialogPointOfIntersection::ChosenObject(quint32 id, const SceneObject &type
{ {
if (type == SceneObject::Point) if (type == SceneObject::Point)
{ {
VisToolPointOfIntersection *line = qobject_cast<VisToolPointOfIntersection *>(vis); auto *line = qobject_cast<VisToolPointOfIntersection *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
switch (number) switch (number)
@ -158,7 +158,7 @@ void DialogPointOfIntersection::SaveData()
{ {
pointName = ui->lineEditNamePoint->text(); pointName = ui->lineEditNamePoint->text();
VisToolPointOfIntersection *line = qobject_cast<VisToolPointOfIntersection *>(vis); auto *line = qobject_cast<VisToolPointOfIntersection *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->SetPoint1Id(GetFirstPointId()); line->SetPoint1Id(GetFirstPointId());
@ -200,7 +200,7 @@ void DialogPointOfIntersection::SetFirstPointId(quint32 value)
{ {
setCurrentPointId(ui->comboBoxFirstPoint, value); setCurrentPointId(ui->comboBoxFirstPoint, value);
VisToolPointOfIntersection *line = qobject_cast<VisToolPointOfIntersection *>(vis); auto *line = qobject_cast<VisToolPointOfIntersection *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->SetPoint1Id(value); line->SetPoint1Id(value);
} }

View File

@ -106,7 +106,7 @@ void DialogPointOfIntersectionArcs::SetFirstArcId(quint32 value)
{ {
setCurrentArcId(ui->comboBoxArc1, value); setCurrentArcId(ui->comboBoxArc1, value);
VisToolPointOfIntersectionArcs *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis); auto *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->SetArc1Id(value); point->SetArc1Id(value);
} }
@ -122,7 +122,7 @@ void DialogPointOfIntersectionArcs::SetSecondArcId(quint32 value)
{ {
setCurrentArcId(ui->comboBoxArc2, value); setCurrentArcId(ui->comboBoxArc2, value);
VisToolPointOfIntersectionArcs *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis); auto *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->SetArc2Id(value); point->SetArc2Id(value);
} }
@ -141,7 +141,7 @@ void DialogPointOfIntersectionArcs::SetCrossArcPoint(CrossCirclesPoint p)
{ {
ui->comboBoxResult->setCurrentIndex(index); ui->comboBoxResult->setCurrentIndex(index);
VisToolPointOfIntersectionArcs *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis); auto *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->SetCrossPoint(p); point->SetCrossPoint(p);
} }
@ -154,7 +154,7 @@ void DialogPointOfIntersectionArcs::ChosenObject(quint32 id, const SceneObject &
{ {
if (type == SceneObject::Arc) if (type == SceneObject::Arc)
{ {
VisToolPointOfIntersectionArcs *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis); auto *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
switch (number) switch (number)
@ -216,7 +216,7 @@ void DialogPointOfIntersectionArcs::SaveData()
{ {
pointName = ui->lineEditNamePoint->text(); pointName = ui->lineEditNamePoint->text();
VisToolPointOfIntersectionArcs *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis); auto *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->SetArc1Id(GetFirstArcId()); point->SetArc1Id(GetFirstArcId());

View File

@ -432,7 +432,7 @@ void DialogTool::NewNodeItem(QListWidget *listWidget, const VPieceNode &node, bo
if (canAddNewPoint) if (canAddNewPoint)
{ {
QListWidgetItem *item = new QListWidgetItem(name); auto *item = new QListWidgetItem(name);
item->setFont(NodeFont(item->font(), showExclusion ? node.IsExcluded() : false)); item->setFont(NodeFont(item->font(), showExclusion ? node.IsExcluded() : false));
item->setData(Qt::UserRole, QVariant::fromValue(node)); item->setData(Qt::UserRole, QVariant::fromValue(node));
listWidget->addItem(item); listWidget->addItem(item);

View File

@ -292,8 +292,7 @@ template <typename T> inline void DialogTool::AddVisualization()
{ {
if (prepare == false) if (prepare == false)
{ {
VMainGraphicsScene *scene = auto *scene = qobject_cast<VMainGraphicsScene *>(VAbstractValApplication::VApp()->getCurrentScene());
qobject_cast<VMainGraphicsScene *>(VAbstractValApplication::VApp()->getCurrentScene());
SCASSERT(scene != nullptr) SCASSERT(scene != nullptr)
T *toolVis = qobject_cast<T *>(vis); T *toolVis = qobject_cast<T *>(vis);

View File

@ -103,7 +103,7 @@ void DialogTriangle::ChosenObject(quint32 id, const SceneObject &type)
{ {
if (type == SceneObject::Point) if (type == SceneObject::Point)
{ {
VisToolTriangle *line = qobject_cast<VisToolTriangle *>(vis); auto *line = qobject_cast<VisToolTriangle *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
switch (number) switch (number)
@ -176,7 +176,7 @@ void DialogTriangle::SaveData()
{ {
pointName = ui->lineEditNamePoint->text(); pointName = ui->lineEditNamePoint->text();
VisToolTriangle *line = qobject_cast<VisToolTriangle *>(vis); auto *line = qobject_cast<VisToolTriangle *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->SetObject1Id(GetAxisP1Id()); line->SetObject1Id(GetAxisP1Id());
@ -239,7 +239,7 @@ void DialogTriangle::SetSecondPointId(const quint32 &value)
{ {
setCurrentPointId(ui->comboBoxSecondPoint, value); setCurrentPointId(ui->comboBoxSecondPoint, value);
VisToolTriangle *line = qobject_cast<VisToolTriangle *>(vis); auto *line = qobject_cast<VisToolTriangle *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->SetHypotenuseP2Id(value); line->SetHypotenuseP2Id(value);
} }
@ -259,7 +259,7 @@ void DialogTriangle::SetFirstPointId(const quint32 &value)
{ {
setCurrentPointId(ui->comboBoxFirstPoint, value); setCurrentPointId(ui->comboBoxFirstPoint, value);
VisToolTriangle *line = qobject_cast<VisToolTriangle *>(vis); auto *line = qobject_cast<VisToolTriangle *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->SetHypotenuseP1Id(value); line->SetHypotenuseP1Id(value);
} }
@ -273,7 +273,7 @@ void DialogTriangle::SetAxisP2Id(const quint32 &value)
{ {
setCurrentPointId(ui->comboBoxAxisP2, value); setCurrentPointId(ui->comboBoxAxisP2, value);
VisToolTriangle *line = qobject_cast<VisToolTriangle *>(vis); auto *line = qobject_cast<VisToolTriangle *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->SetObject2Id(value); line->SetObject2Id(value);
} }
@ -287,7 +287,7 @@ void DialogTriangle::SetAxisP1Id(const quint32 &value)
{ {
setCurrentPointId(ui->comboBoxAxisP1, value); setCurrentPointId(ui->comboBoxAxisP1, value);
VisToolTriangle *line = qobject_cast<VisToolTriangle *>(vis); auto *line = qobject_cast<VisToolTriangle *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->SetObject1Id(value); line->SetObject1Id(value);
} }

View File

@ -137,7 +137,7 @@ void DialogTrueDarts::SetFirstBasePointId(const quint32 &value)
{ {
setCurrentPointId(ui->comboBoxFirstBasePoint, value, FillComboBox::NoChildren, ch1, ch2); setCurrentPointId(ui->comboBoxFirstBasePoint, value, FillComboBox::NoChildren, ch1, ch2);
VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis); auto *points = qobject_cast<VisToolTrueDarts *>(vis);
SCASSERT(points != nullptr) SCASSERT(points != nullptr)
points->SetBaseLineP1Id(value); points->SetBaseLineP1Id(value);
} }
@ -153,7 +153,7 @@ void DialogTrueDarts::SetSecondBasePointId(const quint32 &value)
{ {
setCurrentPointId(ui->comboBoxSecondBasePoint, value, FillComboBox::NoChildren, ch1, ch2); setCurrentPointId(ui->comboBoxSecondBasePoint, value, FillComboBox::NoChildren, ch1, ch2);
VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis); auto *points = qobject_cast<VisToolTrueDarts *>(vis);
SCASSERT(points != nullptr) SCASSERT(points != nullptr)
points->SetBaseLineP2Id(value); points->SetBaseLineP2Id(value);
} }
@ -169,7 +169,7 @@ void DialogTrueDarts::SetFirstDartPointId(const quint32 &value)
{ {
setCurrentPointId(ui->comboBoxFirstDartPoint, value, FillComboBox::NoChildren, ch1, ch2); setCurrentPointId(ui->comboBoxFirstDartPoint, value, FillComboBox::NoChildren, ch1, ch2);
VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis); auto *points = qobject_cast<VisToolTrueDarts *>(vis);
SCASSERT(points != nullptr) SCASSERT(points != nullptr)
points->SetD1PointId(value); points->SetD1PointId(value);
} }
@ -185,7 +185,7 @@ void DialogTrueDarts::SetSecondDartPointId(const quint32 &value)
{ {
setCurrentPointId(ui->comboBoxSecondDartPoint, value, FillComboBox::NoChildren, ch1, ch2); setCurrentPointId(ui->comboBoxSecondDartPoint, value, FillComboBox::NoChildren, ch1, ch2);
VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis); auto *points = qobject_cast<VisToolTrueDarts *>(vis);
SCASSERT(points != nullptr) SCASSERT(points != nullptr)
points->SetD2PointId(value); points->SetD2PointId(value);
} }
@ -201,7 +201,7 @@ void DialogTrueDarts::SetThirdDartPointId(const quint32 &value)
{ {
setCurrentPointId(ui->comboBoxThirdDartPoint, value, FillComboBox::NoChildren, ch1, ch2); setCurrentPointId(ui->comboBoxThirdDartPoint, value, FillComboBox::NoChildren, ch1, ch2);
VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis); auto *points = qobject_cast<VisToolTrueDarts *>(vis);
SCASSERT(points != nullptr) SCASSERT(points != nullptr)
points->SetD3PointId(value); points->SetD3PointId(value);
} }
@ -221,7 +221,7 @@ void DialogTrueDarts::ChosenObject(quint32 id, const SceneObject &type)
{ {
if (type == SceneObject::Point) if (type == SceneObject::Point)
{ {
VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis); auto *points = qobject_cast<VisToolTrueDarts *>(vis);
SCASSERT(points != nullptr) SCASSERT(points != nullptr)
switch (number) switch (number)
@ -362,7 +362,7 @@ void DialogTrueDarts::SaveData()
d1PointName = ui->lineEditFirstNewDartPoint->text(); d1PointName = ui->lineEditFirstNewDartPoint->text();
d2PointName = ui->lineEditSecondNewDartPoint->text(); d2PointName = ui->lineEditSecondNewDartPoint->text();
VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis); auto *points = qobject_cast<VisToolTrueDarts *>(vis);
SCASSERT(points != nullptr) SCASSERT(points != nullptr)
points->SetBaseLineP1Id(GetFirstBasePointId()); points->SetBaseLineP1Id(GetFirstBasePointId());
@ -379,7 +379,7 @@ void DialogTrueDarts::NameChanged(QLabel *labelEditNamePoint, const QString &poi
{ {
SCASSERT(labelEditNamePoint != nullptr) SCASSERT(labelEditNamePoint != nullptr)
SCASSERT(secondPointName != nullptr) SCASSERT(secondPointName != nullptr)
QLineEdit *edit = qobject_cast<QLineEdit *>(sender()); auto *edit = qobject_cast<QLineEdit *>(sender());
if (edit) if (edit)
{ {
CheckName(edit, labelEditNamePoint, pointD1Name, pointD2Name, secondPointName, flagName); CheckName(edit, labelEditNamePoint, pointD1Name, pointD2Name, secondPointName, flagName);

View File

@ -67,7 +67,7 @@ void DialogDuplicateDetail::ShowDialog(bool click)
return; return;
} }
VisToolDuplicateDetail *piece = qobject_cast<VisToolDuplicateDetail *>(vis); auto *piece = qobject_cast<VisToolDuplicateDetail *>(vis);
SCASSERT(piece != nullptr) SCASSERT(piece != nullptr)
m_mx = piece->Mx(); m_mx = piece->Mx();
@ -87,7 +87,7 @@ void DialogDuplicateDetail::ChosenObject(quint32 id, const SceneObject &type)
{ {
m_idDetail = id; m_idDetail = id;
VAbstractTool *tool = qobject_cast<VAbstractTool *>(VAbstractPattern::getTool(m_idDetail)); auto *tool = qobject_cast<VAbstractTool *>(VAbstractPattern::getTool(m_idDetail));
if (tool) if (tool)
{ {
vis->SetData(tool->getData()); // Includes currentSeamAllowance variable we need vis->SetData(tool->getData()); // Includes currentSeamAllowance variable we need

View File

@ -101,7 +101,7 @@ auto DialogInsertNode::GetNodes() const -> QVector<VPieceNode>
QVector<VPieceNode> nodes; QVector<VPieceNode> nodes;
for (qint32 i = 0; i < ui->listWidget->count(); ++i) for (qint32 i = 0; i < ui->listWidget->count(); ++i)
{ {
VPieceNode const node = qvariant_cast<VPieceNode>(ui->listWidget->item(i)->data(Qt::UserRole)); auto const node = qvariant_cast<VPieceNode>(ui->listWidget->item(i)->data(Qt::UserRole));
for (int n = 1; n <= nodeNumbers.value(node.GetId(), 1); ++n) for (int n = 1; n <= nodeNumbers.value(node.GetId(), 1); ++n)
{ {
nodes.append(node); nodes.append(node);
@ -242,7 +242,7 @@ void DialogInsertNode::NodeSelected()
return; return;
} }
VPieceNode const node = qvariant_cast<VPieceNode>(item->data(Qt::UserRole)); auto const node = qvariant_cast<VPieceNode>(item->data(Qt::UserRole));
ui->spinBoxNodeNumber->setEnabled(true); ui->spinBoxNodeNumber->setEnabled(true);
ui->spinBoxNodeNumber->blockSignals(true); ui->spinBoxNodeNumber->blockSignals(true);
ui->spinBoxNodeNumber->setValue(nodeNumbers.value(node.GetId(), 1)); ui->spinBoxNodeNumber->setValue(nodeNumbers.value(node.GetId(), 1));
@ -259,7 +259,7 @@ void DialogInsertNode::NodeNumberChanged(int val)
return; return;
} }
VPieceNode const node = qvariant_cast<VPieceNode>(item->data(Qt::UserRole)); auto const node = qvariant_cast<VPieceNode>(item->data(Qt::UserRole));
nodeNumbers[node.GetId()] = val; nodeNumbers[node.GetId()] = val;
} }

View File

@ -84,7 +84,7 @@ void DialogPatternMaterials::SetPatternMaterials(const QMap<int, QString> &list)
for (int i = 0; i < userMaterialPlaceholdersQuantity; ++i) for (int i = 0; i < userMaterialPlaceholdersQuantity; ++i)
{ {
QTableWidgetItem *item = new QTableWidgetItem(per + pl_userMaterial + QString::number(i + 1) + per); auto *item = new QTableWidgetItem(per + pl_userMaterial + QString::number(i + 1) + per);
item->setFlags(item->flags() ^ Qt::ItemIsEditable); item->setFlags(item->flags() ^ Qt::ItemIsEditable);
item->setTextAlignment(Qt::AlignLeft); item->setTextAlignment(Qt::AlignLeft);

View File

@ -100,7 +100,7 @@ void DialogPin::SetPointId(quint32 id)
{ {
setCurrentPointId(ui->comboBoxPoint, id); setCurrentPointId(ui->comboBoxPoint, id);
VisToolSpecialPoint *point = qobject_cast<VisToolSpecialPoint *>(vis); auto *point = qobject_cast<VisToolSpecialPoint *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->SetPointId(id); point->SetPointId(id);

View File

@ -97,7 +97,7 @@ void DialogPlaceLabel::SetCenterPoint(quint32 id)
if (not m_showMode) if (not m_showMode)
{ {
VisToolSpecialPoint *point = qobject_cast<VisToolSpecialPoint *>(vis); auto *point = qobject_cast<VisToolSpecialPoint *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->SetPointId(id); point->SetPointId(id);
} }

View File

@ -133,7 +133,7 @@ auto VToolFlippingByAxis::Create(VToolFlippingByAxisInitData initData) -> VToolF
} }
VAbstractTool::AddRecord(initData.id, Tool::FlippingByAxis, initData.doc); VAbstractTool::AddRecord(initData.id, Tool::FlippingByAxis, initData.doc);
VToolFlippingByAxis *tool = new VToolFlippingByAxis(initData); auto *tool = new VToolFlippingByAxis(initData);
initData.scene->addItem(tool); initData.scene->addItem(tool);
InitOperationToolConnections(initData.scene, tool); InitOperationToolConnections(initData.scene, tool);
VAbstractPattern::AddTool(initData.id, tool); VAbstractPattern::AddTool(initData.id, tool);

View File

@ -126,7 +126,7 @@ auto VToolFlippingByLine::Create(VToolFlippingByLineInitData initData) -> VToolF
} }
VAbstractTool::AddRecord(initData.id, Tool::FlippingByLine, initData.doc); VAbstractTool::AddRecord(initData.id, Tool::FlippingByLine, initData.doc);
VToolFlippingByLine *tool = new VToolFlippingByLine(initData); auto *tool = new VToolFlippingByLine(initData);
initData.scene->addItem(tool); initData.scene->addItem(tool);
InitOperationToolConnections(initData.scene, tool); InitOperationToolConnections(initData.scene, tool);
VAbstractPattern::AddTool(initData.id, tool); VAbstractPattern::AddTool(initData.id, tool);

View File

@ -155,7 +155,7 @@ auto VToolArcWithLength::Create(VToolArcWithLengthInitData &initData) -> VToolAr
if (initData.parse == Document::FullParse) if (initData.parse == Document::FullParse)
{ {
VAbstractTool::AddRecord(initData.id, Tool::ArcWithLength, initData.doc); VAbstractTool::AddRecord(initData.id, Tool::ArcWithLength, initData.doc);
VToolArcWithLength *toolArc = new VToolArcWithLength(initData); auto *toolArc = new VToolArcWithLength(initData);
initData.scene->addItem(toolArc); initData.scene->addItem(toolArc);
InitArcToolConnections(initData.scene, toolArc); InitArcToolConnections(initData.scene, toolArc);
VAbstractPattern::AddTool(initData.id, toolArc); VAbstractPattern::AddTool(initData.id, toolArc);

View File

@ -157,9 +157,8 @@ auto VToolEllipticalArc::Create(VToolEllipticalArcInitData &initData) -> VToolEl
calcRotationAngle = CheckFormula(initData.id, initData.rotationAngle, initData.data); calcRotationAngle = CheckFormula(initData.id, initData.rotationAngle, initData.data);
const VPointF c = *initData.data->GeometricObject<VPointF>(initData.center); const VPointF c = *initData.data->GeometricObject<VPointF>(initData.center);
VEllipticalArc *elArc = auto *elArc = new VEllipticalArc(c, calcRadius1, calcRadius2, initData.radius1, initData.radius2, calcF1,
new VEllipticalArc(c, calcRadius1, calcRadius2, initData.radius1, initData.radius2, calcF1, initData.f1, calcF2, initData.f1, calcF2, initData.f2, calcRotationAngle, initData.rotationAngle);
initData.f2, calcRotationAngle, initData.rotationAngle);
elArc->SetColor(initData.color); elArc->SetColor(initData.color);
elArc->SetPenStyle(initData.penStyle); elArc->SetPenStyle(initData.penStyle);
elArc->SetApproximationScale(initData.approximationScale); elArc->SetApproximationScale(initData.approximationScale);

View File

@ -128,7 +128,7 @@ auto VToolSplinePath::Create(const QPointer<DialogTool> &dialog, VMainGraphicsSc
initData.typeCreation = Source::FromGui; initData.typeCreation = Source::FromGui;
initData.notes = dialogTool->GetNotes(); initData.notes = dialogTool->GetNotes();
VSplinePath *path = new VSplinePath(dialogTool->GetPath()); auto *path = new VSplinePath(dialogTool->GetPath());
for (qint32 i = 0; i < path->CountPoints(); ++i) for (qint32 i = 0; i < path->CountPoints(); ++i)
{ {
doc->IncrementReferens((*path)[i].P().getIdTool()); doc->IncrementReferens((*path)[i].P().getIdTool());
@ -170,7 +170,7 @@ auto VToolSplinePath::Create(VToolSplinePathInitData &initData, VSplinePath *pat
if (initData.parse == Document::FullParse) if (initData.parse == Document::FullParse)
{ {
VAbstractTool::AddRecord(initData.id, Tool::SplinePath, initData.doc); VAbstractTool::AddRecord(initData.id, Tool::SplinePath, initData.doc);
VToolSplinePath *spl = new VToolSplinePath(initData); auto *spl = new VToolSplinePath(initData);
initData.scene->addItem(spl); initData.scene->addItem(spl);
InitSplinePathToolConnections(initData.scene, spl); InitSplinePathToolConnections(initData.scene, spl);
VAbstractPattern::AddTool(initData.id, spl); VAbstractPattern::AddTool(initData.id, spl);

View File

@ -143,7 +143,7 @@ auto VToolCutSplinePath::Create(VToolCutInitData &initData) -> VToolCutSplinePat
SCASSERT(splPath != nullptr) SCASSERT(splPath != nullptr)
// Declare special variable "CurrentLength" // Declare special variable "CurrentLength"
VCurveLength *length = auto *length =
new VCurveLength(initData.baseCurveId, initData.baseCurveId, splPath.data(), *initData.data->GetPatternUnit()); new VCurveLength(initData.baseCurveId, initData.baseCurveId, splPath.data(), *initData.data->GetPatternUnit());
length->SetName(currentLength); length->SetName(currentLength);
initData.data->AddVariable(length); initData.data->AddVariable(length);
@ -228,7 +228,7 @@ auto VToolCutSplinePath::CutSplinePath(qreal length, const QSharedPointer<VAbstr
qint32 p1 = 0, p2 = 0; qint32 p1 = 0, p2 = 0;
const QPointF point = splPath->CutSplinePath(length, p1, p2, spl1p2, spl1p3, spl2p2, spl2p3, pName); const QPointF point = splPath->CutSplinePath(length, p1, p2, spl1p2, spl1p3, spl2p2, spl2p3, pName);
VPointF *p = new VPointF(point); auto *p = new VPointF(point);
p->setName(pName); p->setName(pName);
const QVector<VSplinePoint> points = splPath->GetSplinePath(); const QVector<VSplinePoint> points = splPath->GetSplinePath();

View File

@ -175,7 +175,7 @@ auto VToolBisector::Create(VToolBisectorInitData &initData) -> VToolBisector *
VToolBisector::FindPoint(static_cast<QPointF>(*firstPoint), static_cast<QPointF>(*secondPoint), VToolBisector::FindPoint(static_cast<QPointF>(*firstPoint), static_cast<QPointF>(*secondPoint),
static_cast<QPointF>(*thirdPoint), VAbstractValApplication::VApp()->toPixel(result)); static_cast<QPointF>(*thirdPoint), VAbstractValApplication::VApp()->toPixel(result));
VPointF *p = new VPointF(fPoint, initData.name, initData.mx, initData.my); auto *p = new VPointF(fPoint, initData.name, initData.mx, initData.my);
p->SetShowLabel(initData.showLabel); p->SetShowLabel(initData.showLabel);
if (initData.typeCreation == Source::FromGui) if (initData.typeCreation == Source::FromGui)
@ -196,7 +196,7 @@ auto VToolBisector::Create(VToolBisectorInitData &initData) -> VToolBisector *
if (initData.parse == Document::FullParse) if (initData.parse == Document::FullParse)
{ {
VAbstractTool::AddRecord(initData.id, Tool::Bisector, initData.doc); VAbstractTool::AddRecord(initData.id, Tool::Bisector, initData.doc);
VToolBisector *point = new VToolBisector(initData); auto *point = new VToolBisector(initData);
initData.scene->addItem(point); initData.scene->addItem(point);
InitToolConnections(initData.scene, point); InitToolConnections(initData.scene, point);
VAbstractPattern::AddTool(initData.id, point); VAbstractPattern::AddTool(initData.id, point);

View File

@ -139,7 +139,7 @@ auto VToolEndLine::Create(VToolEndLineInitData &initData) -> VToolEndLine *
line.setLength( line.setLength(
VAbstractValApplication::VApp()->toPixel(CheckFormula(initData.id, initData.formulaLength, initData.data))); VAbstractValApplication::VApp()->toPixel(CheckFormula(initData.id, initData.formulaLength, initData.data)));
VPointF *p = new VPointF(line.p2(), initData.name, initData.mx, initData.my); auto *p = new VPointF(line.p2(), initData.name, initData.mx, initData.my);
p->SetShowLabel(initData.showLabel); p->SetShowLabel(initData.showLabel);
if (initData.typeCreation == Source::FromGui) if (initData.typeCreation == Source::FromGui)
@ -160,7 +160,7 @@ auto VToolEndLine::Create(VToolEndLineInitData &initData) -> VToolEndLine *
if (initData.parse == Document::FullParse) if (initData.parse == Document::FullParse)
{ {
VAbstractTool::AddRecord(initData.id, Tool::EndLine, initData.doc); VAbstractTool::AddRecord(initData.id, Tool::EndLine, initData.doc);
VToolEndLine *point = new VToolEndLine(initData); auto *point = new VToolEndLine(initData);
initData.scene->addItem(point); initData.scene->addItem(point);
InitToolConnections(initData.scene, point); InitToolConnections(initData.scene, point);
VAbstractPattern::AddTool(initData.id, point); VAbstractPattern::AddTool(initData.id, point);

View File

@ -141,7 +141,7 @@ auto VToolHeight::Create(VToolHeightInitData initData) -> VToolHeight *
QPointF const pHeight = FindPoint(QLineF(static_cast<QPointF>(*p1Line), static_cast<QPointF>(*p2Line)), QPointF const pHeight = FindPoint(QLineF(static_cast<QPointF>(*p1Line), static_cast<QPointF>(*p2Line)),
static_cast<QPointF>(*basePoint)); static_cast<QPointF>(*basePoint));
VPointF *p = new VPointF(pHeight, initData.name, initData.mx, initData.my); auto *p = new VPointF(pHeight, initData.name, initData.mx, initData.my);
p->SetShowLabel(initData.showLabel); p->SetShowLabel(initData.showLabel);
if (initData.typeCreation == Source::FromGui) if (initData.typeCreation == Source::FromGui)
@ -166,7 +166,7 @@ auto VToolHeight::Create(VToolHeightInitData initData) -> VToolHeight *
if (initData.parse == Document::FullParse) if (initData.parse == Document::FullParse)
{ {
VAbstractTool::AddRecord(initData.id, Tool::Height, initData.doc); VAbstractTool::AddRecord(initData.id, Tool::Height, initData.doc);
VToolHeight *point = new VToolHeight(initData); auto *point = new VToolHeight(initData);
initData.scene->addItem(point); initData.scene->addItem(point);
InitToolConnections(initData.scene, point); InitToolConnections(initData.scene, point);
VAbstractPattern::AddTool(initData.id, point); VAbstractPattern::AddTool(initData.id, point);

View File

@ -141,7 +141,7 @@ auto VToolLineIntersectAxis::Create(VToolLineIntersectAxisInitData &initData) ->
: qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; : qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg;
} }
VPointF *p = new VPointF(fPoint, initData.name, initData.mx, initData.my); auto *p = new VPointF(fPoint, initData.name, initData.mx, initData.my);
p->SetShowLabel(initData.showLabel); p->SetShowLabel(initData.showLabel);
if (initData.typeCreation == Source::FromGui) if (initData.typeCreation == Source::FromGui)
@ -166,7 +166,7 @@ auto VToolLineIntersectAxis::Create(VToolLineIntersectAxisInitData &initData) ->
if (initData.parse == Document::FullParse) if (initData.parse == Document::FullParse)
{ {
VAbstractTool::AddRecord(initData.id, Tool::LineIntersectAxis, initData.doc); VAbstractTool::AddRecord(initData.id, Tool::LineIntersectAxis, initData.doc);
VToolLineIntersectAxis *point = new VToolLineIntersectAxis(initData); auto *point = new VToolLineIntersectAxis(initData);
initData.scene->addItem(point); initData.scene->addItem(point);
InitToolConnections(initData.scene, point); InitToolConnections(initData.scene, point);
VAbstractPattern::AddTool(initData.id, point); VAbstractPattern::AddTool(initData.id, point);

View File

@ -141,7 +141,7 @@ auto VToolNormal::Create(VToolNormalInitData initData) -> VToolNormal *
QPointF const fPoint = VToolNormal::FindPoint(static_cast<QPointF>(*firstPoint), static_cast<QPointF>(*secondPoint), QPointF const fPoint = VToolNormal::FindPoint(static_cast<QPointF>(*firstPoint), static_cast<QPointF>(*secondPoint),
VAbstractValApplication::VApp()->toPixel(result), initData.angle); VAbstractValApplication::VApp()->toPixel(result), initData.angle);
VPointF *p = new VPointF(fPoint, initData.name, initData.mx, initData.my); auto *p = new VPointF(fPoint, initData.name, initData.mx, initData.my);
p->SetShowLabel(initData.showLabel); p->SetShowLabel(initData.showLabel);
if (initData.typeCreation == Source::FromGui) if (initData.typeCreation == Source::FromGui)
@ -162,7 +162,7 @@ auto VToolNormal::Create(VToolNormalInitData initData) -> VToolNormal *
if (initData.parse == Document::FullParse) if (initData.parse == Document::FullParse)
{ {
VAbstractTool::AddRecord(initData.id, Tool::Normal, initData.doc); VAbstractTool::AddRecord(initData.id, Tool::Normal, initData.doc);
VToolNormal *point = new VToolNormal(initData); auto *point = new VToolNormal(initData);
initData.scene->addItem(point); initData.scene->addItem(point);
InitToolConnections(initData.scene, point); InitToolConnections(initData.scene, point);
VAbstractPattern::AddTool(initData.id, point); VAbstractPattern::AddTool(initData.id, point);

View File

@ -198,7 +198,7 @@ auto VToolShoulderPoint::Create(VToolShoulderPointInitData &initData) -> VToolSh
static_cast<QPointF>(*firstPoint), static_cast<QPointF>(*secondPoint), static_cast<QPointF>(*shoulderPoint), static_cast<QPointF>(*firstPoint), static_cast<QPointF>(*secondPoint), static_cast<QPointF>(*shoulderPoint),
VAbstractValApplication::VApp()->toPixel(result)); VAbstractValApplication::VApp()->toPixel(result));
VPointF *p = new VPointF(fPoint, initData.name, initData.mx, initData.my); auto *p = new VPointF(fPoint, initData.name, initData.mx, initData.my);
p->SetShowLabel(initData.showLabel); p->SetShowLabel(initData.showLabel);
if (initData.typeCreation == Source::FromGui) if (initData.typeCreation == Source::FromGui)
@ -221,7 +221,7 @@ auto VToolShoulderPoint::Create(VToolShoulderPointInitData &initData) -> VToolSh
if (initData.parse == Document::FullParse) if (initData.parse == Document::FullParse)
{ {
VAbstractTool::AddRecord(initData.id, Tool::ShoulderPoint, initData.doc); VAbstractTool::AddRecord(initData.id, Tool::ShoulderPoint, initData.doc);
VToolShoulderPoint *point = new VToolShoulderPoint(initData); auto *point = new VToolShoulderPoint(initData);
initData.scene->addItem(point); initData.scene->addItem(point);
InitToolConnections(initData.scene, point); InitToolConnections(initData.scene, point);
VAbstractPattern::AddTool(initData.id, point); VAbstractPattern::AddTool(initData.id, point);

View File

@ -106,7 +106,7 @@ void VToolBasePoint::SetDialog()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
auto VToolBasePoint::Create(VToolBasePointInitData initData) -> VToolBasePoint * auto VToolBasePoint::Create(VToolBasePointInitData initData) -> VToolBasePoint *
{ {
VPointF *point = new VPointF(initData.x, initData.y, initData.name, initData.mx, initData.my); auto *point = new VPointF(initData.x, initData.y, initData.name, initData.mx, initData.my);
point->SetShowLabel(initData.showLabel); point->SetShowLabel(initData.showLabel);
if (initData.typeCreation == Source::FromGui) if (initData.typeCreation == Source::FromGui)
@ -125,7 +125,7 @@ auto VToolBasePoint::Create(VToolBasePointInitData initData) -> VToolBasePoint *
if (initData.parse == Document::FullParse) if (initData.parse == Document::FullParse)
{ {
VAbstractTool::AddRecord(initData.id, Tool::BasePoint, initData.doc); VAbstractTool::AddRecord(initData.id, Tool::BasePoint, initData.doc);
VToolBasePoint *spoint = new VToolBasePoint(initData); auto *spoint = new VToolBasePoint(initData);
initData.scene->addItem(spoint); initData.scene->addItem(spoint);
InitToolConnections(initData.scene, spoint); InitToolConnections(initData.scene, spoint);
VAbstractPattern::AddTool(initData.id, spoint); VAbstractPattern::AddTool(initData.id, spoint);
@ -165,7 +165,7 @@ void VToolBasePoint::AddToFile()
patternPiece.appendChild(doc->createElement(VAbstractPattern::TagModeling)); patternPiece.appendChild(doc->createElement(VAbstractPattern::TagModeling));
patternPiece.appendChild(doc->createElement(VAbstractPattern::TagDetails)); patternPiece.appendChild(doc->createElement(VAbstractPattern::TagDetails));
AddPatternPiece *addPP = new AddPatternPiece(patternPiece, doc, namePP); auto *addPP = new AddPatternPiece(patternPiece, doc, namePP);
connect(addPP, &AddPatternPiece::ClearScene, doc, &VAbstractPattern::ClearScene); connect(addPP, &AddPatternPiece::ClearScene, doc, &VAbstractPattern::ClearScene);
connect(addPP, &AddPatternPiece::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing); connect(addPP, &AddPatternPiece::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
VAbstractApplication::VApp()->getUndoStack()->push(addPP); VAbstractApplication::VApp()->getUndoStack()->push(addPP);
@ -191,13 +191,13 @@ auto VToolBasePoint::itemChange(QGraphicsItem::GraphicsItemChange change, const
// value - this is new position. // value - this is new position.
QPointF const newPos = value.toPointF(); QPointF const newPos = value.toPointF();
MoveSPoint *moveSP = new MoveSPoint(doc, newPos.x(), newPos.y(), m_id, this->scene()); auto *moveSP = new MoveSPoint(doc, newPos.x(), newPos.y(), m_id, this->scene());
connect(moveSP, &MoveSPoint::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree); connect(moveSP, &MoveSPoint::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
VAbstractApplication::VApp()->getUndoStack()->push(moveSP); VAbstractApplication::VApp()->getUndoStack()->push(moveSP);
const QList<QGraphicsView *> viewList = scene()->views(); const QList<QGraphicsView *> viewList = scene()->views();
if (not viewList.isEmpty()) if (not viewList.isEmpty())
{ {
if (VMainGraphicsView *view = qobject_cast<VMainGraphicsView *>(viewList.at(0))) if (auto *view = qobject_cast<VMainGraphicsView *>(viewList.at(0)))
{ {
view->EnsureItemVisibleWithDelay(this, VMainGraphicsView::scrollDelay); view->EnsureItemVisibleWithDelay(this, VMainGraphicsView::scrollDelay);
} }
@ -249,7 +249,7 @@ void VToolBasePoint::DeleteToolWithConfirm(bool ask)
} }
qCDebug(vTool, "Begin deleting."); qCDebug(vTool, "Begin deleting.");
DeletePatternPiece *deletePP = new DeletePatternPiece(doc, nameActivDraw); auto *deletePP = new DeletePatternPiece(doc, nameActivDraw);
connect(deletePP, &DeletePatternPiece::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing); connect(deletePP, &DeletePatternPiece::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
VAbstractApplication::VApp()->getUndoStack()->push(deletePP); VAbstractApplication::VApp()->getUndoStack()->push(deletePP);

View File

@ -156,7 +156,7 @@ auto VToolLineIntersect::Create(VToolLineIntersectInitData initData) -> VToolLin
: qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; : qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg;
} }
VPointF *p = new VPointF(fPoint, initData.name, initData.mx, initData.my); auto *p = new VPointF(fPoint, initData.name, initData.mx, initData.my);
p->SetShowLabel(initData.showLabel); p->SetShowLabel(initData.showLabel);
if (initData.typeCreation == Source::FromGui) if (initData.typeCreation == Source::FromGui)
@ -183,7 +183,7 @@ auto VToolLineIntersect::Create(VToolLineIntersectInitData initData) -> VToolLin
if (initData.parse == Document::FullParse) if (initData.parse == Document::FullParse)
{ {
VAbstractTool::AddRecord(initData.id, Tool::LineIntersect, initData.doc); VAbstractTool::AddRecord(initData.id, Tool::LineIntersect, initData.doc);
VToolLineIntersect *point = new VToolLineIntersect(initData); auto *point = new VToolLineIntersect(initData);
initData.scene->addItem(point); initData.scene->addItem(point);
InitToolConnections(initData.scene, point); InitToolConnections(initData.scene, point);
VAbstractPattern::AddTool(initData.id, point); VAbstractPattern::AddTool(initData.id, point);

View File

@ -123,7 +123,7 @@ auto VToolPointFromArcAndTangent::Create(VToolPointFromArcAndTangentInitData ini
qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg;
} }
VPointF *p = new VPointF(point, initData.name, initData.mx, initData.my); auto *p = new VPointF(point, initData.name, initData.mx, initData.my);
p->SetShowLabel(initData.showLabel); p->SetShowLabel(initData.showLabel);
if (initData.typeCreation == Source::FromGui) if (initData.typeCreation == Source::FromGui)
@ -142,7 +142,7 @@ auto VToolPointFromArcAndTangent::Create(VToolPointFromArcAndTangentInitData ini
if (initData.parse == Document::FullParse) if (initData.parse == Document::FullParse)
{ {
VAbstractTool::AddRecord(initData.id, Tool::PointFromArcAndTangent, initData.doc); VAbstractTool::AddRecord(initData.id, Tool::PointFromArcAndTangent, initData.doc);
VToolPointFromArcAndTangent *point = new VToolPointFromArcAndTangent(initData); auto *point = new VToolPointFromArcAndTangent(initData);
initData.scene->addItem(point); initData.scene->addItem(point);
InitToolConnections(initData.scene, point); InitToolConnections(initData.scene, point);
VAbstractPattern::AddTool(initData.id, point); VAbstractPattern::AddTool(initData.id, point);

View File

@ -222,7 +222,7 @@ auto VToolPointOfContact::Create(VToolPointOfContactInitData &initData) -> VTool
: qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; : qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg;
} }
VPointF *p = new VPointF(fPoint, initData.name, initData.mx, initData.my); auto *p = new VPointF(fPoint, initData.name, initData.mx, initData.my);
p->SetShowLabel(initData.showLabel); p->SetShowLabel(initData.showLabel);
if (initData.typeCreation == Source::FromGui) if (initData.typeCreation == Source::FromGui)
@ -247,7 +247,7 @@ auto VToolPointOfContact::Create(VToolPointOfContactInitData &initData) -> VTool
if (initData.parse == Document::FullParse) if (initData.parse == Document::FullParse)
{ {
VAbstractTool::AddRecord(initData.id, Tool::PointOfContact, initData.doc); VAbstractTool::AddRecord(initData.id, Tool::PointOfContact, initData.doc);
VToolPointOfContact *point = new VToolPointOfContact(initData); auto *point = new VToolPointOfContact(initData);
initData.scene->addItem(point); initData.scene->addItem(point);
InitToolConnections(initData.scene, point); InitToolConnections(initData.scene, point);
VAbstractPattern::AddTool(initData.id, point); VAbstractPattern::AddTool(initData.id, point);

View File

@ -129,7 +129,7 @@ auto VToolPointOfIntersection::Create(VToolPointOfIntersectionInitData initData)
QPointF const point(firstPoint->x(), secondPoint->y()); QPointF const point(firstPoint->x(), secondPoint->y());
VPointF *p = new VPointF(point, initData.name, initData.mx, initData.my); auto *p = new VPointF(point, initData.name, initData.mx, initData.my);
p->SetShowLabel(initData.showLabel); p->SetShowLabel(initData.showLabel);
if (initData.typeCreation == Source::FromGui) if (initData.typeCreation == Source::FromGui)
@ -148,7 +148,7 @@ auto VToolPointOfIntersection::Create(VToolPointOfIntersectionInitData initData)
if (initData.parse == Document::FullParse) if (initData.parse == Document::FullParse)
{ {
VAbstractTool::AddRecord(initData.id, Tool::PointOfIntersection, initData.doc); VAbstractTool::AddRecord(initData.id, Tool::PointOfIntersection, initData.doc);
VToolPointOfIntersection *point = new VToolPointOfIntersection(initData); auto *point = new VToolPointOfIntersection(initData);
initData.scene->addItem(point); initData.scene->addItem(point);
InitToolConnections(initData.scene, point); InitToolConnections(initData.scene, point);
VAbstractPattern::AddTool(initData.id, point); VAbstractPattern::AddTool(initData.id, point);

View File

@ -123,7 +123,7 @@ auto VToolPointOfIntersectionArcs::Create(VToolPointOfIntersectionArcsInitData i
qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg;
} }
VPointF *p = new VPointF(point, initData.name, initData.mx, initData.my); auto *p = new VPointF(point, initData.name, initData.mx, initData.my);
p->SetShowLabel(initData.showLabel); p->SetShowLabel(initData.showLabel);
if (initData.typeCreation == Source::FromGui) if (initData.typeCreation == Source::FromGui)
@ -142,7 +142,7 @@ auto VToolPointOfIntersectionArcs::Create(VToolPointOfIntersectionArcsInitData i
if (initData.parse == Document::FullParse) if (initData.parse == Document::FullParse)
{ {
VAbstractTool::AddRecord(initData.id, Tool::PointOfIntersectionArcs, initData.doc); VAbstractTool::AddRecord(initData.id, Tool::PointOfIntersectionArcs, initData.doc);
VToolPointOfIntersectionArcs *point = new VToolPointOfIntersectionArcs(initData); auto *point = new VToolPointOfIntersectionArcs(initData);
initData.scene->addItem(point); initData.scene->addItem(point);
InitToolConnections(initData.scene, point); InitToolConnections(initData.scene, point);
VAbstractPattern::AddTool(initData.id, point); VAbstractPattern::AddTool(initData.id, point);

View File

@ -141,7 +141,7 @@ auto VToolPointOfIntersectionCircles::Create(VToolPointOfIntersectionCirclesInit
: qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; : qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg;
} }
VPointF *p = new VPointF(point, initData.name, initData.mx, initData.my); auto *p = new VPointF(point, initData.name, initData.mx, initData.my);
p->SetShowLabel(initData.showLabel); p->SetShowLabel(initData.showLabel);
if (initData.typeCreation == Source::FromGui) if (initData.typeCreation == Source::FromGui)
@ -160,7 +160,7 @@ auto VToolPointOfIntersectionCircles::Create(VToolPointOfIntersectionCirclesInit
if (initData.parse == Document::FullParse) if (initData.parse == Document::FullParse)
{ {
VAbstractTool::AddRecord(initData.id, Tool::PointOfIntersectionCircles, initData.doc); VAbstractTool::AddRecord(initData.id, Tool::PointOfIntersectionCircles, initData.doc);
VToolPointOfIntersectionCircles *point = new VToolPointOfIntersectionCircles(initData); auto *point = new VToolPointOfIntersectionCircles(initData);
initData.scene->addItem(point); initData.scene->addItem(point);
InitToolConnections(initData.scene, point); InitToolConnections(initData.scene, point);
VAbstractPattern::AddTool(initData.id, point); VAbstractPattern::AddTool(initData.id, point);

View File

@ -422,8 +422,8 @@ auto VToolSinglePoint::InitSegments(GOType curveType, qreal segLength, const VPo
spl->CutSpline(0, spl1p2, spl1p3, spl2p2, spl2p3, p->name()); spl->CutSpline(0, spl1p2, spl1p3, spl2p2, spl2p3, p->name());
} }
VSpline *spl1 = new VSpline(spl->GetP1(), spl1p2, spl1p3, *p); auto *spl1 = new VSpline(spl->GetP1(), spl1p2, spl1p3, *p);
VSpline *spl2 = new VSpline(*p, spl2p2, spl2p3, spl->GetP4()); auto *spl2 = new VSpline(*p, spl2p2, spl2p3, spl->GetP4());
if (not VFuzzyComparePossibleNulls(segLength, -1)) if (not VFuzzyComparePossibleNulls(segLength, -1))
{ {

View File

@ -216,7 +216,7 @@ void VDrawTool::ContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 itemI
// add the menu "remove from group" to the context menu // add the menu "remove from group" to the context menu
QMap<quint32, QString> groupsContainingItem = doc->GetGroupsContainingItem(this->getId(), itemId, true); QMap<quint32, QString> groupsContainingItem = doc->GetGroupsContainingItem(this->getId(), itemId, true);
QActionGroup *actionsRemoveFromGroup = new QActionGroup(this); auto *actionsRemoveFromGroup = new QActionGroup(this);
if (not groupsContainingItem.empty()) if (not groupsContainingItem.empty())
{ {
QMenu *menuRemoveFromGroup = QMenu *menuRemoveFromGroup =

View File

@ -469,7 +469,7 @@ void VToolLine::ShowVisualization(bool show)
} }
else else
{ {
if (VisToolLine *visual = qobject_cast<VisToolLine *>(vis)) if (auto *visual = qobject_cast<VisToolLine *>(vis))
{ {
visual->show(); visual->show();
} }

View File

@ -61,7 +61,7 @@ void VNodeArc::Create(const VAbstractNodeInitData &initData)
if (initData.parse == Document::FullParse) if (initData.parse == Document::FullParse)
{ {
VAbstractTool::AddRecord(initData.id, Tool::NodeArc, initData.doc); VAbstractTool::AddRecord(initData.id, Tool::NodeArc, initData.doc);
VNodeArc *arc = new VNodeArc(initData); auto *arc = new VNodeArc(initData);
VAbstractPattern::AddTool(initData.id, arc); VAbstractPattern::AddTool(initData.id, arc);
if (initData.idTool != NULL_ID) if (initData.idTool != NULL_ID)

View File

@ -44,7 +44,7 @@ void VNodeEllipticalArc::Create(const VAbstractNodeInitData &initData)
if (initData.parse == Document::FullParse) if (initData.parse == Document::FullParse)
{ {
VAbstractTool::AddRecord(initData.id, Tool::NodeElArc, initData.doc); VAbstractTool::AddRecord(initData.id, Tool::NodeElArc, initData.doc);
VNodeEllipticalArc *arc = new VNodeEllipticalArc(initData); auto *arc = new VNodeEllipticalArc(initData);
VAbstractPattern::AddTool(initData.id, arc); VAbstractPattern::AddTool(initData.id, arc);
if (initData.idTool != NULL_ID) if (initData.idTool != NULL_ID)

View File

@ -61,7 +61,7 @@ void VNodeSplinePath::Create(const VAbstractNodeInitData &initData)
if (initData.parse == Document::FullParse) if (initData.parse == Document::FullParse)
{ {
VAbstractTool::AddRecord(initData.id, Tool::NodeSplinePath, initData.doc); VAbstractTool::AddRecord(initData.id, Tool::NodeSplinePath, initData.doc);
VNodeSplinePath *splPath = new VNodeSplinePath(initData); auto *splPath = new VNodeSplinePath(initData);
VAbstractPattern::AddTool(initData.id, splPath); VAbstractPattern::AddTool(initData.id, splPath);
if (initData.idTool != NULL_ID) if (initData.idTool != NULL_ID)

View File

@ -72,7 +72,7 @@ auto VToolPin::Create(VToolPinInitData initData) -> VToolPin *
initData.data->UpdateId(initData.id); initData.data->UpdateId(initData.id);
return nullptr;// Just ignore return nullptr;// Just ignore
} }
VPointF *pinPoint = new VPointF(*point); auto *pinPoint = new VPointF(*point);
pinPoint->setIdObject(initData.pointId); pinPoint->setIdObject(initData.pointId);
pinPoint->setMode(Draw::Modeling); pinPoint->setMode(Draw::Modeling);
initData.data->UpdateGObject(initData.id, pinPoint); initData.data->UpdateGObject(initData.id, pinPoint);

View File

@ -241,7 +241,7 @@ void VAbstractTool::DeleteToolWithConfirm(bool ask)
void VAbstractTool::PerformDelete() void VAbstractTool::PerformDelete()
{ {
qCDebug(vTool, "Begin deleting."); qCDebug(vTool, "Begin deleting.");
DelTool *delTool = new DelTool(doc, m_id); auto *delTool = new DelTool(doc, m_id);
connect(delTool, &DelTool::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing); connect(delTool, &DelTool::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
VAbstractApplication::VApp()->getUndoStack()->push(delTool); VAbstractApplication::VApp()->getUndoStack()->push(delTool);
} }

View File

@ -88,7 +88,7 @@ MoveDoubleLabel::MoveDoubleLabel(VAbstractPattern *doc, const QPointF &pos, Move
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
auto MoveDoubleLabel::mergeWith(const QUndoCommand *command) -> bool auto MoveDoubleLabel::mergeWith(const QUndoCommand *command) -> bool
{ {
const MoveDoubleLabel *moveCommand = static_cast<const MoveDoubleLabel *>(command); const auto *moveCommand = static_cast<const MoveDoubleLabel *>(command);
SCASSERT(moveCommand != nullptr) SCASSERT(moveCommand != nullptr)
if (moveCommand->GetPointId() != nodeId || if (moveCommand->GetPointId() != nodeId ||
@ -151,7 +151,7 @@ void MoveDoubleLabel::Do(const QPointF &pos)
QString().setNum(VAbstractValApplication::VApp()->fromPixel(pos.y()))); QString().setNum(VAbstractValApplication::VApp()->fromPixel(pos.y())));
} }
if (VDrawTool *tool = qobject_cast<VDrawTool *>(VAbstractPattern::getTool(m_idTool))) if (auto *tool = qobject_cast<VDrawTool *>(VAbstractPattern::getTool(m_idTool)))
{ {
tool->ChangeLabelPosition(nodeId, pos); tool->ChangeLabelPosition(nodeId, pos);
} }

View File

@ -68,7 +68,7 @@ OperationMoveLabel::OperationMoveLabel(quint32 idTool, VAbstractPattern *doc, co
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
auto OperationMoveLabel::mergeWith(const QUndoCommand *command) -> bool auto OperationMoveLabel::mergeWith(const QUndoCommand *command) -> bool
{ {
const OperationMoveLabel *moveCommand = static_cast<const OperationMoveLabel *>(command); const auto *moveCommand = static_cast<const OperationMoveLabel *>(command);
SCASSERT(moveCommand != nullptr) SCASSERT(moveCommand != nullptr)
if (moveCommand->GetToolId() != m_idTool && moveCommand->GetPointId() != nodeId) if (moveCommand->GetToolId() != m_idTool && moveCommand->GetPointId() != nodeId)
@ -101,7 +101,7 @@ void OperationMoveLabel::Do(const QPointF &pos)
doc->SetAttribute(domElement, AttrMx, QString().setNum(VAbstractValApplication::VApp()->fromPixel(pos.x()))); doc->SetAttribute(domElement, AttrMx, QString().setNum(VAbstractValApplication::VApp()->fromPixel(pos.x())));
doc->SetAttribute(domElement, AttrMy, QString().setNum(VAbstractValApplication::VApp()->fromPixel(pos.y()))); doc->SetAttribute(domElement, AttrMy, QString().setNum(VAbstractValApplication::VApp()->fromPixel(pos.y())));
if (VDrawTool *tool = qobject_cast<VDrawTool *>(VAbstractPattern::getTool(m_idTool))) if (auto *tool = qobject_cast<VDrawTool *>(VAbstractPattern::getTool(m_idTool)))
{ {
tool->ChangeLabelPosition(nodeId, pos); tool->ChangeLabelPosition(nodeId, pos);
} }

View File

@ -86,7 +86,7 @@ void OperationShowLabel::Do(bool visible)
{ {
doc->SetAttribute<bool>(domElement, AttrShowLabel, visible); doc->SetAttribute<bool>(domElement, AttrShowLabel, visible);
if (VDrawTool *tool = qobject_cast<VDrawTool *>(VAbstractPattern::getTool(m_idTool))) if (auto *tool = qobject_cast<VDrawTool *>(VAbstractPattern::getTool(m_idTool)))
{ {
tool->SetLabelVisible(nodeId, visible); tool->SetLabelVisible(nodeId, visible);
} }

View File

@ -106,7 +106,7 @@ void ShowDoubleLabel::Do(bool visible)
doc->SetAttribute<bool>(domElement, AttrShowLabel2, visible); doc->SetAttribute<bool>(domElement, AttrShowLabel2, visible);
} }
if (VDrawTool *tool = qobject_cast<VDrawTool *>(VAbstractPattern::getTool(m_idTool))) if (auto *tool = qobject_cast<VDrawTool *>(VAbstractPattern::getTool(m_idTool)))
{ {
tool->SetLabelVisible(nodeId, visible); tool->SetLabelVisible(nodeId, visible);
} }

View File

@ -81,7 +81,7 @@ void ShowLabel::Do(bool visible)
{ {
doc->SetAttribute<bool>(domElement, AttrShowLabel, visible); doc->SetAttribute<bool>(domElement, AttrShowLabel, visible);
if (VAbstractTool *tool = qobject_cast<VAbstractTool *>(VAbstractPattern::getTool(nodeId))) if (auto *tool = qobject_cast<VAbstractTool *>(VAbstractPattern::getTool(nodeId)))
{ {
tool->SetLabelVisible(nodeId, visible); tool->SetLabelVisible(nodeId, visible);
} }

View File

@ -82,7 +82,7 @@ void MovePiece::redo()
// cppcheck-suppress unusedFunction // cppcheck-suppress unusedFunction
auto MovePiece::mergeWith(const QUndoCommand *command) -> bool auto MovePiece::mergeWith(const QUndoCommand *command) -> bool
{ {
const MovePiece *moveCommand = static_cast<const MovePiece *>(command); const auto *moveCommand = static_cast<const MovePiece *>(command);
SCASSERT(moveCommand != nullptr) SCASSERT(moveCommand != nullptr)
const quint32 id = moveCommand->getDetId(); const quint32 id = moveCommand->getDetId();
@ -112,7 +112,7 @@ void MovePiece::Do(qreal x, qreal y)
{ {
SaveCoordinates(domElement, x, y); SaveCoordinates(domElement, x, y);
VToolSeamAllowance *tool = qobject_cast<VToolSeamAllowance *>(VAbstractPattern::getTool(nodeId)); auto *tool = qobject_cast<VToolSeamAllowance *>(VAbstractPattern::getTool(nodeId));
if (tool) if (tool)
{ {
tool->Move(x, y); tool->Move(x, y);

View File

@ -71,7 +71,7 @@ void MoveSplinePath::redo()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
auto MoveSplinePath::mergeWith(const QUndoCommand *command) -> bool auto MoveSplinePath::mergeWith(const QUndoCommand *command) -> bool
{ {
const MoveSplinePath *moveCommand = static_cast<const MoveSplinePath *>(command); const auto *moveCommand = static_cast<const MoveSplinePath *>(command);
SCASSERT(moveCommand != nullptr) SCASSERT(moveCommand != nullptr)
const quint32 id = moveCommand->getSplinePathId(); const quint32 id = moveCommand->getSplinePathId();

View File

@ -67,7 +67,7 @@ void RenamePP::redo()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
auto RenamePP::mergeWith(const QUndoCommand *command) -> bool auto RenamePP::mergeWith(const QUndoCommand *command) -> bool
{ {
const RenamePP *renameCommand = static_cast<const RenamePP *>(command); const auto *renameCommand = static_cast<const RenamePP *>(command);
SCASSERT(renameCommand != nullptr) SCASSERT(renameCommand != nullptr)
const QString oldName = renameCommand->getOldPPname(); const QString oldName = renameCommand->getOldPPname();

View File

@ -72,7 +72,7 @@ void SavePiecePathOptions::undo()
if (m_pieceId != NULL_ID) if (m_pieceId != NULL_ID)
{ {
if (VToolSeamAllowance *tool = qobject_cast<VToolSeamAllowance *>(VAbstractPattern::getTool(m_pieceId))) if (auto *tool = qobject_cast<VToolSeamAllowance *>(VAbstractPattern::getTool(m_pieceId)))
{ {
tool->RefreshGeometry(); tool->RefreshGeometry();
} }
@ -104,7 +104,7 @@ void SavePiecePathOptions::redo()
if (m_pieceId != NULL_ID) if (m_pieceId != NULL_ID)
{ {
if (VToolSeamAllowance *tool = qobject_cast<VToolSeamAllowance *>(VAbstractPattern::getTool(m_pieceId))) if (auto *tool = qobject_cast<VToolSeamAllowance *>(VAbstractPattern::getTool(m_pieceId)))
{ {
tool->RefreshGeometry(); tool->RefreshGeometry();
} }
@ -119,7 +119,7 @@ void SavePiecePathOptions::redo()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
auto SavePiecePathOptions::mergeWith(const QUndoCommand *command) -> bool auto SavePiecePathOptions::mergeWith(const QUndoCommand *command) -> bool
{ {
const SavePiecePathOptions *saveCommand = static_cast<const SavePiecePathOptions *>(command); const auto *saveCommand = static_cast<const SavePiecePathOptions *>(command);
SCASSERT(saveCommand != nullptr); SCASSERT(saveCommand != nullptr);
if (saveCommand->PathId() != nodeId) if (saveCommand->PathId() != nodeId)

View File

@ -99,7 +99,7 @@ auto SaveToolOptions::Missing(const QList<quint32> &list1, const QList<quint32>
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
auto SaveToolOptions::mergeWith(const QUndoCommand *command) -> bool auto SaveToolOptions::mergeWith(const QUndoCommand *command) -> bool
{ {
const SaveToolOptions *saveCommand = static_cast<const SaveToolOptions *>(command); const auto *saveCommand = static_cast<const SaveToolOptions *>(command);
if (saveCommand->getToolId() != nodeId) if (saveCommand->getToolId() != nodeId)
{ {

View File

@ -664,7 +664,7 @@ auto FancyTabBar::IsTabEnabled(int index) const -> bool
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void FancyTabBar::InsertTab(int index, const QIcon &icon, const QString &label) void FancyTabBar::InsertTab(int index, const QIcon &icon, const QString &label)
{ {
FancyTab *tab = new FancyTab(this); auto *tab = new FancyTab(this);
tab->m_icon = icon; tab->m_icon = icon;
tab->m_text = label; tab->m_text = label;
m_attachedTabs.insert(index, tab); m_attachedTabs.insert(index, tab);

View File

@ -104,7 +104,7 @@ auto ItemShapeFromPath(const QPainterPath &path, const QPen &pen) -> QPainterPat
{ {
// We unfortunately need this hack as QPainterPathStroker will set a width of 1.0 // We unfortunately need this hack as QPainterPathStroker will set a width of 1.0
// if we pass a value of 0.0 to QPainterPathStroker::setWidth() // if we pass a value of 0.0 to QPainterPathStroker::setWidth()
const qreal penWidthZero = qreal(0.00000001); const auto penWidthZero = qreal(0.00000001);
if (path == QPainterPath() || pen == Qt::NoPen) if (path == QPainterPath() || pen == Qt::NoPen)
{ {

View File

@ -827,7 +827,7 @@ void ColorPickerPopup::keyPressEvent(QKeyEvent *e)
QWidget *w = widgetAt[curRow][curCol]; QWidget *w = widgetAt[curRow][curCol];
if ((w != nullptr) && w->inherits("ColorPickerItem")) if ((w != nullptr) && w->inherits("ColorPickerItem"))
{ {
ColorPickerItem *wi = reinterpret_cast<ColorPickerItem *>(w); auto *wi = reinterpret_cast<ColorPickerItem *>(w);
wi->setSelected(true); wi->setSelected(true);
QLayoutItem *layoutItem; QLayoutItem *layoutItem;
@ -852,7 +852,7 @@ void ColorPickerPopup::keyPressEvent(QKeyEvent *e)
} }
else if (w && w->inherits("QPushButton")) else if (w && w->inherits("QPushButton"))
{ {
ColorPickerItem *wi = reinterpret_cast<ColorPickerItem *>(w); auto *wi = reinterpret_cast<ColorPickerItem *>(w);
wi->setSelected(true); wi->setSelected(true);
QLayoutItem *layoutItem; QLayoutItem *layoutItem;

View File

@ -45,7 +45,7 @@ auto VComboBoxDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem
Q_UNUSED(option) Q_UNUSED(option)
Q_UNUSED(index) Q_UNUSED(index)
QComboBox *editor = new QComboBox(parent); auto *editor = new QComboBox(parent);
editor->addItems(m_items); editor->addItems(m_items);
return editor; return editor;
@ -56,7 +56,7 @@ void VComboBoxDelegate::setEditorData(QWidget *editor, const QModelIndex &index)
{ {
const QString value = index.model()->data(index, Qt::EditRole).toString(); const QString value = index.model()->data(index, Qt::EditRole).toString();
QComboBox *comboBox = static_cast<QComboBox*>(editor); auto *comboBox = static_cast<QComboBox *>(editor);
const int cIndex = comboBox->findText(value); const int cIndex = comboBox->findText(value);
if (cIndex != -1) if (cIndex != -1)
@ -68,7 +68,7 @@ void VComboBoxDelegate::setEditorData(QWidget *editor, const QModelIndex &index)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VComboBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const void VComboBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
{ {
QComboBox *comboBox = static_cast<QComboBox*>(editor); auto *comboBox = static_cast<QComboBox *>(editor);
QString value; QString value;
const int cIndex = comboBox->currentIndex(); const int cIndex = comboBox->currentIndex();

View File

@ -136,7 +136,7 @@ void VPlainTextEdit::MatchParentheses()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
auto VPlainTextEdit::MatchLeftParenthesis(QTextBlock currentBlock, int i, int numLeftParentheses) -> bool auto VPlainTextEdit::MatchLeftParenthesis(QTextBlock currentBlock, int i, int numLeftParentheses) -> bool
{ {
VTextBlockData *data = static_cast<VTextBlockData *>(currentBlock.userData()); auto *data = static_cast<VTextBlockData *>(currentBlock.userData());
QVector<ParenthesisInfo *> const infos = data->Parentheses(); QVector<ParenthesisInfo *> const infos = data->Parentheses();
int const docPos = currentBlock.position(); int const docPos = currentBlock.position();
@ -171,7 +171,7 @@ auto VPlainTextEdit::MatchLeftParenthesis(QTextBlock currentBlock, int i, int nu
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
auto VPlainTextEdit::MatchRightParenthesis(QTextBlock currentBlock, int i, int numRightParentheses) -> bool auto VPlainTextEdit::MatchRightParenthesis(QTextBlock currentBlock, int i, int numRightParentheses) -> bool
{ {
VTextBlockData *data = static_cast<VTextBlockData *>(currentBlock.userData()); auto *data = static_cast<VTextBlockData *>(currentBlock.userData());
QVector<ParenthesisInfo *> const parentheses = data->Parentheses(); QVector<ParenthesisInfo *> const parentheses = data->Parentheses();
int const docPos = currentBlock.position(); int const docPos = currentBlock.position();

View File

@ -96,8 +96,8 @@ void VWidgetPopup::PopupMessage(QWidget *w, const QString &msg)
{ {
SCASSERT(w != nullptr) SCASSERT(w != nullptr)
VWidgetPopup *popup = new VWidgetPopup(w); auto *popup = new VWidgetPopup(w);
QLabel *label = new QLabel(msg); auto *label = new QLabel(msg);
QFont f = label->font(); QFont f = label->font();
f.setBold(true); f.setBold(true);
f.setPixelSize(16); f.setPixelSize(16);