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)
{
VAbstractMainWindow *window =
qobject_cast<VAbstractMainWindow *>(VAbstractValApplication::VApp()->getMainWindow());
auto *window = qobject_cast<VAbstractMainWindow *>(VAbstractValApplication::VApp()->getMainWindow());
SCASSERT(window != nullptr)
connect(spl, &VToolSpline::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
}
@ -2997,8 +2996,7 @@ void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement
if (spl != nullptr)
{
VAbstractMainWindow *window =
qobject_cast<VAbstractMainWindow *>(VAbstractValApplication::VApp()->getMainWindow());
auto *window = qobject_cast<VAbstractMainWindow *>(VAbstractValApplication::VApp()->getMainWindow());
SCASSERT(window != nullptr)
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);
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->setMode(Draw::Modeling);
initData.data->UpdateGObject(initData.id, spl);
}
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->setMode(Draw::Modeling);
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);
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->setMode(Draw::Modeling);
initData.data->UpdateGObject(initData.id, path);
}
else
{
VCubicBezierPath *spl =
new VCubicBezierPath(*initData.data->GeometricObject<VCubicBezierPath>(initData.idObject));
auto *spl = new VCubicBezierPath(*initData.data->GeometricObject<VCubicBezierPath>(initData.idObject));
spl->setIdObject(initData.idObject);
spl->setMode(Draw::Modeling);
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
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)
delete cal;

View File

@ -137,7 +137,7 @@ void dx_iface::writeBlocks()
{
dxfW->writeBlock(bk);
// 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);
}
}
@ -150,7 +150,7 @@ void dx_iface::writeBlockRecords()
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);
}

View File

@ -56,7 +56,7 @@ public:
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;
}
std::list<DRW_Entity *> ent; // stores the entities list
@ -83,7 +83,7 @@ public:
~dx_data()
{
// 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 mBlock;
}

View File

@ -80,10 +80,10 @@ public:
extData(),
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 *dst = new DRW_Variant(*src);
auto *dst = new DRW_Variant(*src);
extData.push_back(dst);
if (src == e.curr)
{

View File

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

View File

@ -231,7 +231,7 @@ void DialogExportToCSV::ShowPreview()
{
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->horizontalHeader()->setStretchLastSection(true);
@ -241,7 +241,7 @@ void DialogExportToCSV::ShowPreview()
{
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));
// 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);
fileName = value;
QFile *file = new QFile(fileName);
auto *file = new QFile(fileName);
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 *
{
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))
{

View File

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

View File

@ -67,7 +67,7 @@ auto VPE::VColorProperty::createEditor(QWidget *parent, const QStyleOptionViewIt
Q_UNUSED(options)
Q_UNUSED(delegate)
VColorPropertyEditor* tmpWidget = new VColorPropertyEditor(parent);
auto *tmpWidget = new VColorPropertyEditor(parent);
tmpWidget->setLocale(parent->locale());
tmpWidget->SetColor(d_ptr->VariantValue.value<QColor>());
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)
auto VPE::VColorProperty::setEditorData(QWidget *editor) -> bool
{
VColorPropertyEditor* tmpWidget = qobject_cast<VColorPropertyEditor*>(editor);
auto *tmpWidget = qobject_cast<VColorPropertyEditor *>(editor);
if (tmpWidget)
{
tmpWidget->SetColor(d_ptr->VariantValue.value<QColor>());
@ -90,7 +90,7 @@ auto VPE::VColorProperty::setEditorData(QWidget *editor) -> bool
//! Gets the data from the widget
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)
{
return tmpWidget->GetColor();

View File

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

View File

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

View File

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

View File

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

View File

@ -52,7 +52,7 @@ auto VPE::VObjectProperty::data(int column, int role) const -> 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)
{
@ -72,7 +72,7 @@ auto VPE::VObjectProperty::createEditor(QWidget *parent, const QStyleOptionViewI
{
Q_UNUSED(options)
Q_UNUSED(delegate)
QComboBox* tmpEditor = new QComboBox(parent);
auto *tmpEditor = new QComboBox(parent);
tmpEditor->clear();
tmpEditor->setLocale(parent->locale());
FillList(tmpEditor, objects);
@ -91,7 +91,7 @@ auto VPE::VObjectProperty::setEditorData(QWidget *editor) -> bool
return false;
}
QComboBox* tmpEditor = qobject_cast<QComboBox*>(editor);
auto *tmpEditor = qobject_cast<QComboBox *>(editor);
if (tmpEditor)
{
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
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)
{
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)
{
Q_UNUSED(index)
UserChangeEvent *event = new UserChangeEvent();
auto *event = new UserChangeEvent();
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);
#endif
VDoubleProperty* tmpX = new VDoubleProperty("X");
auto *tmpX = new VDoubleProperty("X");
addChild(tmpX);
tmpX->setUpdateBehaviour(true, false);
VDoubleProperty* tmpY = new VDoubleProperty("Y");
auto *tmpY = new VDoubleProperty("Y");
addChild(tmpY);
tmpY->setUpdateBehaviour(true, false);

View File

@ -58,7 +58,7 @@ auto VPE::VShortcutProperty::createEditor(QWidget *parent, const QStyleOptionVie
{
Q_UNUSED(options)
VShortcutEditWidget* tmpWidget = new VShortcutEditWidget(parent);
auto *tmpWidget = new VShortcutEditWidget(parent);
if (delegate)
{
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
{
VShortcutEditWidget* tmpWidget = qobject_cast<VShortcutEditWidget*>(editor);
auto *tmpWidget = qobject_cast<VShortcutEditWidget *>(editor);
if (tmpWidget)
{
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
{
const VShortcutEditWidget* tmpWidget = qobject_cast<const VShortcutEditWidget*>(editor);
const auto *tmpWidget = qobject_cast<const VShortcutEditWidget *>(editor);
if (tmpWidget)
{
return tmpWidget->getShortcutAsString();

View File

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

View File

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

View File

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

View File

@ -52,7 +52,7 @@ auto VPE::VWidgetProperty::getWidget() const -> QWidget *
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();
if (tmpOldWidget)
{

View File

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

View File

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

View File

@ -141,7 +141,7 @@ void VPE::VPropertyFormWidget::build()
else
{
// Child properties, the property itself is not being added
VPropertyFormWidget *tmpNewFormWidget = new VPropertyFormWidget(tmpProperty, this);
auto *tmpNewFormWidget = new VPropertyFormWidget(tmpProperty, this);
tmpFormLayout->addRow(tmpNewFormWidget);
d_ptr->EditorWidgets.append(VPropertyFormWidgetPrivate::SEditorWidget(tmpNewFormWidget));
tmpNewFormWidget->setCommitBehaviour(d_ptr->UpdateEditors);
@ -149,7 +149,7 @@ void VPE::VPropertyFormWidget::build()
}
else if (tmpProperty->type() == "widget")
{
VWidgetProperty *tmpWidgetProperty = static_cast<VWidgetProperty *>(tmpProperty);
auto *tmpWidgetProperty = static_cast<VWidgetProperty *>(tmpProperty);
tmpFormLayout->addRow(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,
const QVariant &data) -> VPE::VProperty *
{
VProperty* tmpProp = new VProperty(name);
auto *tmpProp = new VProperty(name);
tmpProp->setValue(data);
if (addProperty(tmpProp, id, parentid))
{
@ -263,7 +263,7 @@ auto VPE::VPropertyModel::getProperty(const QModelIndex &index) const -> VPE::VP
{
if (index.isValid())
{
VProperty* prop = static_cast<VProperty*>(index.internalPointer());
auto *prop = static_cast<VProperty *>(index.internalPointer());
if (prop)
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -101,7 +101,7 @@ auto DialogInsertNode::GetNodes() const -> QVector<VPieceNode>
QVector<VPieceNode> nodes;
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)
{
nodes.append(node);
@ -242,7 +242,7 @@ void DialogInsertNode::NodeSelected()
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->blockSignals(true);
ui->spinBoxNodeNumber->setValue(nodeNumbers.value(node.GetId(), 1));
@ -259,7 +259,7 @@ void DialogInsertNode::NodeNumberChanged(int val)
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;
}

View File

@ -84,7 +84,7 @@ void DialogPatternMaterials::SetPatternMaterials(const QMap<int, QString> &list)
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->setTextAlignment(Qt::AlignLeft);

View File

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

View File

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

View File

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

View File

@ -155,7 +155,7 @@ auto VToolArcWithLength::Create(VToolArcWithLengthInitData &initData) -> VToolAr
if (initData.parse == Document::FullParse)
{
VAbstractTool::AddRecord(initData.id, Tool::ArcWithLength, initData.doc);
VToolArcWithLength *toolArc = new VToolArcWithLength(initData);
auto *toolArc = new VToolArcWithLength(initData);
initData.scene->addItem(toolArc);
InitArcToolConnections(initData.scene, 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);
const VPointF c = *initData.data->GeometricObject<VPointF>(initData.center);
VEllipticalArc *elArc =
new VEllipticalArc(c, calcRadius1, calcRadius2, initData.radius1, initData.radius2, calcF1, initData.f1, calcF2,
initData.f2, calcRotationAngle, initData.rotationAngle);
auto *elArc = new VEllipticalArc(c, calcRadius1, calcRadius2, initData.radius1, initData.radius2, calcF1,
initData.f1, calcF2, initData.f2, calcRotationAngle, initData.rotationAngle);
elArc->SetColor(initData.color);
elArc->SetPenStyle(initData.penStyle);
elArc->SetApproximationScale(initData.approximationScale);

View File

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

View File

@ -143,7 +143,7 @@ auto VToolCutSplinePath::Create(VToolCutInitData &initData) -> VToolCutSplinePat
SCASSERT(splPath != nullptr)
// Declare special variable "CurrentLength"
VCurveLength *length =
auto *length =
new VCurveLength(initData.baseCurveId, initData.baseCurveId, splPath.data(), *initData.data->GetPatternUnit());
length->SetName(currentLength);
initData.data->AddVariable(length);
@ -228,7 +228,7 @@ auto VToolCutSplinePath::CutSplinePath(qreal length, const QSharedPointer<VAbstr
qint32 p1 = 0, p2 = 0;
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);
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),
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);
if (initData.typeCreation == Source::FromGui)
@ -196,7 +196,7 @@ auto VToolBisector::Create(VToolBisectorInitData &initData) -> VToolBisector *
if (initData.parse == Document::FullParse)
{
VAbstractTool::AddRecord(initData.id, Tool::Bisector, initData.doc);
VToolBisector *point = new VToolBisector(initData);
auto *point = new VToolBisector(initData);
initData.scene->addItem(point);
InitToolConnections(initData.scene, point);
VAbstractPattern::AddTool(initData.id, point);

View File

@ -139,7 +139,7 @@ auto VToolEndLine::Create(VToolEndLineInitData &initData) -> VToolEndLine *
line.setLength(
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);
if (initData.typeCreation == Source::FromGui)
@ -160,7 +160,7 @@ auto VToolEndLine::Create(VToolEndLineInitData &initData) -> VToolEndLine *
if (initData.parse == Document::FullParse)
{
VAbstractTool::AddRecord(initData.id, Tool::EndLine, initData.doc);
VToolEndLine *point = new VToolEndLine(initData);
auto *point = new VToolEndLine(initData);
initData.scene->addItem(point);
InitToolConnections(initData.scene, 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)),
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);
if (initData.typeCreation == Source::FromGui)
@ -166,7 +166,7 @@ auto VToolHeight::Create(VToolHeightInitData initData) -> VToolHeight *
if (initData.parse == Document::FullParse)
{
VAbstractTool::AddRecord(initData.id, Tool::Height, initData.doc);
VToolHeight *point = new VToolHeight(initData);
auto *point = new VToolHeight(initData);
initData.scene->addItem(point);
InitToolConnections(initData.scene, point);
VAbstractPattern::AddTool(initData.id, point);

View File

@ -141,7 +141,7 @@ auto VToolLineIntersectAxis::Create(VToolLineIntersectAxisInitData &initData) ->
: 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);
if (initData.typeCreation == Source::FromGui)
@ -166,7 +166,7 @@ auto VToolLineIntersectAxis::Create(VToolLineIntersectAxisInitData &initData) ->
if (initData.parse == Document::FullParse)
{
VAbstractTool::AddRecord(initData.id, Tool::LineIntersectAxis, initData.doc);
VToolLineIntersectAxis *point = new VToolLineIntersectAxis(initData);
auto *point = new VToolLineIntersectAxis(initData);
initData.scene->addItem(point);
InitToolConnections(initData.scene, 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),
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);
if (initData.typeCreation == Source::FromGui)
@ -162,7 +162,7 @@ auto VToolNormal::Create(VToolNormalInitData initData) -> VToolNormal *
if (initData.parse == Document::FullParse)
{
VAbstractTool::AddRecord(initData.id, Tool::Normal, initData.doc);
VToolNormal *point = new VToolNormal(initData);
auto *point = new VToolNormal(initData);
initData.scene->addItem(point);
InitToolConnections(initData.scene, 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),
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);
if (initData.typeCreation == Source::FromGui)
@ -221,7 +221,7 @@ auto VToolShoulderPoint::Create(VToolShoulderPointInitData &initData) -> VToolSh
if (initData.parse == Document::FullParse)
{
VAbstractTool::AddRecord(initData.id, Tool::ShoulderPoint, initData.doc);
VToolShoulderPoint *point = new VToolShoulderPoint(initData);
auto *point = new VToolShoulderPoint(initData);
initData.scene->addItem(point);
InitToolConnections(initData.scene, point);
VAbstractPattern::AddTool(initData.id, point);

View File

@ -106,7 +106,7 @@ void VToolBasePoint::SetDialog()
//---------------------------------------------------------------------------------------------------------------------
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);
if (initData.typeCreation == Source::FromGui)
@ -125,7 +125,7 @@ auto VToolBasePoint::Create(VToolBasePointInitData initData) -> VToolBasePoint *
if (initData.parse == Document::FullParse)
{
VAbstractTool::AddRecord(initData.id, Tool::BasePoint, initData.doc);
VToolBasePoint *spoint = new VToolBasePoint(initData);
auto *spoint = new VToolBasePoint(initData);
initData.scene->addItem(spoint);
InitToolConnections(initData.scene, spoint);
VAbstractPattern::AddTool(initData.id, spoint);
@ -165,7 +165,7 @@ void VToolBasePoint::AddToFile()
patternPiece.appendChild(doc->createElement(VAbstractPattern::TagModeling));
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::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
VAbstractApplication::VApp()->getUndoStack()->push(addPP);
@ -191,13 +191,13 @@ auto VToolBasePoint::itemChange(QGraphicsItem::GraphicsItemChange change, const
// value - this is new position.
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);
VAbstractApplication::VApp()->getUndoStack()->push(moveSP);
const QList<QGraphicsView *> viewList = scene()->views();
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);
}
@ -249,7 +249,7 @@ void VToolBasePoint::DeleteToolWithConfirm(bool ask)
}
qCDebug(vTool, "Begin deleting.");
DeletePatternPiece *deletePP = new DeletePatternPiece(doc, nameActivDraw);
auto *deletePP = new DeletePatternPiece(doc, nameActivDraw);
connect(deletePP, &DeletePatternPiece::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
VAbstractApplication::VApp()->getUndoStack()->push(deletePP);

View File

@ -156,7 +156,7 @@ auto VToolLineIntersect::Create(VToolLineIntersectInitData initData) -> VToolLin
: 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);
if (initData.typeCreation == Source::FromGui)
@ -183,7 +183,7 @@ auto VToolLineIntersect::Create(VToolLineIntersectInitData initData) -> VToolLin
if (initData.parse == Document::FullParse)
{
VAbstractTool::AddRecord(initData.id, Tool::LineIntersect, initData.doc);
VToolLineIntersect *point = new VToolLineIntersect(initData);
auto *point = new VToolLineIntersect(initData);
initData.scene->addItem(point);
InitToolConnections(initData.scene, point);
VAbstractPattern::AddTool(initData.id, point);

View File

@ -123,7 +123,7 @@ auto VToolPointFromArcAndTangent::Create(VToolPointFromArcAndTangentInitData ini
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);
if (initData.typeCreation == Source::FromGui)
@ -142,7 +142,7 @@ auto VToolPointFromArcAndTangent::Create(VToolPointFromArcAndTangentInitData ini
if (initData.parse == Document::FullParse)
{
VAbstractTool::AddRecord(initData.id, Tool::PointFromArcAndTangent, initData.doc);
VToolPointFromArcAndTangent *point = new VToolPointFromArcAndTangent(initData);
auto *point = new VToolPointFromArcAndTangent(initData);
initData.scene->addItem(point);
InitToolConnections(initData.scene, point);
VAbstractPattern::AddTool(initData.id, point);

View File

@ -222,7 +222,7 @@ auto VToolPointOfContact::Create(VToolPointOfContactInitData &initData) -> VTool
: 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);
if (initData.typeCreation == Source::FromGui)
@ -247,7 +247,7 @@ auto VToolPointOfContact::Create(VToolPointOfContactInitData &initData) -> VTool
if (initData.parse == Document::FullParse)
{
VAbstractTool::AddRecord(initData.id, Tool::PointOfContact, initData.doc);
VToolPointOfContact *point = new VToolPointOfContact(initData);
auto *point = new VToolPointOfContact(initData);
initData.scene->addItem(point);
InitToolConnections(initData.scene, point);
VAbstractPattern::AddTool(initData.id, point);

View File

@ -129,7 +129,7 @@ auto VToolPointOfIntersection::Create(VToolPointOfIntersectionInitData initData)
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);
if (initData.typeCreation == Source::FromGui)
@ -148,7 +148,7 @@ auto VToolPointOfIntersection::Create(VToolPointOfIntersectionInitData initData)
if (initData.parse == Document::FullParse)
{
VAbstractTool::AddRecord(initData.id, Tool::PointOfIntersection, initData.doc);
VToolPointOfIntersection *point = new VToolPointOfIntersection(initData);
auto *point = new VToolPointOfIntersection(initData);
initData.scene->addItem(point);
InitToolConnections(initData.scene, point);
VAbstractPattern::AddTool(initData.id, point);

View File

@ -123,7 +123,7 @@ auto VToolPointOfIntersectionArcs::Create(VToolPointOfIntersectionArcsInitData i
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);
if (initData.typeCreation == Source::FromGui)
@ -142,7 +142,7 @@ auto VToolPointOfIntersectionArcs::Create(VToolPointOfIntersectionArcsInitData i
if (initData.parse == Document::FullParse)
{
VAbstractTool::AddRecord(initData.id, Tool::PointOfIntersectionArcs, initData.doc);
VToolPointOfIntersectionArcs *point = new VToolPointOfIntersectionArcs(initData);
auto *point = new VToolPointOfIntersectionArcs(initData);
initData.scene->addItem(point);
InitToolConnections(initData.scene, point);
VAbstractPattern::AddTool(initData.id, point);

View File

@ -141,7 +141,7 @@ auto VToolPointOfIntersectionCircles::Create(VToolPointOfIntersectionCirclesInit
: 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);
if (initData.typeCreation == Source::FromGui)
@ -160,7 +160,7 @@ auto VToolPointOfIntersectionCircles::Create(VToolPointOfIntersectionCirclesInit
if (initData.parse == Document::FullParse)
{
VAbstractTool::AddRecord(initData.id, Tool::PointOfIntersectionCircles, initData.doc);
VToolPointOfIntersectionCircles *point = new VToolPointOfIntersectionCircles(initData);
auto *point = new VToolPointOfIntersectionCircles(initData);
initData.scene->addItem(point);
InitToolConnections(initData.scene, 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());
}
VSpline *spl1 = new VSpline(spl->GetP1(), spl1p2, spl1p3, *p);
VSpline *spl2 = new VSpline(*p, spl2p2, spl2p3, spl->GetP4());
auto *spl1 = new VSpline(spl->GetP1(), spl1p2, spl1p3, *p);
auto *spl2 = new VSpline(*p, spl2p2, spl2p3, spl->GetP4());
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
QMap<quint32, QString> groupsContainingItem = doc->GetGroupsContainingItem(this->getId(), itemId, true);
QActionGroup *actionsRemoveFromGroup = new QActionGroup(this);
auto *actionsRemoveFromGroup = new QActionGroup(this);
if (not groupsContainingItem.empty())
{
QMenu *menuRemoveFromGroup =

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -241,7 +241,7 @@ void VAbstractTool::DeleteToolWithConfirm(bool ask)
void VAbstractTool::PerformDelete()
{
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);
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
{
const MoveDoubleLabel *moveCommand = static_cast<const MoveDoubleLabel *>(command);
const auto *moveCommand = static_cast<const MoveDoubleLabel *>(command);
SCASSERT(moveCommand != nullptr)
if (moveCommand->GetPointId() != nodeId ||
@ -151,7 +151,7 @@ void MoveDoubleLabel::Do(const QPointF &pos)
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);
}

View File

@ -68,7 +68,7 @@ OperationMoveLabel::OperationMoveLabel(quint32 idTool, VAbstractPattern *doc, co
//---------------------------------------------------------------------------------------------------------------------
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)
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, 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);
}

View File

@ -86,7 +86,7 @@ void OperationShowLabel::Do(bool 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);
}

View File

@ -106,7 +106,7 @@ void ShowDoubleLabel::Do(bool 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);
}

View File

@ -81,7 +81,7 @@ void ShowLabel::Do(bool 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);
}

View File

@ -82,7 +82,7 @@ void MovePiece::redo()
// cppcheck-suppress unusedFunction
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)
const quint32 id = moveCommand->getDetId();
@ -112,7 +112,7 @@ void MovePiece::Do(qreal x, qreal y)
{
SaveCoordinates(domElement, x, y);
VToolSeamAllowance *tool = qobject_cast<VToolSeamAllowance *>(VAbstractPattern::getTool(nodeId));
auto *tool = qobject_cast<VToolSeamAllowance *>(VAbstractPattern::getTool(nodeId));
if (tool)
{
tool->Move(x, y);

View File

@ -71,7 +71,7 @@ void MoveSplinePath::redo()
//---------------------------------------------------------------------------------------------------------------------
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)
const quint32 id = moveCommand->getSplinePathId();

View File

@ -67,7 +67,7 @@ void RenamePP::redo()
//---------------------------------------------------------------------------------------------------------------------
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)
const QString oldName = renameCommand->getOldPPname();

View File

@ -72,7 +72,7 @@ void SavePiecePathOptions::undo()
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();
}
@ -104,7 +104,7 @@ void SavePiecePathOptions::redo()
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();
}
@ -119,7 +119,7 @@ void SavePiecePathOptions::redo()
//---------------------------------------------------------------------------------------------------------------------
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);
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
{
const SaveToolOptions *saveCommand = static_cast<const SaveToolOptions *>(command);
const auto *saveCommand = static_cast<const SaveToolOptions *>(command);
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)
{
FancyTab *tab = new FancyTab(this);
auto *tab = new FancyTab(this);
tab->m_icon = icon;
tab->m_text = label;
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
// 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)
{

View File

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

View File

@ -45,7 +45,7 @@ auto VComboBoxDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem
Q_UNUSED(option)
Q_UNUSED(index)
QComboBox *editor = new QComboBox(parent);
auto *editor = new QComboBox(parent);
editor->addItems(m_items);
return editor;
@ -56,7 +56,7 @@ void VComboBoxDelegate::setEditorData(QWidget *editor, const QModelIndex &index)
{
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);
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
{
QComboBox *comboBox = static_cast<QComboBox*>(editor);
auto *comboBox = static_cast<QComboBox *>(editor);
QString value;
const int cIndex = comboBox->currentIndex();

View File

@ -136,7 +136,7 @@ void VPlainTextEdit::MatchParentheses()
//---------------------------------------------------------------------------------------------------------------------
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();
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
{
VTextBlockData *data = static_cast<VTextBlockData *>(currentBlock.userData());
auto *data = static_cast<VTextBlockData *>(currentBlock.userData());
QVector<ParenthesisInfo *> const parentheses = data->Parentheses();
int const docPos = currentBlock.position();

View File

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