diff --git a/ChangeLog.txt b/ChangeLog.txt
index 737dba10c..e72c5e1b5 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -52,6 +52,7 @@
# Version 0.4.6
- [#594] Broken export on Mac.
- Math parser allows apostrophe in variable name.
+- [#603] Wrong layout caused by wrong seam allowance.
# Version 0.4.5 October 15, 2016
- [#435] Valentina doesn't change the cursor.
diff --git a/src/app/share/collection/bugs/Issue_#603.val b/src/app/share/collection/bugs/Issue_#603.val
new file mode 100644
index 000000000..b5ec518df
--- /dev/null
+++ b/src/app/share/collection/bugs/Issue_#603.val
@@ -0,0 +1,280 @@
+
+
+
+ 0.2.4
+ cm
+
+
+
+ Issue_#603.vit
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/share/collection/bugs/Issue_#603.vit b/src/app/share/collection/bugs/Issue_#603.vit
new file mode 100644
index 000000000..a96e2962c
--- /dev/null
+++ b/src/app/share/collection/bugs/Issue_#603.vit
@@ -0,0 +1,36 @@
+
+
+
+ 0.3.3
+ false
+
+ cm
+ 998
+
+
+
+ 1800-01-01
+ unknown
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/tape/dialogs/configpages/tapeconfigurationpage.cpp b/src/app/tape/dialogs/configpages/tapeconfigurationpage.cpp
index 4a2217602..922a5dfea 100644
--- a/src/app/tape/dialogs/configpages/tapeconfigurationpage.cpp
+++ b/src/app/tape/dialogs/configpages/tapeconfigurationpage.cpp
@@ -181,7 +181,7 @@ QGroupBox *TapeConfigurationPage::LangGroup()
{
langCombo->setCurrentIndex(index);
}
- connect(langCombo, static_cast(&QComboBox::currentIndexChanged), [this]()
+ connect(langCombo, static_cast(&QComboBox::currentIndexChanged), RECEIVER(this)[this]()
{
langChanged = true;
});
@@ -231,7 +231,7 @@ QGroupBox *TapeConfigurationPage::PMSystemGroup()
pmSystemLayout->addRow(systemBookLabel, systemBookValueLabel);
- connect(systemCombo, static_cast(&QComboBox::currentIndexChanged), [this]()
+ connect(systemCombo, static_cast(&QComboBox::currentIndexChanged), RECEIVER(this)[this]()
{
systemChanged = true;
#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0)
@@ -285,7 +285,7 @@ QGroupBox *TapeConfigurationPage::GradationGroup()
defGradationChanged = true;
};
- connect(defHeightCombo, static_cast(&QComboBox::currentIndexChanged),
+ connect(defHeightCombo, static_cast(&QComboBox::currentIndexChanged), RECEIVER(this)
DefGradationChanged);
gradationLayout->addRow(defHeightLabel, defHeightCombo);
@@ -298,7 +298,7 @@ QGroupBox *TapeConfigurationPage::GradationGroup()
{
defSizeCombo->setCurrentIndex(index);
}
- connect(defHeightCombo, static_cast(&QComboBox::currentIndexChanged),
+ connect(defHeightCombo, static_cast(&QComboBox::currentIndexChanged), RECEIVER(this)
DefGradationChanged);
gradationLayout->addRow(defSizeLabel, defSizeCombo);
diff --git a/src/app/tape/dialogs/configpages/tapepathpage.cpp b/src/app/tape/dialogs/configpages/tapepathpage.cpp
index 0aff9cf42..659e03ec6 100644
--- a/src/app/tape/dialogs/configpages/tapepathpage.cpp
+++ b/src/app/tape/dialogs/configpages/tapepathpage.cpp
@@ -54,7 +54,7 @@ TapePathPage::TapePathPage(QWidget *parent)
pathGroup(nullptr)
{
QGroupBox *pathGroup = PathGroup();
- SCASSERT(pathGroup != nullptr);
+ SCASSERT(pathGroup != nullptr)
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(pathGroup);
@@ -76,7 +76,7 @@ void TapePathPage::DefaultPath()
{
const int row = pathTable->currentRow();
QTableWidgetItem *item = pathTable->item(row, 1);
- SCASSERT(item != nullptr);
+ SCASSERT(item != nullptr)
switch (row)
{
@@ -102,7 +102,7 @@ void TapePathPage::EditPath()
{
const int row = pathTable->currentRow();
QTableWidgetItem *item = pathTable->item(row, 1);
- SCASSERT(item != nullptr);
+ SCASSERT(item != nullptr)
QString path;
switch (row)
diff --git a/src/app/tape/dialogs/dialogabouttape.cpp b/src/app/tape/dialogs/dialogabouttape.cpp
index 808c6a338..e2d5c6ef6 100644
--- a/src/app/tape/dialogs/dialogabouttape.cpp
+++ b/src/app/tape/dialogs/dialogabouttape.cpp
@@ -50,7 +50,7 @@ DialogAboutTape::DialogAboutTape(QWidget *parent)
//mApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
RetranslateUi();
- connect(ui->pushButton_Web_Site, &QPushButton::clicked, [this]()
+ connect(ui->pushButton_Web_Site, &QPushButton::clicked, RECEIVER(this)[this]()
{
if ( QDesktopServices::openUrl(QUrl(VER_COMPANYDOMAIN_STR)) == false)
{
@@ -58,7 +58,8 @@ DialogAboutTape::DialogAboutTape(QWidget *parent)
}
});
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &DialogAboutTape::close);
- connect(ui->pushButtonCheckUpdate, &QPushButton::clicked, [](){
+ connect(ui->pushButtonCheckUpdate, &QPushButton::clicked, []()
+ {
FvUpdater::sharedUpdater()->CheckForUpdatesNotSilent();
});
@@ -112,7 +113,7 @@ void DialogAboutTape::showEvent(QShowEvent *event)
//---------------------------------------------------------------------------------------------------------------------
void DialogAboutTape::FontPointSize(QWidget *w, int pointSize)
{
- SCASSERT(w != nullptr);
+ SCASSERT(w != nullptr)
QFont font = w->font();
font.setPointSize(pointSize);
diff --git a/src/app/tape/dialogs/dialogexporttocsv.cpp b/src/app/tape/dialogs/dialogexporttocsv.cpp
index b00b67bf1..8164a437b 100644
--- a/src/app/tape/dialogs/dialogexporttocsv.cpp
+++ b/src/app/tape/dialogs/dialogexporttocsv.cpp
@@ -56,8 +56,8 @@ DialogExportToCSV::DialogExportToCSV(QWidget *parent)
SetSeparator(qApp->TapeSettings()->GetCSVSeparator());
QPushButton *bDefaults = ui->buttonBox->button(QDialogButtonBox::RestoreDefaults);
- SCASSERT(bDefaults != nullptr);
- connect(bDefaults, &QPushButton::clicked, [this]()
+ SCASSERT(bDefaults != nullptr)
+ connect(bDefaults, &QPushButton::clicked, RECEIVER(this)[this]()
{
ui->checkBoxWithHeader->setChecked(qApp->TapeSettings()->GetDefCSVWithHeader());
ui->comboBoxCodec->setCurrentIndex(ui->comboBoxCodec->findData(qApp->TapeSettings()->GetDefCSVCodec()));
diff --git a/src/app/tape/dialogs/dialognewmeasurements.cpp b/src/app/tape/dialogs/dialognewmeasurements.cpp
index 897af7bb7..11dbfa6bf 100644
--- a/src/app/tape/dialogs/dialognewmeasurements.cpp
+++ b/src/app/tape/dialogs/dialognewmeasurements.cpp
@@ -172,7 +172,7 @@ void DialogNewMeasurements::CurrentTypeChanged(int index)
//---------------------------------------------------------------------------------------------------------------------
void DialogNewMeasurements::CurrentUnitChanged(int index)
{
- Q_UNUSED(index);
+ Q_UNUSED(index)
if (MUnit() != Unit::Inch)
{
diff --git a/src/app/tape/dialogs/tapeconfigdialog.cpp b/src/app/tape/dialogs/tapeconfigdialog.cpp
index 457a79e4c..8c2b4a00c 100644
--- a/src/app/tape/dialogs/tapeconfigdialog.cpp
+++ b/src/app/tape/dialogs/tapeconfigdialog.cpp
@@ -71,7 +71,7 @@ TapeConfigDialog::TapeConfigDialog(QWidget *parent)
createIcons();
connect(contentsWidget, &QListWidget::currentItemChanged,
- [this](QListWidgetItem *current, QListWidgetItem *previous)
+ RECEIVER(this)[this](QListWidgetItem *current, QListWidgetItem *previous)
{
if (current == nullptr)
{
@@ -160,7 +160,7 @@ void TapeConfigDialog::showEvent(QShowEvent *event)
//---------------------------------------------------------------------------------------------------------------------
void TapeConfigDialog::resizeEvent(QResizeEvent *event)
{
- Q_UNUSED(event);
+ Q_UNUSED(event)
// remember the size for the next time this dialog is opened, but only
// if widget was already initialized, which rules out the resize at
// dialog creating, which would
diff --git a/src/app/tape/main.cpp b/src/app/tape/main.cpp
index 81574be0a..b5ed4d63d 100644
--- a/src/app/tape/main.cpp
+++ b/src/app/tape/main.cpp
@@ -45,7 +45,7 @@ int main(int argc, char *argv[])
Q_INIT_RESOURCE(schema);
Q_INIT_RESOURCE(flags);
- QT_REQUIRE_VERSION(argc, argv, "5.0.0");
+ QT_REQUIRE_VERSION(argc, argv, "5.0.0")
qt_qhash_seed.store(0); // Lock producing random attribute order in XML
diff --git a/src/app/tape/mapplication.cpp b/src/app/tape/mapplication.cpp
index cad65dc98..90a9f1ec0 100644
--- a/src/app/tape/mapplication.cpp
+++ b/src/app/tape/mapplication.cpp
@@ -436,18 +436,15 @@ bool MApplication::event(QEvent *e)
case QEvent::FileOpen:
{
QFileOpenEvent *fileOpenEvent = static_cast(e);
- if(fileOpenEvent)
+ const QString macFileOpen = fileOpenEvent->file();
+ if(not macFileOpen.isEmpty())
{
- const QString macFileOpen = fileOpenEvent->file();
- if(not macFileOpen.isEmpty())
+ TMainWindow *mw = MainWindow();
+ if (mw)
{
- TMainWindow *mw = MainWindow();
- if (mw)
- {
- mw->LoadFile(macFileOpen); // open file in existing window
- }
- return true;
+ mw->LoadFile(macFileOpen); // open file in existing window
}
+ return true;
}
break;
}
@@ -479,7 +476,7 @@ void MApplication::OpenSettings()
//---------------------------------------------------------------------------------------------------------------------
VTapeSettings *MApplication::TapeSettings()
{
- SCASSERT(settings != nullptr);
+ SCASSERT(settings != nullptr)
return qobject_cast(settings);
}
diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp
index 57f57c10e..ce6537d23 100644
--- a/src/app/tape/tmainwindow.cpp
+++ b/src/app/tape/tmainwindow.cpp
@@ -1344,7 +1344,7 @@ void TMainWindow::ShowMData()
}
catch(const VExceptionBadId &e)
{
- Q_UNUSED(e);
+ Q_UNUSED(e)
MFields(false);
return;
}
@@ -1403,7 +1403,7 @@ void TMainWindow::ShowMData()
}
catch (qmu::QmuParserError &e)
{
- Q_UNUSED(e);
+ Q_UNUSED(e)
formula = meash->GetFormula();
}
@@ -1446,8 +1446,8 @@ void TMainWindow::ShowMDiagram(const QString &name)
//---------------------------------------------------------------------------------------------------------------------
void TMainWindow::DeployFormula()
{
- SCASSERT(ui->plainTextEditFormula != nullptr);
- SCASSERT(ui->pushButtonGrow != nullptr);
+ SCASSERT(ui->plainTextEditFormula != nullptr)
+ SCASSERT(ui->pushButtonGrow != nullptr)
const QTextCursor cursor = ui->plainTextEditFormula->textCursor();
@@ -1787,7 +1787,7 @@ void TMainWindow::SetupMenu()
{
QAction *action = new QAction(this);
recentFileActs[i] = action;
- connect(action, &QAction::triggered, [action, this]()
+ connect(action, &QAction::triggered, RECEIVER(this)[action, this]()
{
if (action != nullptr)
{
@@ -1828,8 +1828,11 @@ void TMainWindow::SetupMenu()
AboutToShowWindowMenu();
// Help
- connect(ui->actionAboutQt, &QAction::triggered, [this](){QMessageBox::aboutQt(this, tr("About Qt"));});
- connect(ui->actionAboutTape, &QAction::triggered, [this]()
+ connect(ui->actionAboutQt, &QAction::triggered, RECEIVER(this)[this]()
+ {
+ QMessageBox::aboutQt(this, tr("About Qt"));
+ });
+ connect(ui->actionAboutTape, &QAction::triggered, RECEIVER(this)[this]()
{
DialogAboutTape *aboutDialog = new DialogAboutTape(this);
aboutDialog->setAttribute(Qt::WA_DeleteOnClose, true);
@@ -1844,7 +1847,7 @@ void TMainWindow::SetupMenu()
//---------------------------------------------------------------------------------------------------------------------
void TMainWindow::InitWindow()
{
- SCASSERT(m != nullptr);
+ SCASSERT(m != nullptr)
ui->labelToolTip->setVisible(false);
ui->tabWidget->setVisible(true);
ui->dockWidgetDiagram->setVisible(dockDiagramVisible);
@@ -1969,9 +1972,9 @@ void TMainWindow::InitWindow()
connect(ui->comboBoxPMSystem, static_cast(&QComboBox::currentIndexChanged), this,
&TMainWindow::SavePMSystem);
- connect(ui->lineEditFind, &QLineEdit::textChanged, [=] (const QString &term){search->Find(term);});
- connect(ui->toolButtonFindPrevious, &QToolButton::clicked, [=] (){search->FindPrevious();});
- connect(ui->toolButtonFindNext, &QToolButton::clicked, [=] (){search->FindNext();});
+ connect(ui->lineEditFind, &QLineEdit::textChanged, [this] (const QString &term){search->Find(term);});
+ connect(ui->toolButtonFindPrevious, &QToolButton::clicked, [this] (){search->FindPrevious();});
+ connect(ui->toolButtonFindNext, &QToolButton::clicked, [this] (){search->FindNext();});
connect(search.data(), &VTableSearch::HasResult, [this] (bool state)
{
@@ -2007,7 +2010,10 @@ void TMainWindow::InitWindow()
connect(ui->plainTextEditDescription, &QPlainTextEdit::textChanged, this, &TMainWindow::SaveMDescription);
connect(ui->lineEditFullName, &QLineEdit::textEdited, this, &TMainWindow::SaveMFullName);
- connect(ui->pushButtonShowInExplorer, &QPushButton::clicked, [this](){ShowInGraphicalShell(curFile);});
+ connect(ui->pushButtonShowInExplorer, &QPushButton::clicked, RECEIVER(this)[this]()
+ {
+ ShowInGraphicalShell(curFile);
+ });
InitUnits();
@@ -2052,7 +2058,7 @@ void TMainWindow::ShowUnits()
//---------------------------------------------------------------------------------------------------------------------
void TMainWindow::ShowHeaderUnits(QTableWidget *table, int column, const QString &unit)
{
- SCASSERT(table != nullptr);
+ SCASSERT(table != nullptr)
QString header = table->horizontalHeaderItem(column)->text();
const int index = header.indexOf(QLatin1String("("));
@@ -2309,7 +2315,7 @@ void TMainWindow::RefreshTable()
}
catch (qmu::QmuParserError &e)
{
- Q_UNUSED(e);
+ Q_UNUSED(e)
formula = meash->GetFormula();
}
@@ -2819,10 +2825,10 @@ void TMainWindow::UpdateRecentFileActions()
//---------------------------------------------------------------------------------------------------------------------
void TMainWindow::CreateWindowMenu(QMenu *menu)
{
- SCASSERT(menu != nullptr);
+ SCASSERT(menu != nullptr)
QAction *action = menu->addAction(tr("&New Window"));
- connect(action, &QAction::triggered, [this]()
+ connect(action, &QAction::triggered, RECEIVER(this)[this]()
{
qApp->NewMainWindow();
qApp->MainWindow()->activateWindow();
@@ -2919,8 +2925,8 @@ bool TMainWindow::IgnoreLocking(int error, const QString &path)
}
return true;
#else
- Q_UNUSED(error);
- Q_UNUSED(path);
+ Q_UNUSED(error)
+ Q_UNUSED(path)
return true;// On older Qt lock assumed always taken. Allow user to ignore warning.
#endif // QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
}
@@ -2990,7 +2996,7 @@ void TMainWindow::InitUnits()
//---------------------------------------------------------------------------------------------------------------------
void TMainWindow::InitComboBoxUnits()
{
- SCASSERT(comboBoxUnits != nullptr);
+ SCASSERT(comboBoxUnits != nullptr)
comboBoxUnits->addItem(VDomDocument::UnitsToStr(Unit::Cm, true), QVariant(static_cast(Unit::Cm)));
comboBoxUnits->addItem(VDomDocument::UnitsToStr(Unit::Mm, true), QVariant(static_cast(Unit::Mm)));
comboBoxUnits->addItem(VDomDocument::UnitsToStr(Unit::Inch, true), QVariant(static_cast(Unit::Inch)));
@@ -2999,7 +3005,7 @@ void TMainWindow::InitComboBoxUnits()
//---------------------------------------------------------------------------------------------------------------------
void TMainWindow::InitGender(QComboBox *gender)
{
- SCASSERT(gender != nullptr);
+ SCASSERT(gender != nullptr)
gender->addItem(tr("unknown", "gender"), QVariant(static_cast(GenderType::Unknown)));
gender->addItem(tr("male", "gender"), QVariant(static_cast(GenderType::Male)));
gender->addItem(tr("female", "gender"), QVariant(static_cast(GenderType::Female)));
diff --git a/src/app/valentina/core/vapplication.cpp b/src/app/valentina/core/vapplication.cpp
index 8c9130e04..99bd9d202 100644
--- a/src/app/valentina/core/vapplication.cpp
+++ b/src/app/valentina/core/vapplication.cpp
@@ -637,18 +637,15 @@ bool VApplication::event(QEvent *e)
case QEvent::FileOpen:
{
QFileOpenEvent *fileOpenEvent = static_cast(e);
- if(fileOpenEvent)
+ const QString macFileOpen = fileOpenEvent->file();
+ if(not macFileOpen.isEmpty())
{
- const QString macFileOpen = fileOpenEvent->file();
- if(not macFileOpen.isEmpty())
+ MainWindow *window = qobject_cast(mainWindow);
+ if (window)
{
- MainWindow *window = qobject_cast(mainWindow);
- if (window)
- {
- window->LoadPattern(macFileOpen); // open file in existing window
- }
- return true;
+ window->LoadPattern(macFileOpen); // open file in existing window
}
+ return true;
}
break;
}
@@ -683,7 +680,7 @@ void VApplication::OpenSettings()
//---------------------------------------------------------------------------------------------------------------------
VSettings *VApplication::ValentinaSettings()
{
- SCASSERT(settings != nullptr);
+ SCASSERT(settings != nullptr)
return qobject_cast(settings);
}
diff --git a/src/app/valentina/core/vformulaproperty.cpp b/src/app/valentina/core/vformulaproperty.cpp
index 1686dc6d8..0cf7da219 100644
--- a/src/app/valentina/core/vformulaproperty.cpp
+++ b/src/app/valentina/core/vformulaproperty.cpp
@@ -37,22 +37,20 @@
enum class ChildType : char {Invalid = 0, Value = 1, Formula = 2};
-using namespace VPE;
-
//---------------------------------------------------------------------------------------------------------------------
VFormulaProperty::VFormulaProperty(const QString &name)
: VProperty(name, static_cast(VFormula::FormulaTypeId()))
{
- d_ptr->type = Property::Complex;
+ d_ptr->type = VPE::Property::Complex;
- VStringProperty* tmpValue = new VStringProperty(tr("Value"));
+ VPE::VStringProperty* tmpValue = new VPE::VStringProperty(tr("Value"));
addChild(tmpValue);
tmpValue->setUpdateBehaviour(true, false);
tmpValue->setReadOnly(true);
tmpValue->setOsSeparator(qApp->Settings()->GetOsSeparator());
tmpValue->setTypeForParent(static_cast(ChildType::Value));
- VStringProperty* tmpFormula = new VStringProperty(tr("Formula"));
+ VPE::VStringProperty* tmpFormula = new VPE::VStringProperty(tr("Formula"));
addChild(tmpFormula);
tmpFormula->setClearButtonEnable(true);
tmpFormula->setUpdateBehaviour(true, false);
@@ -94,8 +92,8 @@ Qt::ItemFlags VFormulaProperty::flags(int column) const
QWidget* VFormulaProperty::createEditor(QWidget* parent, const QStyleOptionViewItem& options,
const QAbstractItemDelegate* delegate)
{
- Q_UNUSED(options);
- Q_UNUSED(delegate);
+ Q_UNUSED(options)
+ Q_UNUSED(delegate)
VFormula formula = VProperty::d_ptr->VariantValue.value();
VFormulaPropertyEditor* tmpEditor = new VFormulaPropertyEditor(parent);
@@ -143,7 +141,7 @@ QString VFormulaProperty::type() const
}
//---------------------------------------------------------------------------------------------------------------------
-VProperty *VFormulaProperty::clone(bool include_children, VProperty *container) const
+VPE::VProperty *VFormulaProperty::clone(bool include_children, VProperty *container) const
{
if (!container)
{
diff --git a/src/app/valentina/core/vformulapropertyeditor.cpp b/src/app/valentina/core/vformulapropertyeditor.cpp
index 0100c8741..ad894f790 100644
--- a/src/app/valentina/core/vformulapropertyeditor.cpp
+++ b/src/app/valentina/core/vformulapropertyeditor.cpp
@@ -39,8 +39,6 @@
#include "../vpropertyexplorer/vproperty.h"
#include "../vtools/dialogs/support/dialogeditwrongformula.h"
-using namespace VPE;
-
// VFormulaPropertyEditor
//---------------------------------------------------------------------------------------------------------------------
VFormulaPropertyEditor::VFormulaPropertyEditor(QWidget *parent)
@@ -100,7 +98,7 @@ void VFormulaPropertyEditor::onToolButtonClicked()
TextLabel->setText(formula.getStringValue());
delete tmpWidget;
emit dataChangedByUser(formula, this);
- UserChangeEvent *event = new UserChangeEvent();
+ VPE::UserChangeEvent *event = new VPE::UserChangeEvent();
QCoreApplication::postEvent ( this, event );
}
}
diff --git a/src/app/valentina/core/vtooloptionspropertybrowser.cpp b/src/app/valentina/core/vtooloptionspropertybrowser.cpp
index da1c1104c..8e0e356bd 100644
--- a/src/app/valentina/core/vtooloptionspropertybrowser.cpp
+++ b/src/app/valentina/core/vtooloptionspropertybrowser.cpp
@@ -43,16 +43,14 @@
#include
#include
-using namespace VPE;
-
//---------------------------------------------------------------------------------------------------------------------
VToolOptionsPropertyBrowser::VToolOptionsPropertyBrowser(QDockWidget *parent)
:QObject(parent), PropertyModel(nullptr), formView(nullptr), currentItem(nullptr),
- propertyToId(QMap()),
- idToProperty(QMap())
+ propertyToId(QMap()),
+ idToProperty(QMap())
{
- PropertyModel = new VPropertyModel(this);
- formView = new VPropertyFormView(PropertyModel, parent);
+ PropertyModel = new VPE::VPropertyModel(this);
+ formView = new VPE::VPropertyFormView(PropertyModel, parent);
formView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
QScrollArea *scroll = new QScrollArea(parent);
@@ -61,7 +59,8 @@ VToolOptionsPropertyBrowser::VToolOptionsPropertyBrowser(QDockWidget *parent)
parent->setWidget(scroll);
- connect(PropertyModel, &VPropertyModel::onDataChangedByEditor, this, &VToolOptionsPropertyBrowser::userChangedData);
+ connect(PropertyModel, &VPE::VPropertyModel::onDataChangedByEditor, this,
+ &VToolOptionsPropertyBrowser::userChangedData);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -154,10 +153,9 @@ void VToolOptionsPropertyBrowser::ShowItemOptions(QGraphicsItem *item)
ShowOptionsToolTriangle(item);
break;
case VGraphicsSimpleTextItem::Type:
- currentItem = item->parentItem();
- ShowItemOptions(currentItem);
- break;
case VControlPointSpline::Type:
+ case VSimplePoint::Type:
+ case VSimpleCurve::Type:
currentItem = item->parentItem();
ShowItemOptions(currentItem);
break;
@@ -173,14 +171,6 @@ void VToolOptionsPropertyBrowser::ShowItemOptions(QGraphicsItem *item)
case VToolPointFromArcAndTangent::Type:
ShowOptionsToolPointFromArcAndTangent(item);
break;
- case VSimplePoint::Type:
- currentItem = item->parentItem();
- ShowItemOptions(currentItem);
- break;
- case VSimpleCurve::Type:
- currentItem = item->parentItem();
- ShowItemOptions(currentItem);
- break;
case VToolTrueDarts::Type:
ShowOptionsToolTrueDarts(item);
break;
@@ -290,8 +280,6 @@ void VToolOptionsPropertyBrowser::UpdateOptions()
UpdateOptionsToolTriangle();
break;
case VGraphicsSimpleTextItem::Type:
- ShowItemOptions(currentItem->parentItem());
- break;
case VControlPointSpline::Type:
ShowItemOptions(currentItem->parentItem());
break;
@@ -339,9 +327,9 @@ void VToolOptionsPropertyBrowser::RefreshOptions()
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::userChangedData(VProperty *property)
+void VToolOptionsPropertyBrowser::userChangedData(VPE::VProperty *property)
{
- VProperty *prop = property;
+ VPE::VProperty *prop = property;
if (!propertyToId.contains(prop))
{
if (!propertyToId.contains(prop->getParent()))// Maybe we know parent
@@ -526,7 +514,7 @@ void VToolOptionsPropertyBrowser::AddPropertyFormula(const QString &propertyName
template
void VToolOptionsPropertyBrowser::AddPropertyObjectName(Tool *i, const QString &propertyName, bool readOnly)
{
- auto itemName = new VStringProperty(propertyName);
+ auto itemName = new VPE::VStringProperty(propertyName);
itemName->setClearButtonEnable(true);
itemName->setValue(i->name());
itemName->setReadOnly(readOnly);
@@ -537,7 +525,7 @@ void VToolOptionsPropertyBrowser::AddPropertyObjectName(Tool *i, const QString &
template
void VToolOptionsPropertyBrowser::AddPropertyPointName1(Tool *i, const QString &propertyName)
{
- VStringProperty *itemName = new VStringProperty(propertyName);
+ VPE::VStringProperty *itemName = new VPE::VStringProperty(propertyName);
itemName->setClearButtonEnable(true);
itemName->setValue(i->nameP1());
AddProperty(itemName, AttrName1);
@@ -547,7 +535,7 @@ void VToolOptionsPropertyBrowser::AddPropertyPointName1(Tool *i, const QString &
template
void VToolOptionsPropertyBrowser::AddPropertyPointName2(Tool *i, const QString &propertyName)
{
- VStringProperty *itemName = new VStringProperty(propertyName);
+ VPE::VStringProperty *itemName = new VPE::VStringProperty(propertyName);
itemName->setClearButtonEnable(true);
itemName->setValue(i->nameP2());
AddProperty(itemName, AttrName2);
@@ -557,7 +545,7 @@ void VToolOptionsPropertyBrowser::AddPropertyPointName2(Tool *i, const QString &
template
void VToolOptionsPropertyBrowser::AddPropertyOperationSuffix(Tool *i, const QString &propertyName, bool readOnly)
{
- auto itemSuffix = new VStringProperty(propertyName);
+ auto itemSuffix = new VPE::VStringProperty(propertyName);
itemSuffix->setClearButtonEnable(true);
itemSuffix->setValue(i->Suffix());
itemSuffix->setReadOnly(readOnly);
@@ -568,7 +556,7 @@ void VToolOptionsPropertyBrowser::AddPropertyOperationSuffix(Tool *i, const QStr
template
void VToolOptionsPropertyBrowser::AddPropertyCrossPoint(Tool *i, const QString &propertyName)
{
- VEnumProperty* itemProperty = new VEnumProperty(propertyName);
+ VPE::VEnumProperty* itemProperty = new VPE::VEnumProperty(propertyName);
itemProperty->setLiterals(QStringList()<< tr("First point") << tr("Second point"));
itemProperty->setValue(static_cast(i->GetCrossCirclesPoint())-1);
AddProperty(itemProperty, AttrCrossPoint);
@@ -578,7 +566,7 @@ void VToolOptionsPropertyBrowser::AddPropertyCrossPoint(Tool *i, const QString &
template
void VToolOptionsPropertyBrowser::AddPropertyVCrossPoint(Tool *i, const QString &propertyName)
{
- auto itemProperty = new VEnumProperty(propertyName);
+ auto itemProperty = new VPE::VEnumProperty(propertyName);
itemProperty->setLiterals(QStringList()<< tr("Highest point") << tr("Lowest point"));
itemProperty->setValue(static_cast(i->GetVCrossPoint())-1);
AddProperty(itemProperty, AttrVCrossPoint);
@@ -588,7 +576,7 @@ void VToolOptionsPropertyBrowser::AddPropertyVCrossPoint(Tool *i, const QString
template
void VToolOptionsPropertyBrowser::AddPropertyHCrossPoint(Tool *i, const QString &propertyName)
{
- auto itemProperty = new VEnumProperty(propertyName);
+ auto itemProperty = new VPE::VEnumProperty(propertyName);
itemProperty->setLiterals(QStringList()<< tr("Leftmost point") << tr("Rightmost point"));
itemProperty->setValue(static_cast(i->GetHCrossPoint())-1);
AddProperty(itemProperty, AttrHCrossPoint);
@@ -598,7 +586,7 @@ void VToolOptionsPropertyBrowser::AddPropertyHCrossPoint(Tool *i, const QString
template
void VToolOptionsPropertyBrowser::AddPropertyAxisType(Tool *i, const QString &propertyName)
{
- auto itemProperty = new VEnumProperty(propertyName);
+ auto itemProperty = new VPE::VEnumProperty(propertyName);
itemProperty->setLiterals(QStringList()<< tr("Vertical axis") << tr("Horizontal axis"));
itemProperty->setValue(static_cast(i->GetAxisType())-1);
AddProperty(itemProperty, AttrAxisType);
@@ -609,9 +597,9 @@ template
void VToolOptionsPropertyBrowser::AddPropertyLineType(Tool *i, const QString &propertyName,
const QMap &styles)
{
- VLineTypeProperty *lineTypeProperty = new VLineTypeProperty(propertyName);
+ VPE::VLineTypeProperty *lineTypeProperty = new VPE::VLineTypeProperty(propertyName);
lineTypeProperty->setStyles(styles);
- const qint32 index = VLineTypeProperty::IndexOfStyle(styles, i->getLineType());
+ const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(styles, i->getLineType());
if (index == -1)
{
qWarning()<<"Can't find line style" << i->getLineType()<<"in list";
@@ -625,9 +613,9 @@ template
void VToolOptionsPropertyBrowser::AddPropertyLineColor(Tool *i, const QString &propertyName,
const QMap &colors, const QString &id)
{
- VLineColorProperty *lineColorProperty = new VLineColorProperty(propertyName);
+ VPE::VLineColorProperty *lineColorProperty = new VPE::VLineColorProperty(propertyName);
lineColorProperty->setColors(colors);
- const qint32 index = VLineColorProperty::IndexOfColor(colors, i->GetLineColor());
+ const qint32 index = VPE::VLineColorProperty::IndexOfColor(colors, i->GetLineColor());
if (index == -1)
{
qWarning()<<"Can't find line style" << i->GetLineColor()<<"in list";
@@ -835,7 +823,7 @@ void VToolOptionsPropertyBrowser::SetAxisType(const QVariant &value)
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::AddProperty(VProperty *property, const QString &id)
+void VToolOptionsPropertyBrowser::AddProperty(VPE::VProperty *property, const QString &id)
{
propertyToId[property] = id;
idToProperty[id] = property;
@@ -843,11 +831,11 @@ void VToolOptionsPropertyBrowser::AddProperty(VProperty *property, const QString
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolSinglePoint(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolSinglePoint(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
switch (PropertiesList().indexOf(id))
@@ -865,15 +853,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolSinglePoint(VProperty *property)
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolEndLine(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolEndLine(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
VToolEndLine *i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@@ -898,15 +886,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolEndLine(VProperty *property)
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolAlongLine(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolAlongLine(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
VToolAlongLine *i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@@ -928,15 +916,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolAlongLine(VProperty *property)
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolArc(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolArc(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
VToolArc *i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 8: // AttrRadius
@@ -958,15 +946,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolArc(VProperty *property)
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolArcWithLength(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolArcWithLength(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
VToolArcWithLength *i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 8: // AttrRadius
@@ -988,15 +976,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolArcWithLength(VProperty *propert
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolBisector(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolBisector(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
VToolBisector *i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@@ -1018,11 +1006,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolBisector(VProperty *property)
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolTrueDarts(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolTrueDarts(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
switch (PropertiesList().indexOf(id))
@@ -1040,15 +1028,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolTrueDarts(VProperty *property)
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolCutArc(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolCutArc(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
VToolCutArc *i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@@ -1064,15 +1052,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCutArc(VProperty *property)
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolCutSpline(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolCutSpline(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
VToolCutSpline *i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@@ -1088,15 +1076,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCutSpline(VProperty *property)
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolCutSplinePath(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolCutSplinePath(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
VToolCutSplinePath *i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@@ -1112,15 +1100,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCutSplinePath(VProperty *propert
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolHeight(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolHeight(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
VToolHeight *i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@@ -1139,15 +1127,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolHeight(VProperty *property)
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolLine(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolLine(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
VToolLine *i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 3: // AttrTypeLine
@@ -1163,11 +1151,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLine(VProperty *property)
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersect(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersect(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
switch (PropertiesList().indexOf(id))
@@ -1182,15 +1170,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersect(VProperty *propert
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolNormal(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolNormal(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
VToolNormal *i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 4: // AttrLength
@@ -1215,15 +1203,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolNormal(VProperty *property)
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolPointOfContact(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolPointOfContact(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
VToolPointOfContact *i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 8: // AttrRadius
@@ -1239,11 +1227,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfContact(VProperty *proper
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersection(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersection(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
switch (PropertiesList().indexOf(id))
@@ -1258,11 +1246,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersection(VProperty *p
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionArcs(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionArcs(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
switch (PropertiesList().indexOf(id))
@@ -1272,7 +1260,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionArcs(VPropert
break;
case 28: // AttrCrossPoint
{
- const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole);
+ const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole);
SetCrossCirclesPoint(value);
break;
}
@@ -1283,15 +1271,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionArcs(VPropert
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCircles(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCircles(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
VToolPointOfIntersectionCircles *i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@@ -1299,7 +1287,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCircles(VProp
break;
case 28: // AttrCrossPoint
{
- const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole);
+ const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole);
SetCrossCirclesPoint(value);
break;
}
@@ -1316,11 +1304,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCircles(VProp
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCurves(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCurves(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
switch (PropertiesList().indexOf(id))
@@ -1330,13 +1318,13 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCurves(VPrope
break;
case 34: // AttrVCrossPoint
{
- const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole);
+ const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole);
SetVCrossCurvesPoint(value);
break;
}
case 35: // AttrHCrossPoint
{
- const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole);
+ const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole);
SetHCrossCurvesPoint(value);
break;
}
@@ -1347,15 +1335,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCurves(VPrope
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolPointFromCircleAndTangent(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolPointFromCircleAndTangent(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
VToolPointFromCircleAndTangent *i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@@ -1366,7 +1354,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointFromCircleAndTangent(VPrope
break;
case 28: // AttrCrossPoint
{
- const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole);
+ const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole);
SetCrossCirclesPoint(value);
break;
}
@@ -1377,11 +1365,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointFromCircleAndTangent(VPrope
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolPointFromArcAndTangent(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolPointFromArcAndTangent(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
switch (PropertiesList().indexOf(id))
@@ -1391,7 +1379,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointFromArcAndTangent(VProperty
break;
case 28: // AttrCrossPoint
{
- const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole);
+ const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole);
SetCrossCirclesPoint(value);
break;
}
@@ -1402,15 +1390,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointFromArcAndTangent(VProperty
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolShoulderPoint(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolShoulderPoint(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
VToolShoulderPoint *i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 4: // AttrLength
@@ -1432,15 +1420,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolShoulderPoint(VProperty *propert
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolSpline(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolSpline(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
auto i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
VSpline spl = i->getSpline();
const VFormula f = value.value();
@@ -1488,15 +1476,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolSpline(VProperty *property)
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezier(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezier(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
auto i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
@@ -1513,15 +1501,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezier(VProperty *property)
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolSplinePath(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolSplinePath(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
VToolSplinePath *i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@@ -1537,15 +1525,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolSplinePath(VProperty *property)
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezierPath(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezierPath(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
VToolCubicBezierPath *i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@@ -1561,11 +1549,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezierPath(VProperty *prope
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolTriangle(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolTriangle(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
switch (PropertiesList().indexOf(id))
@@ -1580,15 +1568,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolTriangle(VProperty *property)
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersectAxis(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersectAxis(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
VToolLineIntersectAxis *i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@@ -1610,15 +1598,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersectAxis(VProperty *pro
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolCurveIntersectAxis(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolCurveIntersectAxis(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
VToolCurveIntersectAxis *i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@@ -1640,15 +1628,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCurveIntersectAxis(VProperty *pr
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolRotation(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolRotation(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
VToolRotation *i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 38: // AttrSuffix
@@ -1664,15 +1652,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolRotation(VProperty *property)
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolMove(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolMove(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
VToolMove *i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 38: // AttrSuffix
@@ -1691,11 +1679,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolMove(VProperty *property)
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolFlippingByLine(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolFlippingByLine(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
switch (PropertiesList().indexOf(id))
@@ -1710,18 +1698,18 @@ void VToolOptionsPropertyBrowser::ChangeDataToolFlippingByLine(VProperty *proper
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolFlippingByAxis(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolFlippingByAxis(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
switch (PropertiesList().indexOf(id))
{
case 39: // AttrAxisType
{
- const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole);
+ const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole);
SetAxisType(value);
break;
}
@@ -1735,15 +1723,15 @@ void VToolOptionsPropertyBrowser::ChangeDataToolFlippingByAxis(VProperty *proper
}
//---------------------------------------------------------------------------------------------------------------------
-void VToolOptionsPropertyBrowser::ChangeDataToolEllipticalArc(VProperty *property)
+void VToolOptionsPropertyBrowser::ChangeDataToolEllipticalArc(VPE::VProperty *property)
{
SCASSERT(property != nullptr)
- QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
+ QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole);
const QString id = propertyToId[property];
VToolEllipticalArc *i = qgraphicsitem_cast(currentItem);
- SCASSERT(i != nullptr);
+ SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 40://AttrRadius1
@@ -1779,7 +1767,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolSinglePoint(QGraphicsItem *item
AddPropertyObjectName(i, tr("Point label"));
- VPointFProperty* itemPosition = new VPointFProperty(tr("Position"));
+ VPE::VPointFProperty* itemPosition = new VPE::VPointFProperty(tr("Position"));
itemPosition->setValue(i->pos());
AddProperty(itemPosition, QLatin1String("position"));
}
@@ -1941,7 +1929,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolNormal(QGraphicsItem *item)
AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics());
AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor);
- VDoubleProperty* itemAngle = new VDoubleProperty(tr("Additional angle degrees"));
+ VPE::VDoubleProperty* itemAngle = new VPE::VDoubleProperty(tr("Additional angle degrees"));
itemAngle->setValue(i->GetAngle());
itemAngle->setSetting("Min", -360);
itemAngle->setSetting("Max", 360);
@@ -2223,12 +2211,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolEndLine()
idToProperty[AttrName]->setValue(i->name());
{
- const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
+ const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
idToProperty[AttrTypeLine]->setValue(index);
}
{
- const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
+ const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
idToProperty[AttrLineColor]->setValue(index);
}
@@ -2248,12 +2236,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolAlongLine()
idToProperty[AttrName]->setValue(i->name());
{
- const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
+ const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
idToProperty[AttrTypeLine]->setValue(index);
}
{
- const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
+ const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
idToProperty[AttrLineColor]->setValue(index);
}
@@ -2279,7 +2267,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolArc()
valueSecondAngle.setValue(i->GetFormulaF2());
idToProperty[AttrAngle2]->setValue(valueSecondAngle);
- const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
+ const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
idToProperty[AttrColor]->setValue(index);
}
@@ -2300,7 +2288,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolArcWithLength()
valueLength.setValue(i->GetFormulaLength());
idToProperty[AttrLength]->setValue(valueLength);
- const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
+ const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
idToProperty[AttrColor]->setValue(index);
}
@@ -2316,12 +2304,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolBisector()
idToProperty[AttrLength]->setValue(valueFormula);
{
- const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
+ const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
idToProperty[AttrTypeLine]->setValue(index);
}
{
- const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
+ const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
idToProperty[AttrLineColor]->setValue(index);
}
}
@@ -2379,12 +2367,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolHeight()
idToProperty[AttrName]->setValue(i->name());
{
- const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
+ const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
idToProperty[AttrTypeLine]->setValue(index);
}
{
- const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
+ const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
idToProperty[AttrLineColor]->setValue(index);
}
}
@@ -2395,12 +2383,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolLine()
VToolLine *i = qgraphicsitem_cast(currentItem);
{
- const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
+ const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
idToProperty[AttrTypeLine]->setValue(index);
}
{
- const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
+ const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
idToProperty[AttrLineColor]->setValue(index);
}
}
@@ -2427,12 +2415,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolNormal()
idToProperty[AttrAngle]->setValue( i->GetAngle());
{
- const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
+ const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
idToProperty[AttrTypeLine]->setValue(index);
}
{
- const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
+ const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
idToProperty[AttrLineColor]->setValue(index);
}
}
@@ -2527,12 +2515,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolShoulderPoint()
idToProperty[AttrName]->setValue(i->name());
{
- const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
+ const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
idToProperty[AttrTypeLine]->setValue(index);
}
{
- const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
+ const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
idToProperty[AttrLineColor]->setValue(index);
}
}
@@ -2577,7 +2565,8 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolSpline()
length2.setValue(length2F);
idToProperty[AttrLength2]->setValue(length2);
- idToProperty[AttrColor]->setValue(VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()));
+ idToProperty[AttrColor]->setValue(VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(),
+ i->GetLineColor()));
}
//---------------------------------------------------------------------------------------------------------------------
@@ -2586,7 +2575,8 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCubicBezier()
auto i = qgraphicsitem_cast(currentItem);
idToProperty[AttrName]->setValue(i->name());
- idToProperty[AttrColor]->setValue(VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()));
+ idToProperty[AttrColor]->setValue(VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(),
+ i->GetLineColor()));
}
//---------------------------------------------------------------------------------------------------------------------
@@ -2595,7 +2585,8 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolSplinePath()
auto i = qgraphicsitem_cast(currentItem);
idToProperty[AttrName]->setValue(i->name());
- idToProperty[AttrColor]->setValue(VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()));
+ idToProperty[AttrColor]->setValue(VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(),
+ i->GetLineColor()));
}
//---------------------------------------------------------------------------------------------------------------------
@@ -2604,7 +2595,8 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCubicBezierPath()
auto i = qgraphicsitem_cast(currentItem);
idToProperty[AttrName]->setValue(i->name());
- idToProperty[AttrColor]->setValue(VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()));
+ idToProperty[AttrColor]->setValue(VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(),
+ i->GetLineColor()));
}
//---------------------------------------------------------------------------------------------------------------------
@@ -2622,12 +2614,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolLineIntersectAxis()
idToProperty[AttrName]->setValue(i->name());
{
- const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
+ const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
idToProperty[AttrTypeLine]->setValue(index);
}
{
- const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
+ const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
idToProperty[AttrLineColor]->setValue(index);
}
@@ -2643,12 +2635,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCurveIntersectAxis()
idToProperty[AttrName]->setValue(i->name());
{
- const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
+ const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
idToProperty[AttrTypeLine]->setValue(index);
}
{
- const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
+ const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
idToProperty[AttrLineColor]->setValue(index);
}
@@ -2723,7 +2715,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolEllipticalArc()
valueFormulaRotationAngle.setValue(i->GetFormulaRotationAngle());
idToProperty[AttrRotationAngle]->setValue(valueFormulaRotationAngle);
- const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
+ const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
idToProperty[AttrColor]->setValue(index);
}
diff --git a/src/app/valentina/dialogs/configdialog.cpp b/src/app/valentina/dialogs/configdialog.cpp
index 5e12c1c10..35320e738 100644
--- a/src/app/valentina/dialogs/configdialog.cpp
+++ b/src/app/valentina/dialogs/configdialog.cpp
@@ -149,7 +149,7 @@ void ConfigDialog::showEvent(QShowEvent *event)
//---------------------------------------------------------------------------------------------------------------------
void ConfigDialog::resizeEvent(QResizeEvent *event)
{
- Q_UNUSED(event);
+ Q_UNUSED(event)
// remember the size for the next time this dialog is opened, but only
// if widget was already initialized, which rules out the resize at
// dialog creating, which would
@@ -168,7 +168,7 @@ void ConfigDialog::createIcons()
createIcon("://icon/path_config.png", tr("Paths"));
connect(contentsWidget, &QListWidget::currentItemChanged,
- [this](QListWidgetItem *current, QListWidgetItem *previous)
+ RECEIVER(this)[this](QListWidgetItem *current, QListWidgetItem *previous)
{
if (current == nullptr)
{
diff --git a/src/app/valentina/dialogs/configpages/configurationpage.cpp b/src/app/valentina/dialogs/configpages/configurationpage.cpp
index e0d2428b8..306c2262c 100644
--- a/src/app/valentina/dialogs/configpages/configurationpage.cpp
+++ b/src/app/valentina/dialogs/configpages/configurationpage.cpp
@@ -106,7 +106,7 @@ void ConfigurationPage::Apply()
settings->SetAutosaveTime(autoTime->value());
QTimer *autoSaveTimer = qApp->getAutoSaveTimer();
- SCASSERT(autoSaveTimer);
+ SCASSERT(autoSaveTimer)
autoSaveCheck->isChecked() ? autoSaveTimer->start(autoTime->value()*60000) : autoSaveTimer->stop();
diff --git a/src/app/valentina/dialogs/configpages/pathpage.cpp b/src/app/valentina/dialogs/configpages/pathpage.cpp
index 97128b929..21d74962a 100644
--- a/src/app/valentina/dialogs/configpages/pathpage.cpp
+++ b/src/app/valentina/dialogs/configpages/pathpage.cpp
@@ -51,7 +51,7 @@ PathPage::PathPage(QWidget *parent)
: QWidget(parent), defaultButton(nullptr), editButton(nullptr), pathTable(nullptr), pathGroup(nullptr)
{
QGroupBox *pathGroup = PathGroup();
- SCASSERT(pathGroup != nullptr);
+ SCASSERT(pathGroup != nullptr)
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(pathGroup);
@@ -75,7 +75,7 @@ void PathPage::DefaultPath()
{
const int row = pathTable->currentRow();
QTableWidgetItem *item = pathTable->item(row, 1);
- SCASSERT(item != nullptr);
+ SCASSERT(item != nullptr)
switch (row)
{
@@ -103,7 +103,7 @@ void PathPage::EditPath()
{
const int row = pathTable->currentRow();
QTableWidgetItem *item = pathTable->item(row, 1);
- SCASSERT(item != nullptr);
+ SCASSERT(item != nullptr)
QString path;
switch (row)
@@ -233,7 +233,7 @@ void PathPage::InitTable()
pathTable->resizeRowsToContents();
pathTable->horizontalHeader()->setStretchLastSection(true);
- connect(pathTable, &QTableWidget::itemSelectionChanged, [this]()
+ connect(pathTable, &QTableWidget::itemSelectionChanged, RECEIVER(this)[this]()
{
defaultButton->setEnabled(true);
defaultButton->setDefault(false);
diff --git a/src/app/valentina/dialogs/dialogaboutapp.cpp b/src/app/valentina/dialogs/dialogaboutapp.cpp
index 1e5c3683d..d779f4a01 100644
--- a/src/app/valentina/dialogs/dialogaboutapp.cpp
+++ b/src/app/valentina/dialogs/dialogaboutapp.cpp
@@ -61,7 +61,7 @@ DialogAboutApp::DialogAboutApp(QWidget *parent) :
ui->pushButton_Web_Site->setText(tr("Web site : %1").arg(VER_COMPANYDOMAIN_STR));
- connect(ui->pushButton_Web_Site, &QPushButton::clicked, [this]()
+ connect(ui->pushButton_Web_Site, &QPushButton::clicked, RECEIVER(this)[this]()
{
if ( QDesktopServices::openUrl(QUrl(VER_COMPANYDOMAIN_STR)) == false)
{
@@ -110,7 +110,7 @@ void DialogAboutApp::showEvent(QShowEvent *event)
//---------------------------------------------------------------------------------------------------------------------
void DialogAboutApp::FontPointSize(QWidget *w, int pointSize)
{
- SCASSERT(w != nullptr);
+ SCASSERT(w != nullptr)
QFont font = w->font();
font.setPointSize(pointSize);
diff --git a/src/app/valentina/dialogs/dialoghistory.cpp b/src/app/valentina/dialogs/dialoghistory.cpp
index b5483ac93..ed7293e33 100644
--- a/src/app/valentina/dialogs/dialoghistory.cpp
+++ b/src/app/valentina/dialogs/dialoghistory.cpp
@@ -62,7 +62,10 @@ DialogHistory::DialogHistory(VContainer *data, VPattern *doc, QWidget *parent)
FillTable();
InitialTable();
connect(ui->tableWidget, &QTableWidget::cellClicked, this, &DialogHistory::cellClicked);
- connect(this, &DialogHistory::ShowHistoryTool, [doc](quint32 id, bool enable){emit doc->ShowTool(id, enable);});
+ connect(this, &DialogHistory::ShowHistoryTool, RECEIVER(doc)[doc](quint32 id, bool enable)
+ {
+ emit doc->ShowTool(id, enable);
+ });
connect(doc, &VPattern::ChangedCursor, this, &DialogHistory::ChangedCursor);
connect(doc, &VPattern::patternChanged, this, &DialogHistory::UpdateHistory);
ShowPoint();
@@ -190,7 +193,7 @@ void DialogHistory::FillTable()
{
cursorRow = CursorRow();
QTableWidgetItem *item = ui->tableWidget->item(cursorRow, 0);
- SCASSERT(item != nullptr);
+ SCASSERT(item != nullptr)
item->setIcon(QIcon("://icon/32x32/put_after.png"));
}
ui->tableWidget->resizeColumnsToContents();
@@ -270,25 +273,25 @@ QString DialogHistory::Record(const VToolRecord &tool)
case Tool::Spline:
{
const QSharedPointer spl = data->GeometricObject(tool.getId());
- SCASSERT(not spl.isNull());
+ SCASSERT(not spl.isNull())
return spl->NameForHistory(tr("Curve"));
}
case Tool::CubicBezier:
{
const QSharedPointer spl = data->GeometricObject(tool.getId());
- SCASSERT(not spl.isNull());
+ SCASSERT(not spl.isNull())
return spl->NameForHistory(tr("Cubic bezier curve"));
}
case Tool::Arc:
{
const QSharedPointer arc = data->GeometricObject(tool.getId());
- SCASSERT(not arc.isNull());
+ SCASSERT(not arc.isNull())
return arc->NameForHistory(tr("Arc"));
}
case Tool::ArcWithLength:
{
const QSharedPointer arc = data->GeometricObject(tool.getId());
- SCASSERT(not arc.isNull());
+ SCASSERT(not arc.isNull())
return tr("%1 with length %2")
.arg(arc->NameForHistory(tr("Arc")))
.arg(arc->GetLength());
@@ -296,13 +299,13 @@ QString DialogHistory::Record(const VToolRecord &tool)
case Tool::SplinePath:
{
const QSharedPointer splPath = data->GeometricObject(tool.getId());
- SCASSERT(not splPath.isNull());
+ SCASSERT(not splPath.isNull())
return splPath->NameForHistory(tr("Spline path"));
}
case Tool::CubicBezierPath:
{
const QSharedPointer splPath = data->GeometricObject(tool.getId());
- SCASSERT(not splPath.isNull());
+ SCASSERT(not splPath.isNull())
return splPath->NameForHistory(tr("Cubic bezier curve path"));
}
case Tool::PointOfContact:
@@ -330,7 +333,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
case Tool::CutArc:
{
const QSharedPointer arc = data->GeometricObject(AttrUInt(domElem, AttrArc));
- SCASSERT(not arc.isNull());
+ SCASSERT(not arc.isNull())
return tr("%1 - cut %2")
.arg(PointName(tool.getId()))
.arg(arc->NameForHistory(tr("arc")));
@@ -339,7 +342,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
{
const quint32 splineId = AttrUInt(domElem, VToolCutSpline::AttrSpline);
const QSharedPointer spl = data->GeometricObject(splineId);
- SCASSERT(not spl.isNull());
+ SCASSERT(not spl.isNull())
return tr("%1 - cut %2")
.arg(PointName(tool.getId()))
.arg(spl->NameForHistory(tr("curve")));
@@ -349,7 +352,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
const quint32 splinePathId = AttrUInt(domElem, VToolCutSplinePath::AttrSplinePath);
const QSharedPointer splPath =
data->GeometricObject(splinePathId);
- SCASSERT(not splPath.isNull());
+ SCASSERT(not splPath.isNull())
return tr("%1 - cut %2")
.arg(PointName(tool.getId()))
.arg(splPath->NameForHistory(tr("curve path")));
@@ -382,7 +385,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
case Tool::EllipticalArc:
{
const QSharedPointer elArc = data->GeometricObject(tool.getId());
- SCASSERT(not elArc.isNull());
+ SCASSERT(not elArc.isNull())
return tr("%1 with length %2")
.arg(elArc->NameForHistory(tr("Elliptical arc")))
.arg(elArc->GetLength());
@@ -499,7 +502,7 @@ void DialogHistory::RetranslateUi()
UpdateHistory();
QTableWidgetItem *item = ui->tableWidget->item(cursorRow, 0);
- SCASSERT(item != nullptr);
+ SCASSERT(item != nullptr)
item->setIcon(QIcon(""));
cursorRow = currentRow;
diff --git a/src/app/valentina/dialogs/dialogincrements.cpp b/src/app/valentina/dialogs/dialogincrements.cpp
index 93ba69a91..3c440c09b 100644
--- a/src/app/valentina/dialogs/dialogincrements.cpp
+++ b/src/app/valentina/dialogs/dialogincrements.cpp
@@ -110,15 +110,15 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
connect(ui->lineEditName, &QLineEdit::editingFinished, this, &DialogIncrements::SaveIncrName);
connect(ui->plainTextEditDescription, &QPlainTextEdit::textChanged, this, &DialogIncrements::SaveIncrDescription);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogIncrements::SaveIncrFormula);
- connect(ui->lineEditFind, &QLineEdit::textEdited, [=](const QString &term){search->Find(term);});
- connect(ui->toolButtonFindPrevious, &QToolButton::clicked, [=](){search->FindPrevious();});
- connect(ui->toolButtonFindNext, &QToolButton::clicked, [=](){search->FindNext();});
+ connect(ui->lineEditFind, &QLineEdit::textEdited, RECEIVER(this)[this](const QString &term){search->Find(term);});
+ connect(ui->toolButtonFindPrevious, &QToolButton::clicked, RECEIVER(this)[this](){search->FindPrevious();});
+ connect(ui->toolButtonFindNext, &QToolButton::clicked, RECEIVER(this)[this](){search->FindNext();});
- connect(search.data(), &VTableSearch::HasResult, [this] (bool state)
+ connect(search.data(), &VTableSearch::HasResult, RECEIVER(this)[this] (bool state)
{
ui->toolButtonFindPrevious->setEnabled(state);
});
- connect(search.data(), &VTableSearch::HasResult, [this] (bool state)
+ connect(search.data(), &VTableSearch::HasResult, RECEIVER(this)[this] (bool state)
{
ui->toolButtonFindNext->setEnabled(state);
});
@@ -168,7 +168,7 @@ void DialogIncrements::FillIncrements()
}
catch (qmu::QmuParserError &e)
{
- Q_UNUSED(e);
+ Q_UNUSED(e)
formula = incr->GetFormula();
}
@@ -184,7 +184,7 @@ void DialogIncrements::FillIncrements()
template
void DialogIncrements::FillTable(const QMap &varTable, QTableWidget *table)
{
- SCASSERT(table != nullptr);
+ SCASSERT(table != nullptr)
qint32 currentRow = -1;
QMapIterator i(varTable);
@@ -270,7 +270,7 @@ void DialogIncrements::ShowUnits()
//---------------------------------------------------------------------------------------------------------------------
void DialogIncrements::ShowHeaderUnits(QTableWidget *table, int column, const QString &unit)
{
- SCASSERT(table != nullptr);
+ SCASSERT(table != nullptr)
const QString header = table->horizontalHeaderItem(column)->text();
const QString unitHeader = QString("%1 (%2)").arg(header).arg(unit);
@@ -280,7 +280,7 @@ void DialogIncrements::ShowHeaderUnits(QTableWidget *table, int column, const QS
//---------------------------------------------------------------------------------------------------------------------
void DialogIncrements::AddCell(QTableWidget *table, const QString &text, int row, int column, int aligment, bool ok)
{
- SCASSERT(table != nullptr);
+ SCASSERT(table != nullptr)
QTableWidgetItem *item = new QTableWidgetItem(text);
item->setTextAlignment(aligment);
@@ -664,8 +664,8 @@ void DialogIncrements::SaveIncrFormula()
//---------------------------------------------------------------------------------------------------------------------
void DialogIncrements::DeployFormula()
{
- SCASSERT(ui->plainTextEditFormula != nullptr);
- SCASSERT(ui->pushButtonGrow != nullptr);
+ SCASSERT(ui->plainTextEditFormula != nullptr)
+ SCASSERT(ui->pushButtonGrow != nullptr)
const QTextCursor cursor = ui->plainTextEditFormula->textCursor();
@@ -797,7 +797,7 @@ void DialogIncrements::ShowIncrementDetails()
}
catch(const VExceptionBadId &e)
{
- Q_UNUSED(e);
+ Q_UNUSED(e)
EnableDetails(false);
return;
}
@@ -820,7 +820,7 @@ void DialogIncrements::ShowIncrementDetails()
}
catch (qmu::QmuParserError &e)
{
- Q_UNUSED(e);
+ Q_UNUSED(e)
formula = incr->GetFormula();
}
diff --git a/src/app/valentina/dialogs/dialoglayoutprogress.cpp b/src/app/valentina/dialogs/dialoglayoutprogress.cpp
index 2419403f5..fa98be00d 100644
--- a/src/app/valentina/dialogs/dialoglayoutprogress.cpp
+++ b/src/app/valentina/dialogs/dialoglayoutprogress.cpp
@@ -54,8 +54,8 @@ DialogLayoutProgress::DialogLayoutProgress(int count, QWidget *parent)
movie->start ();
QPushButton *bCancel = ui->buttonBox->button(QDialogButtonBox::Cancel);
- SCASSERT(bCancel != nullptr);
- connect(bCancel, &QPushButton::clicked, [this](){emit Abort();});
+ SCASSERT(bCancel != nullptr)
+ connect(bCancel, &QPushButton::clicked, RECEIVER(this)[this](){emit Abort();});
setModal(true);
this->setWindowFlags(Qt::Dialog | Qt::WindowTitleHint | Qt::CustomizeWindowHint);
@@ -91,11 +91,10 @@ void DialogLayoutProgress::Error(const LayoutErrors &state)
case LayoutErrors::PrepareLayoutError:
qCritical() << tr("Couldn't prepare data for creation layout");
break;
- case LayoutErrors::ProcessStoped:
- break;
case LayoutErrors::EmptyPaperError:
qCritical() << tr("Several workpieces left not arranged, but none of them match for paper");
break;
+ case LayoutErrors::ProcessStoped:
default:
break;
}
diff --git a/src/app/valentina/dialogs/dialoglayoutsettings.cpp b/src/app/valentina/dialogs/dialoglayoutsettings.cpp
index eae894f50..39aa59c71 100644
--- a/src/app/valentina/dialogs/dialoglayoutsettings.cpp
+++ b/src/app/valentina/dialogs/dialoglayoutsettings.cpp
@@ -224,8 +224,6 @@ void DialogLayoutSettings::SetGroup(const Cases &value)
ui->radioButtonTwoGroups->setChecked(true);
break;
case Cases::CaseDesc:
- ui->radioButtonDescendingArea->setChecked(true);
- break;
default:
ui->radioButtonDescendingArea->setChecked(true);
break;
diff --git a/src/app/valentina/dialogs/dialognewpattern.cpp b/src/app/valentina/dialogs/dialognewpattern.cpp
index fa7e4882a..e71185f69 100644
--- a/src/app/valentina/dialogs/dialognewpattern.cpp
+++ b/src/app/valentina/dialogs/dialognewpattern.cpp
@@ -85,7 +85,7 @@ void DialogNewPattern::CheckState()
}
QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
- SCASSERT(bOk != nullptr);
+ SCASSERT(bOk != nullptr)
bOk->setEnabled(flagName);
}
diff --git a/src/app/valentina/dialogs/dialogpatternproperties.cpp b/src/app/valentina/dialogs/dialogpatternproperties.cpp
index c406548cf..1f9b0b231 100644
--- a/src/app/valentina/dialogs/dialogpatternproperties.cpp
+++ b/src/app/valentina/dialogs/dialogpatternproperties.cpp
@@ -69,7 +69,7 @@ DialogPatternProperties::DialogPatternProperties(const QString &filePath, VPatte
ui->lineEditAuthor->setClearButtonEnabled(true);
#endif
- SCASSERT(doc != nullptr);
+ SCASSERT(doc != nullptr)
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
@@ -87,7 +87,10 @@ DialogPatternProperties::DialogPatternProperties(const QString &filePath, VPatte
}
ui->lineEditPathToFile->setCursorPosition(0);
- connect(ui->pushButtonShowInExplorer, &QPushButton::clicked, [this](){ShowInGraphicalShell(m_filePath);});
+ connect(ui->pushButtonShowInExplorer, &QPushButton::clicked, RECEIVER(this)[this]()
+ {
+ ShowInGraphicalShell(m_filePath);
+ });
#if defined(Q_OS_MAC)
ui->pushButtonShowInExplorer->setText(tr("Show in Finder"));
#endif //defined(Q_OS_MAC)
@@ -108,7 +111,7 @@ DialogPatternProperties::DialogPatternProperties(const QString &filePath, VPatte
&DialogPatternProperties::Apply);
QPushButton *bCancel = ui->buttonBox->button(QDialogButtonBox::Cancel);
- SCASSERT(bCancel != nullptr);
+ SCASSERT(bCancel != nullptr)
connect(bCancel, &QPushButton::clicked, this, &DialogPatternProperties::close);
ui->tabWidget->setCurrentIndex(0);
@@ -135,7 +138,7 @@ DialogPatternProperties::DialogPatternProperties(const QString &filePath, VPatte
const QString size = QString().setNum(doc->GetDefCustomSize());
SetDefaultSize(size);
- connect(ui->radioButtonDefFromP, &QRadioButton::toggled, [this]()
+ connect(ui->radioButtonDefFromP, &QRadioButton::toggled, RECEIVER(this)[this]()
{
ui->comboBoxHeight->setEnabled(ui->radioButtonDefFromP->isChecked());
ui->comboBoxSize->setEnabled(ui->radioButtonDefFromP->isChecked());
@@ -143,19 +146,20 @@ DialogPatternProperties::DialogPatternProperties(const QString &filePath, VPatte
auto DefValueChanged = [this](){defaultChanged = true;};
- connect(ui->radioButtonDefFromP, &QRadioButton::toggled, DefValueChanged);
+ connect(ui->radioButtonDefFromP, &QRadioButton::toggled, RECEIVER(this)DefValueChanged);
ui->radioButtonDefFromP->setChecked(doc->IsDefCustom());
connect(ui->comboBoxHeight, static_cast(&QComboBox::currentIndexChanged),
- DefValueChanged);
- connect(ui->comboBoxSize, static_cast(&QComboBox::currentIndexChanged), DefValueChanged);
+ RECEIVER(this)DefValueChanged);
+ connect(ui->comboBoxSize, static_cast(&QComboBox::currentIndexChanged),
+ RECEIVER(this)DefValueChanged);
const bool readOnly = doc->IsReadOnly();
ui->checkBoxPatternReadOnly->setChecked(readOnly);
if (not readOnly)
{
- connect(ui->checkBoxPatternReadOnly, &QRadioButton::toggled, [this](){securityChanged = true;});
+ connect(ui->checkBoxPatternReadOnly, &QRadioButton::toggled, RECEIVER(this)[this](){securityChanged = true;});
}
else
{
@@ -689,7 +693,7 @@ void DialogPatternProperties::SetOptions(const QMap &option)
template
void DialogPatternProperties::InitComboBox(QComboBox *box, const QMap &option)
{
- SCASSERT(box != nullptr);
+ SCASSERT(box != nullptr)
box->clear();
@@ -725,7 +729,7 @@ void DialogPatternProperties::InitImage()
{
ui->imageLabel->setContextMenuPolicy(Qt::CustomContextMenu);
ui->imageLabel->setScaledContents(true);
- connect(ui->imageLabel, &QWidget::customContextMenuRequested, [this]()
+ connect(ui->imageLabel, &QWidget::customContextMenuRequested, RECEIVER(this)[this]()
{
QMenu menu(this);
menu.addAction(deleteAction);
@@ -741,7 +745,7 @@ void DialogPatternProperties::InitImage()
saveImageAction = new QAction(tr("Save image to file"), this);
showImageAction = new QAction(tr("Show image"), this);
- connect(deleteAction, &QAction::triggered, [this]()
+ connect(deleteAction, &QAction::triggered, RECEIVER(this)[this]()
{
doc->DeleteImage();
ui->imageLabel->setText(tr("Change image"));
@@ -752,7 +756,7 @@ void DialogPatternProperties::InitImage()
connect(changeImageAction, &QAction::triggered, this, &DialogPatternProperties::ChangeImage);
connect(saveImageAction, &QAction::triggered, this, &DialogPatternProperties::SaveImage);
- connect(showImageAction, &QAction::triggered, [this]()
+ connect(showImageAction, &QAction::triggered, RECEIVER(this)[this]()
{
QLabel *label = new QLabel(this, Qt::Window);
const QImage image = GetImage();
diff --git a/src/app/valentina/dialogs/dialogpatternxmledit.cpp b/src/app/valentina/dialogs/dialogpatternxmledit.cpp
index d2509f6e1..f028fd1f8 100644
--- a/src/app/valentina/dialogs/dialogpatternxmledit.cpp
+++ b/src/app/valentina/dialogs/dialogpatternxmledit.cpp
@@ -130,7 +130,7 @@ bool DialogPatternXmlEdit::ApplyNodeChange(QDomNode domElement, QString name, QS
bool DialogPatternXmlEdit::ApplyNodeAdd(QDomNode domElement, VXMLTreeElement* treeElement, QString name, QString value)
{
QDomElement newnode = domElement.ownerDocument().createElement(name);
- //SCASSERT(newnode != nullptr);
+ //SCASSERT(newnode != nullptr)
newnode.setNodeValue(value);
domElement.appendChild(newnode);
treeElement->SetDocNode(newnode);
@@ -285,7 +285,7 @@ bool DialogPatternXmlEdit::DeleteNodeAndSons(VXMLTreeElement * currentNode, bool
}
if (index < 0)
{
- SCASSERT(index==0);
+ SCASSERT(index==0)
return false;
}
parent->removeRow(index);
@@ -321,7 +321,7 @@ DialogPatternXmlEdit::ChangesStackElement* DialogPatternXmlEdit::CreateStackElem
//---------------------------------------------------------------------------------------------------------------------
bool DialogPatternXmlEdit::UndoChange(DialogPatternXmlEdit::ChangesStackElement* current)
{
- SCASSERT(current != nullptr);
+ SCASSERT(current != nullptr)
VXMLTreeElement * currentNode = current->element;
@@ -374,7 +374,7 @@ bool DialogPatternXmlEdit::UndoChange(DialogPatternXmlEdit::ChangesStackElement*
}
if (index < 0)
{
- SCASSERT(index==0);
+ SCASSERT(index==0)
return false;
}
parent->removeRow(index);
@@ -612,7 +612,7 @@ void DialogPatternXmlEdit::RemoveChangeStackElement(ChangesStackElement* elmt)
}
if (index->next == nullptr)
{
- SCASSERT(index->next != nullptr);
+ SCASSERT(index->next != nullptr)
return;
}
delete index->next->newText;
@@ -813,7 +813,7 @@ void DialogPatternXmlEdit::ButtonSetClicked()
{ // If node was created or edited previously, rewrite
if (this->currentNodeEditedStatus == DialogPatternXmlEdit::ChangeTypeDelete)
{ // You shouldn't be able to edit a deleted node...
- SCASSERT(this->currentNodeEditedStatus != DialogPatternXmlEdit::ChangeTypeDelete);
+ SCASSERT(this->currentNodeEditedStatus != DialogPatternXmlEdit::ChangeTypeDelete)
ClearEditData();
return;
}
@@ -933,7 +933,7 @@ void DialogPatternXmlEdit::BaseSelectionChanged(int value)
ui->pushButton_Apply_Changes->setEnabled(false);
index = ui->comboBox_Base_Selection->itemData(value).toInt(); //.convert(QVariant::Int);
- SCASSERT(value < rootBasesNum);
+ SCASSERT(value < rootBasesNum)
// QMessageBox::information(this, "test", QString("%1:%2").arg(value).arg(index));
// Clear all tree info and nodes
@@ -1006,7 +1006,7 @@ void DialogPatternXmlEdit::ElementClicked ( const QModelIndex & index )
}
if (item2->GetelementType() == VXMLTreeElement::TypeRoot)
{
- ui->label_type_value->setText(tr("Root node"));;
+ ui->label_type_value->setText(tr("Root node"));
ui->pushButton_Add_son->setEnabled(true);
}
else if (item2->GetelementType() == VXMLTreeElement::TypeNode)
diff --git a/src/app/valentina/dialogs/dialogsavelayout.cpp b/src/app/valentina/dialogs/dialogsavelayout.cpp
index c6300a2f3..04af0ee44 100644
--- a/src/app/valentina/dialogs/dialogsavelayout.cpp
+++ b/src/app/valentina/dialogs/dialogsavelayout.cpp
@@ -59,7 +59,7 @@ DialogSaveLayout::DialogSaveLayout(int count, const QString &fileName, QWidget *
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
- SCASSERT(bOk != nullptr);
+ SCASSERT(bOk != nullptr)
bOk->setEnabled(false);
#if QT_VERSION > QT_VERSION_CHECK(5, 1, 0)
@@ -97,9 +97,10 @@ DialogSaveLayout::DialogSaveLayout(int count, const QString &fileName, QWidget *
ui->labelExample->setText(tr("Example:") + FileName() + QLatin1String("1") + Format());
};
- connect(ui->lineEditFileName, &QLineEdit::textChanged, ShowExample);
- connect(ui->comboBoxFormat, static_cast(&QComboBox::currentIndexChanged), ShowExample);
- connect(ui->pushButtonBrowse, &QPushButton::clicked, [this]()
+ connect(ui->lineEditFileName, &QLineEdit::textChanged, RECEIVER(this)ShowExample);
+ connect(ui->comboBoxFormat, static_cast(&QComboBox::currentIndexChanged),
+ RECEIVER(this)ShowExample);
+ connect(ui->pushButtonBrowse, &QPushButton::clicked, RECEIVER(this)[this]()
{
const QString dir = QFileDialog::getExistingDirectory(this, tr("Select folder"),
qApp->ValentinaSettings()->GetPathLayout(),
@@ -229,7 +230,7 @@ void DialogSaveLayout::Save()
void DialogSaveLayout::PathChanged(const QString &text)
{
QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
- SCASSERT(bOk != nullptr);
+ SCASSERT(bOk != nullptr)
QPalette palette = ui->lineEditPath->palette();
diff --git a/src/app/valentina/dialogs/vwidgetgroups.cpp b/src/app/valentina/dialogs/vwidgetgroups.cpp
index d43386411..9b8d77a1c 100644
--- a/src/app/valentina/dialogs/vwidgetgroups.cpp
+++ b/src/app/valentina/dialogs/vwidgetgroups.cpp
@@ -103,7 +103,7 @@ void VWidgetGroups::CtxMenu(const QPoint &pos)
item = ui->tableWidget->item(row, 0);
const quint32 id = item->data(Qt::UserRole).toUInt();
- QMenu *menu = new QMenu;
+ QMenu *menu = new QMenu(this);
QAction *actionRename = menu->addAction(tr("Rename"));
QAction *actionDelete = menu->addAction(tr("Delete"));
QAction *selectedAction = menu->exec(ui->tableWidget->viewport()->mapToGlobal(pos));
diff --git a/src/app/valentina/main.cpp b/src/app/valentina/main.cpp
index 8016abe6b..530f40ac8 100644
--- a/src/app/valentina/main.cpp
+++ b/src/app/valentina/main.cpp
@@ -50,7 +50,7 @@ int main(int argc, char *argv[])
Q_INIT_RESOURCE(icons);
Q_INIT_RESOURCE(toolicon);
- QT_REQUIRE_VERSION(argc, argv, "5.0.0");
+ QT_REQUIRE_VERSION(argc, argv, "5.0.0")
qt_qhash_seed.store(0); // Lock producing random attribute order in XML
diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp
index 2918c24cd..354225611 100644
--- a/src/app/valentina/mainwindow.cpp
+++ b/src/app/valentina/mainwindow.cpp
@@ -135,7 +135,7 @@ MainWindow::MainWindow(QWidget *parent)
connect(doc, &VPattern::patternChanged, this, &MainWindow::PatternChangesWereSaved);
connect(doc, &VPattern::UndoCommand, this, &MainWindow::FullParseFile);
connect(doc, &VPattern::SetEnabledGUI, this, &MainWindow::SetEnabledGUI);
- connect(doc, &VPattern::CheckLayout, [this]()
+ connect(doc, &VPattern::CheckLayout, RECEIVER(this)[this]()
{
if (pattern->DataPieces()->count() == 0)
{
@@ -174,7 +174,7 @@ MainWindow::MainWindow(QWidget *parent)
ui->dockWidgetLayoutPages->setVisible(false);
connect(watcher, &QFileSystemWatcher::fileChanged, this, &MainWindow::MeasurementsChanged);
- connect(qApp, &QApplication::focusChanged, [this](QWidget *old, QWidget *now)
+ connect(qApp, &QApplication::focusChanged, RECEIVER(this)[this](QWidget *old, QWidget *now)
{
if (old == nullptr && isAncestorOf(now) == true)
{// focus IN
@@ -575,7 +575,7 @@ void MainWindow::SetToolButton(bool checked, Tool t, const QString &cursor, cons
}
VMainGraphicsScene *scene = qobject_cast(currentScene);
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
connect(scene, &VMainGraphicsScene::ChoosedObject, dialogTool.data(), &DialogTool::ChosenObject);
connect(scene, &VMainGraphicsScene::SelectedObject, dialogTool.data(), &DialogTool::SelectedObject);
@@ -629,11 +629,11 @@ void MainWindow::SetToolButtonWithApply(bool checked, Tool t, const QString &cur
template
void MainWindow::ClosedDialog(int result)
{
- SCASSERT(not dialogTool.isNull());
+ SCASSERT(not dialogTool.isNull())
if (result == QDialog::Accepted)
{
VMainGraphicsScene *scene = qobject_cast(currentScene);
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
QGraphicsItem *tool = dynamic_cast(DrawTool::Create(dialogTool, scene, doc, pattern));
ui->view->itemClicked(tool);
@@ -649,13 +649,13 @@ void MainWindow::ClosedDialog(int result)
template
void MainWindow::ClosedDialogWithApply(int result, VMainGraphicsScene *scene)
{
- SCASSERT(not dialogTool.isNull());
+ SCASSERT(not dialogTool.isNull())
if (result == QDialog::Accepted)
{
// Only create tool if not already created with apply
if (dialogTool->GetAssociatedTool() == nullptr)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
dialogTool->SetAssociatedTool(
dynamic_cast (DrawTool::Create(dialogTool, scene, doc, pattern)));
@@ -666,7 +666,7 @@ void MainWindow::ClosedDialogWithApply(int result, VMainGraphicsScene *scene)
vtool->FullUpdateFromGuiApply();
}
}
- SCASSERT(not dialogTool.isNull());
+ SCASSERT(not dialogTool.isNull())
QGraphicsItem *tool = dynamic_cast(dialogTool->GetAssociatedTool());
ui->view->itemClicked(tool);
if (dialogTool->GetAssociatedTool() != nullptr)
@@ -694,12 +694,12 @@ void MainWindow::ClosedDialogWithApply(int result, VMainGraphicsScene *scene)
template
void MainWindow::ApplyDialog(VMainGraphicsScene *scene)
{
- SCASSERT(not dialogTool.isNull());
+ SCASSERT(not dialogTool.isNull())
// Only create tool if not already created with apply
if (dialogTool->GetAssociatedTool() == nullptr)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
dialogTool->SetAssociatedTool(
static_cast (DrawTool::Create(dialogTool, scene, doc, pattern)));
@@ -707,7 +707,7 @@ void MainWindow::ApplyDialog(VMainGraphicsScene *scene)
else
{ // Or update associated tool with data
VDrawTool * vtool= static_cast(dialogTool->GetAssociatedTool());
- SCASSERT(vtool != nullptr);
+ SCASSERT(vtool != nullptr)
vtool->FullUpdateFromGuiApply();
}
}
@@ -1123,11 +1123,11 @@ void MainWindow::ToolMove(bool checked)
//---------------------------------------------------------------------------------------------------------------------
void MainWindow::ClosedDialogGroup(int result)
{
- SCASSERT(dialogTool != nullptr);
+ SCASSERT(dialogTool != nullptr)
if (result == QDialog::Accepted)
{
DialogGroup *dialog = qobject_cast(dialogTool);
- SCASSERT(dialog != nullptr);
+ SCASSERT(dialog != nullptr)
const QDomElement group = doc->CreateGroup(pattern->getNextId(), dialog->GetName(), dialog->GetGroup());
if (not group.isNull())
{
@@ -1705,9 +1705,9 @@ void MainWindow::ToolBarDraws()
comboBoxDraws->setSizeAdjustPolicy(QComboBox::AdjustToContents);
comboBoxDraws->setEnabled(false);
connect(comboBoxDraws, static_cast(&QComboBox::currentIndexChanged),
- [this](int index){ChangePP(index);});
+ RECEIVER(this)[this](int index){ChangePP(index);});
- connect(ui->actionOptionDraw, &QAction::triggered, [this]()
+ connect(ui->actionOptionDraw, &QAction::triggered, RECEIVER(this)[this]()
{
const QString activDraw = doc->GetNameActivPP();
const QString nameDraw = PatternPieceName(activDraw);
@@ -2076,8 +2076,6 @@ void MainWindow::keyPressEvent ( QKeyEvent * event )
ArrowTool();
break;
case Qt::Key_Return:
- EndVisualization();
- break;
case Qt::Key_Enter:
EndVisualization();
break;
@@ -2096,7 +2094,7 @@ void MainWindow::SaveCurrentScene()
if (mode == Draw::Calculation || mode == Draw::Modeling)
{
VMainGraphicsScene *scene = qobject_cast(currentScene);
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
/*Save transform*/
scene->setTransform(ui->view->transform());
@@ -2115,7 +2113,7 @@ void MainWindow::SaveCurrentScene()
void MainWindow::RestoreCurrentScene()
{
VMainGraphicsScene *scene = qobject_cast(currentScene);
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
/*Set transform for current scene*/
ui->view->setTransform(scene->transform());
@@ -2335,7 +2333,7 @@ void MainWindow::ActionLayout(bool checked)
mode = Draw::Layout;
SetEnableTool(true);
SetEnableWidgets(true);
- ui->toolBox->setCurrentIndex(6);
+ ui->toolBox->setCurrentIndex(ui->toolBox->indexOf(ui->layoutPage));
mouseCoordinate->setText("");
@@ -2615,7 +2613,7 @@ void MainWindow::FullParseFile()
}
catch (const VExceptionUndo &e)
{
- Q_UNUSED(e);
+ Q_UNUSED(e)
/* If user want undo last operation before undo we need finish broken redo operation. For those we post event
* myself. Later in method customEvent call undo.*/
QApplication::postEvent(this, new UndoEvent());
@@ -3577,13 +3575,15 @@ void MainWindow::AddDocks()
//Add dock
actionDockWidgetToolOptions = ui->dockWidgetToolOptions->toggleViewAction();
ui->menuPatternPiece->insertAction(ui->actionPattern_properties, actionDockWidgetToolOptions);
- connect(ui->dockWidgetToolOptions, &QDockWidget::visibilityChanged, [this](bool visible){
+ connect(ui->dockWidgetToolOptions, &QDockWidget::visibilityChanged, RECEIVER(this)[this](bool visible)
+ {
isDockToolOptionsVisible = visible;
});
actionDockWidgetGroups = ui->dockWidgetGroups->toggleViewAction();
ui->menuPatternPiece->insertAction(ui->actionPattern_properties, actionDockWidgetGroups);
- connect(ui->dockWidgetGroups, &QDockWidget::visibilityChanged, [this](bool visible){
+ connect(ui->dockWidgetGroups, &QDockWidget::visibilityChanged, RECEIVER(this)[this](bool visible)
+ {
isDockGroupsVisible = visible;
});
@@ -3634,14 +3634,14 @@ void MainWindow::CreateActions()
connect(ui->actionDetails, &QAction::triggered, this, &MainWindow::ActionDetails);
connect(ui->actionLayout, &QAction::triggered, this, &MainWindow::ActionLayout);
- connect(ui->actionHistory, &QAction::triggered, [this](bool checked)
+ connect(ui->actionHistory, &QAction::triggered, RECEIVER(this)[this](bool checked)
{
if (checked)
{
dialogHistory = new DialogHistory(pattern, doc, this);
dialogHistory->setWindowFlags(Qt::Window);
connect(this, &MainWindow::RefreshHistory, dialogHistory.data(), &DialogHistory::UpdateHistory);
- connect(dialogHistory.data(), &DialogHistory::DialogClosed, [this]()
+ connect(dialogHistory.data(), &DialogHistory::DialogClosed, RECEIVER(this)[this]()
{
ui->actionHistory->setChecked(false);
delete dialogHistory;
@@ -3657,7 +3657,7 @@ void MainWindow::CreateActions()
}
});
- connect(ui->actionNewDraw, &QAction::triggered, [this]()
+ connect(ui->actionNewDraw, &QAction::triggered, RECEIVER(this)[this]()
{
qCDebug(vMainWindow, "New PP.");
QString patternPieceName = tr("Pattern piece %1").arg(comboBoxDraws->count()+1);
@@ -3680,12 +3680,12 @@ void MainWindow::CreateActions()
connect(ui->actionOpen, &QAction::triggered, this, &MainWindow::Open);
connect(ui->actionNew, &QAction::triggered, this, &MainWindow::New);
- connect(ui->actionTable, &QAction::triggered, [this](bool checked)
+ connect(ui->actionTable, &QAction::triggered, RECEIVER(this)[this](bool checked)
{
if (checked)
{
dialogTable = new DialogIncrements(pattern, doc, this);
- connect(dialogTable.data(), &DialogIncrements::DialogClosed, [this]()
+ connect(dialogTable.data(), &DialogIncrements::DialogClosed, RECEIVER(this)[this]()
{
ui->actionTable->setChecked(false);
delete dialogTable;
@@ -3699,12 +3699,12 @@ void MainWindow::CreateActions()
}
});
- connect(ui->actionAbout_Qt, &QAction::triggered, [this]()
+ connect(ui->actionAbout_Qt, &QAction::triggered, RECEIVER(this)[this]()
{
QMessageBox::aboutQt(this, tr("About Qt"));
});
- connect(ui->actionAbout_Valentina, &QAction::triggered, [this]()
+ connect(ui->actionAbout_Valentina, &QAction::triggered, RECEIVER(this)[this]()
{
DialogAboutApp *aboutDialog = new DialogAboutApp(this);
aboutDialog->setAttribute(Qt::WA_DeleteOnClose, true);
@@ -3714,13 +3714,13 @@ void MainWindow::CreateActions()
connect(ui->actionExit, &QAction::triggered, this, &MainWindow::close);
connect(ui->actionPreferences, &QAction::triggered, this, &MainWindow::Preferences);
- connect(ui->actionReportBug, &QAction::triggered, [this]()
+ connect(ui->actionReportBug, &QAction::triggered, RECEIVER(this)[this]()
{
qCDebug(vMainWindow, "Reporting bug");
QDesktopServices::openUrl(QUrl(QStringLiteral("https://bitbucket.org/dismine/valentina/issues/new")));
});
- connect(ui->actionOnlineHelp, &QAction::triggered, [this]()
+ connect(ui->actionOnlineHelp, &QAction::triggered, RECEIVER(this)[this]()
{
qCDebug(vMainWindow, "Showing online help");
QDesktopServices::openUrl(QUrl(QStringLiteral("https://bitbucket.org/dismine/valentina/wiki/manual/Content")));
@@ -3728,10 +3728,10 @@ void MainWindow::CreateActions()
connect(ui->actionLast_tool, &QAction::triggered, this, &MainWindow::LastUsedTool);
- connect(ui->actionPattern_properties, &QAction::triggered, [this]()
+ connect(ui->actionPattern_properties, &QAction::triggered, RECEIVER(this)[this]()
{
DialogPatternProperties proper(curFile, doc, pattern, this);
- connect(&proper, &DialogPatternProperties::UpdateGradation, [this]()
+ connect(&proper, &DialogPatternProperties::UpdateGradation, RECEIVER(this)[this]()
{
UpdateHeightsList(VMeasurement::ListHeights(doc->GetGradationHeights(), qApp->patternUnit()));
UpdateSizesList(VMeasurement::ListSizes(doc->GetGradationSizes(), qApp->patternUnit()));
@@ -3740,14 +3740,14 @@ void MainWindow::CreateActions()
});
ui->actionPattern_properties->setEnabled(false);
- connect(ui->actionEdit_pattern_code, &QAction::triggered, [this]()
+ connect(ui->actionEdit_pattern_code, &QAction::triggered, RECEIVER(this)[this]()
{
DialogPatternXmlEdit *pattern = new DialogPatternXmlEdit (this, doc);
pattern->setAttribute(Qt::WA_DeleteOnClose, true);
pattern->show();
});
- connect(ui->actionClosePattern, &QAction::triggered, [this]()
+ connect(ui->actionClosePattern, &QAction::triggered, RECEIVER(this)[this]()
{
if (MaybeSave())
{
@@ -3756,7 +3756,7 @@ void MainWindow::CreateActions()
}
});
- connect(ui->actionShowCurveDetails, &QAction::triggered, [this](bool checked)
+ connect(ui->actionShowCurveDetails, &QAction::triggered, RECEIVER(this)[this](bool checked)
{
ui->view->itemClicked(nullptr);
sceneDraw->EnableDetailsMode(checked);
@@ -3765,7 +3765,7 @@ void MainWindow::CreateActions()
connect(ui->actionLoadIndividual, &QAction::triggered, this, &MainWindow::LoadIndividual);
connect(ui->actionLoadStandard, &QAction::triggered, this, &MainWindow::LoadStandard);
- connect(ui->actionCreateNew, &QAction::triggered, [this]()
+ connect(ui->actionCreateNew, &QAction::triggered, RECEIVER(this)[this]()
{
const QString tape = qApp->TapeFilePath();
const QString workingDirectory = QFileInfo(tape).absoluteDir().absolutePath();
@@ -3787,9 +3787,8 @@ void MainWindow::CreateActions()
QAction *action = new QAction(this);
action->setVisible(false);
recentFileActs[i] = action;
- connect(recentFileActs[i], &QAction::triggered, [action, this]()
+ connect(recentFileActs[i], &QAction::triggered, RECEIVER(this)[action, this]()
{
- // cppcheck-suppress nullPointerRedundantCheck
if (action != nullptr)
{
const QString filePath = action->data().toString();
@@ -4768,8 +4767,8 @@ bool MainWindow::IgnoreLocking(int error, const QString &path)
}
return true;
#else
- Q_UNUSED(error);
- Q_UNUSED(path);
+ Q_UNUSED(error)
+ Q_UNUSED(path)
return true;// On older Qt lock assumed always taken. Allow user to ignore warning.
#endif // QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
}
diff --git a/src/app/valentina/mainwindow.ui b/src/app/valentina/mainwindow.ui
index 433a2aec9..8ebbde1ac 100644
--- a/src/app/valentina/mainwindow.ui
+++ b/src/app/valentina/mainwindow.ui
@@ -1451,7 +1451,7 @@
-
+
0
diff --git a/src/app/valentina/mainwindowsnogui.cpp b/src/app/valentina/mainwindowsnogui.cpp
index 8bcdbe851..b2c369fd4 100644
--- a/src/app/valentina/mainwindowsnogui.cpp
+++ b/src/app/valentina/mainwindowsnogui.cpp
@@ -174,11 +174,10 @@ void MainWindowsNoGUI::ErrorConsoleMode(const LayoutErrors &state)
case LayoutErrors::PrepareLayoutError:
qCritical() << tr("Couldn't prepare data for creation layout");
break;
- case LayoutErrors::ProcessStoped:
- break;
case LayoutErrors::EmptyPaperError:
qCritical() << tr("Several workpieces left not arranged, but none of them match for paper");
break;
+ case LayoutErrors::ProcessStoped:
default:
break;
}
@@ -1153,7 +1152,7 @@ bool MainWindowsNoGUI::IsPagesFit(const QSizeF &printPaper) const
// On previous stage already was checked if pages have uniform size
// Enough will be to check only one page
QGraphicsRectItem *p = qgraphicsitem_cast(papers.at(0));
- SCASSERT(p != nullptr);
+ SCASSERT(p != nullptr)
const QSizeF pSize = p->rect().size();
if (pSize.height() <= printPaper.height() && pSize.width() <= printPaper.width())
{
@@ -1182,7 +1181,7 @@ int MainWindowsNoGUI::ContinueIfLayoutStale()
msgBox.setDefaultButton(QMessageBox::No);
QSpacerItem* horizontalSpacer = new QSpacerItem(500, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
QGridLayout* layout = static_cast(msgBox.layout());
- SCASSERT(layout != nullptr);
+ SCASSERT(layout != nullptr)
layout->addItem(horizontalSpacer, layout->rowCount(), 0, 1, layout->columnCount());
msgBox.exec();
return msgBox.result();
diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp
index 4557c6761..e41cc28e0 100644
--- a/src/app/valentina/xml/vpattern.cpp
+++ b/src/app/valentina/xml/vpattern.cpp
@@ -70,8 +70,8 @@ VPattern::VPattern(VContainer *data, Draw *mode, VMainGraphicsScene *sceneDraw,
VMainGraphicsScene *sceneDetail, QObject *parent)
: VAbstractPattern(parent), data(data), mode(mode), sceneDraw(sceneDraw), sceneDetail(sceneDetail)
{
- SCASSERT(sceneDraw != nullptr);
- SCASSERT(sceneDetail != nullptr);
+ SCASSERT(sceneDraw != nullptr)
+ SCASSERT(sceneDetail != nullptr)
}
//---------------------------------------------------------------------------------------------------------------------
@@ -137,8 +137,8 @@ void VPattern::Parse(const Document &parse)
break;
}
- SCASSERT(sceneDraw != nullptr);
- SCASSERT(sceneDetail != nullptr);
+ SCASSERT(sceneDraw != nullptr)
+ SCASSERT(sceneDetail != nullptr)
QStringList tags = QStringList() << TagDraw << TagIncrements << TagAuthor << TagDescription << TagNotes
<< TagMeasurements << TagVersion << TagGradation << TagImage << TagUnit
<< TagPatternName << TagPatternNum << TagCompanyName << TagCustomerName
@@ -317,10 +317,10 @@ void VPattern::setCurrentData()
void VPattern::UpdateToolData(const quint32 &id, VContainer *data)
{
Q_ASSERT_X(id != 0, Q_FUNC_INFO, "id == 0"); //-V712 //-V654
- SCASSERT(data != nullptr);
+ SCASSERT(data != nullptr)
ToolExists(id);
VDataTool *tool = tools.value(id);
- SCASSERT(tool != nullptr);
+ SCASSERT(tool != nullptr)
tool->VDataTool::setData(data);
}
@@ -428,7 +428,7 @@ void VPattern::LiteParseTree(const Document &parse)
}
catch (const VExceptionUndo &e)
{
- Q_UNUSED(e);
+ Q_UNUSED(e)
/* If user want undo last operation before undo we need finish broken redo operation. For those we post event
* myself. Later in method customEvent call undo.*/
QApplication::postEvent(this, new UndoEvent());
@@ -664,8 +664,8 @@ void VPattern::ParseDrawElement(const QDomNode &node, const Document &parse)
*/
void VPattern::ParseDrawMode(const QDomNode &node, const Document &parse, const Draw &mode)
{
- SCASSERT(sceneDraw != nullptr);
- SCASSERT(sceneDetail != nullptr);
+ SCASSERT(sceneDraw != nullptr)
+ SCASSERT(sceneDetail != nullptr)
VMainGraphicsScene *scene = nullptr;
if (mode == Draw::Calculation)
{
@@ -1021,7 +1021,7 @@ void VPattern::PointsCommonAttributes(const QDomElement &domElement, quint32 &id
void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElement,
const Document &parse, const QString &type)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
Q_ASSERT_X(not type.isEmpty(), Q_FUNC_INFO, "type of point is empty");
@@ -1135,7 +1135,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem
void VPattern::ParseLineElement(VMainGraphicsScene *scene, const QDomElement &domElement,
const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
{
@@ -1191,11 +1191,6 @@ QString VPattern::GetLabelBase(quint32 index) const
alphabet = al.split(",");
break;
}
- case 1: // en
- {
- alphabet = def.split(",");
- break;
- }
case 2: // fr
{
const QString al = QStringLiteral("A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z");
@@ -1232,6 +1227,7 @@ QString VPattern::GetLabelBase(quint32 index) const
alphabet = al.split(",");
break;
}
+ case 1: // en
default: // en
{
alphabet = def.split(",");
@@ -1254,7 +1250,7 @@ QString VPattern::GetLabelBase(quint32 index) const
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolBasePoint(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
VToolBasePoint *spoint = nullptr;
@@ -1285,7 +1281,7 @@ void VPattern::ParseToolBasePoint(VMainGraphicsScene *scene, const QDomElement &
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolEndLine(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -1335,7 +1331,7 @@ void VPattern::ParseToolEndLine(VMainGraphicsScene *scene, QDomElement &domEleme
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolAlongLine(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -1380,7 +1376,7 @@ void VPattern::ParseToolAlongLine(VMainGraphicsScene *scene, QDomElement &domEle
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolShoulderPoint(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -1426,7 +1422,7 @@ void VPattern::ParseToolShoulderPoint(VMainGraphicsScene *scene, QDomElement &do
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolNormal(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -1472,7 +1468,7 @@ void VPattern::ParseToolNormal(VMainGraphicsScene *scene, QDomElement &domElemen
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolBisector(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -1518,7 +1514,7 @@ void VPattern::ParseToolBisector(VMainGraphicsScene *scene, QDomElement &domElem
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolLineIntersect(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -1548,7 +1544,7 @@ void VPattern::ParseToolLineIntersect(VMainGraphicsScene *scene, const QDomEleme
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolPointOfContact(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -1610,7 +1606,7 @@ void VPattern::ParseNodePoint(const QDomElement &domElement, const Document &par
}
catch (const VExceptionBadId &e)
{ // Possible case. Parent was deleted, but the node object is still here.
- Q_UNUSED(e);
+ Q_UNUSED(e)
return;// Just ignore
}
data->UpdateGObject(id, new VPointF(*point, point->name(), mx, my, idObject, Draw::Modeling));
@@ -1627,7 +1623,7 @@ void VPattern::ParseNodePoint(const QDomElement &domElement, const Document &par
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolHeight(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -1658,7 +1654,7 @@ void VPattern::ParseToolHeight(VMainGraphicsScene *scene, const QDomElement &dom
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolTriangle(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -1689,7 +1685,7 @@ void VPattern::ParseToolTriangle(VMainGraphicsScene *scene, const QDomElement &d
void VPattern::ParseToolPointOfIntersection(VMainGraphicsScene *scene, const QDomElement &domElement,
const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -1717,7 +1713,7 @@ void VPattern::ParseToolPointOfIntersection(VMainGraphicsScene *scene, const QDo
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolCutSpline(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -1758,7 +1754,7 @@ void VPattern::ParseToolCutSpline(VMainGraphicsScene *scene, QDomElement &domEle
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolCutSplinePath(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -1800,7 +1796,7 @@ void VPattern::ParseToolCutSplinePath(VMainGraphicsScene *scene, QDomElement &do
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolCutArc(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -1842,7 +1838,7 @@ void VPattern::ParseToolCutArc(VMainGraphicsScene *scene, QDomElement &domElemen
void VPattern::ParseToolLineIntersectAxis(VMainGraphicsScene *scene, QDomElement &domElement,
const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -1893,7 +1889,7 @@ void VPattern::ParseToolLineIntersectAxis(VMainGraphicsScene *scene, QDomElement
void VPattern::ParseToolCurveIntersectAxis(VMainGraphicsScene *scene, QDomElement &domElement,
const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -1942,7 +1938,7 @@ void VPattern::ParseToolCurveIntersectAxis(VMainGraphicsScene *scene, QDomElemen
void VPattern::ParseToolPointOfIntersectionArcs(VMainGraphicsScene *scene, const QDomElement &domElement,
const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -1974,7 +1970,7 @@ void VPattern::ParseToolPointOfIntersectionArcs(VMainGraphicsScene *scene, const
void VPattern::ParseToolPointOfIntersectionCircles(VMainGraphicsScene *scene, QDomElement &domElement,
const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -2017,7 +2013,7 @@ void VPattern::ParseToolPointOfIntersectionCircles(VMainGraphicsScene *scene, QD
void VPattern::ParseToolPointOfIntersectionCurves(VMainGraphicsScene *scene, QDomElement &domElement,
const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -2048,7 +2044,7 @@ void VPattern::ParseToolPointOfIntersectionCurves(VMainGraphicsScene *scene, QDo
void VPattern::ParseToolPointFromCircleAndTangent(VMainGraphicsScene *scene, QDomElement &domElement,
const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -2089,7 +2085,7 @@ void VPattern::ParseToolPointFromCircleAndTangent(VMainGraphicsScene *scene, QDo
void VPattern::ParseToolPointFromArcAndTangent(VMainGraphicsScene *scene, const QDomElement &domElement,
const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -2120,7 +2116,7 @@ void VPattern::ParseToolPointFromArcAndTangent(VMainGraphicsScene *scene, const
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolTrueDarts(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -2163,7 +2159,7 @@ void VPattern::ParseToolTrueDarts(VMainGraphicsScene *scene, const QDomElement &
// TODO. Delete if minimal supported version is 0.2.7
void VPattern::ParseOldToolSpline(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -2203,7 +2199,7 @@ void VPattern::ParseOldToolSpline(VMainGraphicsScene *scene, const QDomElement &
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolSpline(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -2235,7 +2231,7 @@ void VPattern::ParseToolSpline(VMainGraphicsScene *scene, QDomElement &domElemen
if (spl != nullptr)
{
VAbstractMainWindow *window = qobject_cast(qApp->getMainWindow());
- SCASSERT(window != nullptr);
+ SCASSERT(window != nullptr)
connect(spl, &VToolSpline::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
}
@@ -2267,7 +2263,7 @@ void VPattern::ParseToolSpline(VMainGraphicsScene *scene, QDomElement &domElemen
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolCubicBezier(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -2307,7 +2303,7 @@ void VPattern::ParseToolCubicBezier(VMainGraphicsScene *scene, const QDomElement
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseOldToolSplinePath(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -2368,7 +2364,7 @@ void VPattern::ParseOldToolSplinePath(VMainGraphicsScene *scene, const QDomEleme
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -2424,7 +2420,7 @@ void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement
if (spl != nullptr)
{
VAbstractMainWindow *window = qobject_cast(qApp->getMainWindow());
- SCASSERT(window != nullptr);
+ SCASSERT(window != nullptr)
connect(spl, &VToolSplinePath::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
}
@@ -2466,7 +2462,7 @@ void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolCubicBezierPath(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@@ -2547,7 +2543,7 @@ void VPattern::ParseNodeSpline(const QDomElement &domElement, const Document &pa
}
catch (const VExceptionBadId &e)
{ // Possible case. Parent was deleted, but the node object is still here.
- Q_UNUSED(e);
+ Q_UNUSED(e)
return;// Just ignore
}
@@ -2593,7 +2589,7 @@ void VPattern::ParseNodeSplinePath(const QDomElement &domElement, const Document
}
catch (const VExceptionBadId &e)
{ // Possible case. Parent was deleted, but the node object is still here.
- Q_UNUSED(e);
+ Q_UNUSED(e)
return;// Just ignore
}
VNodeSplinePath::Create(this, data, id, idObject, parse, Source::FromFile, "", idTool);
@@ -2609,7 +2605,7 @@ void VPattern::ParseNodeSplinePath(const QDomElement &domElement, const Document
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolArc(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null");
try
@@ -2654,7 +2650,7 @@ void VPattern::ParseToolArc(VMainGraphicsScene *scene, QDomElement &domElement,
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolEllipticalArc(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null");
try
@@ -2722,7 +2718,7 @@ void VPattern::ParseNodeEllipticalArc(const QDomElement &domElement, const Docum
}
catch (const VExceptionBadId &e)
{ // Possible case. Parent was deleted, but the node object is still here.
- Q_UNUSED(e);
+ Q_UNUSED(e)
return;// Just ignore
}
arc->setIdObject(idObject);
@@ -2757,7 +2753,7 @@ void VPattern::ParseNodeArc(const QDomElement &domElement, const Document &parse
}
catch (const VExceptionBadId &e)
{ // Possible case. Parent was deleted, but the node object is still here.
- Q_UNUSED(e);
+ Q_UNUSED(e)
return;// Just ignore
}
arc->setIdObject(idObject);
@@ -2776,7 +2772,7 @@ void VPattern::ParseNodeArc(const QDomElement &domElement, const Document &parse
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolArcWithLength(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null");
try
@@ -2822,7 +2818,7 @@ void VPattern::ParseToolArcWithLength(VMainGraphicsScene *scene, QDomElement &do
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolRotation(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null");
try
@@ -2865,7 +2861,7 @@ void VPattern::ParseToolRotation(VMainGraphicsScene *scene, QDomElement &domElem
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolFlippingByLine(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null");
try
@@ -2895,7 +2891,7 @@ void VPattern::ParseToolFlippingByLine(VMainGraphicsScene *scene, QDomElement &d
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolFlippingByAxis(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null");
try
@@ -2925,7 +2921,7 @@ void VPattern::ParseToolFlippingByAxis(VMainGraphicsScene *scene, QDomElement &d
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolMove(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null");
try
@@ -3077,7 +3073,7 @@ void VPattern::GarbageCollector()
void VPattern::ParseSplineElement(VMainGraphicsScene *scene, QDomElement &domElement,
const Document &parse, const QString &type)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null");
Q_ASSERT_X(type.isEmpty() == false, Q_FUNC_INFO, "type of spline is empty");
@@ -3140,7 +3136,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, QDomElement &domEle
void VPattern::ParseArcElement(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse,
const QString &type)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
Q_ASSERT_X(not type.isEmpty(), Q_FUNC_INFO, "type of arc is empty");
@@ -3176,7 +3172,7 @@ void VPattern::ParseArcElement(VMainGraphicsScene *scene, QDomElement &domElemen
void VPattern::ParseEllipticalArcElement(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse,
const QString &type)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
Q_ASSERT_X(not type.isEmpty(), Q_FUNC_INFO, "type of elliptical arc is empty");
@@ -3208,7 +3204,7 @@ void VPattern::ParseEllipticalArcElement(VMainGraphicsScene *scene, QDomElement
void VPattern::ParseToolsElement(VMainGraphicsScene *scene, const QDomElement &domElement,
const Document &parse, const QString &type)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null");
Q_ASSERT_X(type.isEmpty() == false, Q_FUNC_INFO, "type of spline is empty");
@@ -3245,7 +3241,7 @@ void VPattern::ParseToolsElement(VMainGraphicsScene *scene, const QDomElement &d
void VPattern::ParseOperationElement(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse,
const QString &type)
{
- SCASSERT(scene != nullptr);
+ SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
Q_ASSERT_X(not type.isEmpty(), Q_FUNC_INFO, "type of operation is empty");
@@ -3778,8 +3774,8 @@ void VPattern::SetReadOnly(bool rOnly)
//---------------------------------------------------------------------------------------------------------------------
void VPattern::PrepareForParse(const Document &parse)
{
- SCASSERT(sceneDraw != nullptr);
- SCASSERT(sceneDetail != nullptr);
+ SCASSERT(sceneDraw != nullptr)
+ SCASSERT(sceneDetail != nullptr)
if (parse == Document::FullParse)
{
TestUniqueId();
@@ -3976,7 +3972,7 @@ QRectF VPattern::ToolBoundingRect(const QRectF &rec, const quint32 &id) const
if (tools.contains(id))
{
const T *vTool = qobject_cast(tools.value(id));
- SCASSERT(vTool != nullptr);
+ SCASSERT(vTool != nullptr)
QRectF childrenRect = vTool->childrenBoundingRect();
//map to scene coordinate.
@@ -4002,7 +3998,7 @@ void VPattern::IncrementReferens(quint32 id) const
Q_ASSERT_X(id != 0, Q_FUNC_INFO, "id == 0");
ToolExists(id);
VDataTool *tool = tools.value(id);
- SCASSERT(tool != nullptr);
+ SCASSERT(tool != nullptr)
tool->incrementReferens();
}
@@ -4016,6 +4012,6 @@ void VPattern::DecrementReferens(quint32 id) const
Q_ASSERT_X(id != 0, Q_FUNC_INFO, "id == 0");
ToolExists(id);
VDataTool *tool = tools.value(id);
- SCASSERT(tool != nullptr);
+ SCASSERT(tool != nullptr)
tool->decrementReferens();
}
diff --git a/src/libs/fervor/fvupdater.cpp b/src/libs/fervor/fvupdater.cpp
index 9339eb5d8..e245bbbc6 100644
--- a/src/libs/fervor/fvupdater.cpp
+++ b/src/libs/fervor/fvupdater.cpp
@@ -281,7 +281,7 @@ void FvUpdater::startDownloadFeed(const QUrl &url)
m_reply = m_qnam.get(request);
- connect(m_reply, &QNetworkReply::readyRead, [this]()
+ connect(m_reply, &QNetworkReply::readyRead, RECEIVER(this)[this]()
{
// this slot gets called every time the QNetworkReply has new data.
// We read all of its new data and write it into the file.
@@ -289,10 +289,10 @@ void FvUpdater::startDownloadFeed(const QUrl &url)
// signal of the QNetworkReply
m_xml.addData(m_reply->readAll());
});
- connect(m_reply, &QNetworkReply::downloadProgress, [this](qint64 bytesRead, qint64 totalBytes)
+ connect(m_reply, &QNetworkReply::downloadProgress, RECEIVER(this)[this](qint64 bytesRead, qint64 totalBytes)
{
- Q_UNUSED(bytesRead);
- Q_UNUSED(totalBytes);
+ Q_UNUSED(bytesRead)
+ Q_UNUSED(totalBytes)
if (m_httpRequestAborted)
{
@@ -555,18 +555,21 @@ bool FvUpdater::CurrentlyRunningOnPlatform(const QString &platform)
case 0: // Q_OS_LINUX
#ifdef Q_OS_LINUX // Defined on Linux.
return true;
+#else
+ return false;
#endif
- break;
case 1: // Q_OS_MAC
#ifdef Q_OS_MAC // Defined on MAC OS (synonym for Darwin).
return true;
+#else
+ return false;
#endif
- break;
case 2: // Q_OS_WIN32
#ifdef Q_OS_WIN32 // Defined on all supported versions of Windows.
return true;
+#else
+ return false;
#endif
- break;
default:
break;
}
diff --git a/src/libs/ifc/xml/vabstractconverter.cpp b/src/libs/ifc/xml/vabstractconverter.cpp
index 5bbcef7c9..aa1a2be00 100644
--- a/src/libs/ifc/xml/vabstractconverter.cpp
+++ b/src/libs/ifc/xml/vabstractconverter.cpp
@@ -307,7 +307,7 @@ void VAbstractConverter::ValidateInputFile(const QString ¤tSchema) const
}
catch(const VException &exp)
{ // Nope, we can't.
- Q_UNUSED(exp);
+ Q_UNUSED(exp)
throw e;
}
}
diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp
index b0a9596be..fff8c3370 100644
--- a/src/libs/ifc/xml/vabstractpattern.cpp
+++ b/src/libs/ifc/xml/vabstractpattern.cpp
@@ -554,14 +554,14 @@ VDataTool *VAbstractPattern::getTool(const quint32 &id)
void VAbstractPattern::AddTool(const quint32 &id, VDataTool *tool)
{
Q_ASSERT_X(id != 0, Q_FUNC_INFO, "id == 0");
- SCASSERT(tool != nullptr);
+ SCASSERT(tool != nullptr)
tools.insert(id, tool);
}
//---------------------------------------------------------------------------------------------------------------------
void VAbstractPattern::AddToolOnRemove(VDataTool *tool)
{
- SCASSERT(tool != nullptr);
+ SCASSERT(tool != nullptr)
toolsOnRemove.append(tool);
}
diff --git a/src/libs/ifc/xml/vdomdocument.cpp b/src/libs/ifc/xml/vdomdocument.cpp
index ff6952b0f..307ffeb16 100644
--- a/src/libs/ifc/xml/vdomdocument.cpp
+++ b/src/libs/ifc/xml/vdomdocument.cpp
@@ -105,8 +105,8 @@ inline qint64 MessageHandler::column() const
void MessageHandler::handleMessage(QtMsgType type, const QString &description, const QUrl &identifier,
const QSourceLocation &sourceLocation)
{
- Q_UNUSED(type);
- Q_UNUSED(identifier);
+ Q_UNUSED(type)
+ Q_UNUSED(identifier)
m_messageType = type;
m_description = description;
diff --git a/src/libs/qmuparser/qmuparser.cpp b/src/libs/qmuparser/qmuparser.cpp
index 68f8dccc3..707d35271 100644
--- a/src/libs/qmuparser/qmuparser.cpp
+++ b/src/libs/qmuparser/qmuparser.cpp
@@ -33,8 +33,6 @@
#include "qmuparsererror.h"
#include "../vmisc/vmath.h"
-using namespace std;
-
/**
* @file
* @brief Implementation of the standard floating point QmuParser.
@@ -348,9 +346,9 @@ void QmuParser::InitOprt()
//---------------------------------------------------------------------------------------------------------------------
void QmuParser::OnDetectVar(const QString &pExpr, int &nStart, int &nEnd)
{
- Q_UNUSED(pExpr);
- Q_UNUSED(nStart);
- Q_UNUSED(nEnd);
+ Q_UNUSED(pExpr)
+ Q_UNUSED(nStart)
+ Q_UNUSED(nEnd)
// this is just sample code to illustrate modifying variable names on the fly.
// I'm not sure anyone really needs such a feature...
/*
diff --git a/src/libs/qmuparser/qmuparserbase.cpp b/src/libs/qmuparser/qmuparserbase.cpp
index 6c61fa9b2..04994717c 100644
--- a/src/libs/qmuparser/qmuparserbase.cpp
+++ b/src/libs/qmuparser/qmuparserbase.cpp
@@ -36,8 +36,6 @@
#include "qmudef.h"
#include "../vmisc/vmath.h"
-using namespace std;
-
/**
* @file
* @brief This file contains the basic implementation of the muparser engine.
@@ -218,9 +216,9 @@ void QmuParserBase::ReInit() const
//---------------------------------------------------------------------------------------------------------------------
void QmuParserBase::OnDetectVar(const QString &pExpr, int &nStart, int &nEnd)
{
- Q_UNUSED(pExpr);
- Q_UNUSED(nStart);
- Q_UNUSED(nEnd);
+ Q_UNUSED(pExpr)
+ Q_UNUSED(nStart)
+ Q_UNUSED(nEnd)
}
//---------------------------------------------------------------------------------------------------------------------
@@ -396,7 +394,7 @@ void QmuParserBase::SetExpr(const QString &a_sExpr)
{
// Check locale compatibility
std::locale loc;
- if (m_pTokenReader->GetArgSep()==std::use_facet >(loc).decimal_point())
+ if (m_pTokenReader->GetArgSep()==std::use_facet >(loc).decimal_point())
{
Error(ecLOCALE);
}
diff --git a/src/libs/qmuparser/qmuparsertest.cpp b/src/libs/qmuparser/qmuparsertest.cpp
index 84cdb1128..e20d56c6f 100644
--- a/src/libs/qmuparser/qmuparsertest.cpp
+++ b/src/libs/qmuparser/qmuparsertest.cpp
@@ -41,8 +41,6 @@
#include "qmuparsererror.h"
#include "../vmisc/vmath.h"
-using namespace std;
-
/**
* @file
* @brief This file contains the implementation of parser test cases.
diff --git a/src/libs/vdxf/dxflib/dl_dxf.cpp b/src/libs/vdxf/dxflib/dl_dxf.cpp
index 07c227692..80ff93356 100644
--- a/src/libs/vdxf/dxflib/dl_dxf.cpp
+++ b/src/libs/vdxf/dxflib/dl_dxf.cpp
@@ -49,6 +49,7 @@
#include "dl_creationinterface.h"
#include "dl_entities.h"
#include "iostream"
+#include "strlcpy.h"
/**
* Default constructor.
@@ -1577,12 +1578,7 @@ bool DL_Dxf::handleXData(DL_CreationInterface* creationInterface)
creationInterface->addXDataReal(static_cast(groupCode), toReal(groupValue));
return true;
}
- else if (groupCode>=1060 && groupCode<=1070)
- {
- creationInterface->addXDataInt(static_cast(groupCode), toInt(groupValue));
- return true;
- }
- else if (groupCode==1071)
+ else if (groupCode>=1060 && groupCode<=1071)
{
creationInterface->addXDataInt(static_cast(groupCode), toInt(groupValue));
return true;
@@ -2554,10 +2550,7 @@ void DL_Dxf::endSequence(DL_CreationInterface* creationInterface)
DL_WriterA* DL_Dxf::out(const char* file, DL_Codes::version version)
{
char* f = new char[strlen(file)+1];
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_MSVC(4996)
- strcpy(f, file);
-QT_WARNING_POP
+ strlcpy(f, file, sizeof(f));
this->version = version;
DL_WriterA* dw = new DL_WriterA(f, version);
@@ -2602,7 +2595,6 @@ void DL_Dxf::writeHeader(DL_WriterA& dw) const
break;
case DL_Codes::AC1009_MIN:
// minimalistic DXF version is unidentified in file:
- break;
default:
break;
}
@@ -3848,7 +3840,7 @@ void DL_Dxf::writeHatch2(DL_WriterA& dw,
const DL_Attributes& attrib) const
{
- Q_UNUSED(attrib);
+ Q_UNUSED(attrib)
dw.dxfInt(75, 0); // odd parity
dw.dxfInt(76, 1); // pattern type
@@ -3906,7 +3898,7 @@ void DL_Dxf::writeHatchLoop1(DL_WriterA& dw,
void DL_Dxf::writeHatchLoop2(DL_WriterA& dw,
const DL_HatchLoopData& data)
{
- Q_UNUSED(data);
+ Q_UNUSED(data)
dw.dxfInt(97, 0);
}
@@ -4233,14 +4225,7 @@ void DL_Dxf::writeLinetype(DL_WriterA& dw,
dw.dxfString(2, data.name);
dw.dxfInt(70, data.flags);
- if (nameUpper=="BYBLOCK")
- {
- dw.dxfString(3, "");
- dw.dxfInt(72, 65);
- dw.dxfInt(73, 0);
- dw.dxfReal(40, 0.0);
- }
- else if (nameUpper=="BYLAYER")
+ if (nameUpper=="BYBLOCK" || nameUpper=="BYLAYER")
{
dw.dxfString(3, "");
dw.dxfInt(72, 65);
@@ -5864,7 +5849,7 @@ int DL_Dxf::getLibVersion(const std::string& str)
// double ret;
// if (strchr(value, ',') != NULL) {
// char* tmp = new char[strlen(value)+1];
-// strcpy(tmp, value);
+// strlcpy(tmp, value, sizeof(tmp));
// DL_WriterA::strReplace(tmp, ',', '.');
// ret = atof(tmp);
// delete[] tmp;
@@ -5891,15 +5876,12 @@ void DL_Dxf::test()
char* buf5 = new char[10];
char* buf6 = new char[10];
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_MSVC(4996)
- strcpy(buf1, " 10\n");
- strcpy(buf2, "10");
- strcpy(buf3, "10\n");
- strcpy(buf4, " 10 \n");
- strcpy(buf5, " 10 \r");
- strcpy(buf6, "\t10 \n");
-QT_WARNING_POP
+ strlcpy(buf1, " 10\n", sizeof(buf1));
+ strlcpy(buf2, "10", sizeof(buf2));
+ strlcpy(buf3, "10\n", sizeof(buf3));
+ strlcpy(buf4, " 10 \n", sizeof(buf4));
+ strlcpy(buf5, " 10 \r", sizeof(buf5));
+ strlcpy(buf6, "\t10 \n", sizeof(buf6));
// Try to avoid deleting array from an offset
char* buf1Copy = buf1;
diff --git a/src/libs/vdxf/dxflib/dl_writer_ascii.cpp b/src/libs/vdxf/dxflib/dl_writer_ascii.cpp
index 5f4e51839..bc5555f6e 100644
--- a/src/libs/vdxf/dxflib/dl_writer_ascii.cpp
+++ b/src/libs/vdxf/dxflib/dl_writer_ascii.cpp
@@ -66,17 +66,16 @@ void DL_WriterA::dxfReal(int gc, double value) const
{
char str[256];
QT_WARNING_PUSH
-QT_WARNING_DISABLE_MSVC(4996)
#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) < 408
QT_WARNING_DISABLE_GCC("-Wformat")
#endif
if (version==DL_Codes::AC1009_MIN)
{
- sprintf(str, "%.6lf", value);
+ snprintf(str, sizeof(str), "%.6lf", value);
}
else
{
- sprintf(str, "%.16lf", value);
+ snprintf(str, sizeof(str), "%.16lf", value);
}
QT_WARNING_POP
@@ -132,10 +131,7 @@ void DL_WriterA::dxfInt(int gc, int value) const
void DL_WriterA::dxfHex(int gc, int value) const
{
char str[12];
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_MSVC(4996)
- sprintf(str, "%0X", value);
-QT_WARNING_POP
+ snprintf(str, sizeof(str), "%0X", value);
dxfString(gc, str);
}
diff --git a/src/libs/vdxf/dxflib/dl_writer_ascii.h b/src/libs/vdxf/dxflib/dl_writer_ascii.h
index 04ef3b0df..9d7084e9f 100644
--- a/src/libs/vdxf/dxflib/dl_writer_ascii.h
+++ b/src/libs/vdxf/dxflib/dl_writer_ascii.h
@@ -33,6 +33,10 @@
#if (_MSC_VER > 1000)
#pragma once
#endif // _MSC_VER > 1000
+
+ #if _MSC_VER < 1900
+ #define snprintf _snprintf
+ #endif
#endif // Q_CC_MSVC
#include
diff --git a/src/libs/vdxf/dxflib/strlcpy.h b/src/libs/vdxf/dxflib/strlcpy.h
new file mode 100644
index 000000000..f56914445
--- /dev/null
+++ b/src/libs/vdxf/dxflib/strlcpy.h
@@ -0,0 +1,143 @@
+/************************************************************************
+ **
+ ** @file strlcpy.h
+ ** @author Roman Telezhynskyi
+ ** @date December 20, 2016
+ **
+ ** @brief
+ ** @copyright
+ ** This source code is part of the Valentine project, a pattern making
+ ** program, whose allow create and modeling patterns of clothing.
+ ** Copyright (C) 2013-2016 Valentina project
+ ** All Rights Reserved.
+ **
+ ** Valentina is free software: you can redistribute it and/or modify
+ ** it under the terms of the GNU General Public License as published by
+ ** the Free Software Foundation, either version 3 of the License, or
+ ** (at your option) any later version.
+ **
+ ** Valentina is distributed in the hope that it will be useful,
+ ** but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ ** GNU General Public License for more details.
+ **
+ ** You should have received a copy of the GNU General Public License
+ ** along with Valentina. If not, see .
+ **
+ *************************************************************************/
+
+/*
+ * Copyright (c) 1998 Todd C. Miller
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef VALENTINA_STRLCPY_H
+#define VALENTINA_STRLCPY_H
+
+/* This function comes from BSD */
+#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && \
+ !defined(__bsdi__) && !defined(__APPLE__)
+#include
+#include
+
+/*
+ * Copy src to string dst of size siz. At most siz-1 characters
+ * will be copied. Always NUL terminates (unless siz == 0).
+ * Returns strlen(src); if retval >= siz, truncation occurred.
+ */
+inline size_t strlcpy(char *dst, const char *src, size_t siz)
+{
+ char *d = dst;
+ const char *s = src;
+ size_t n = siz;
+
+ /* Copy as many bytes as will fit */
+ if (n != 0)
+ {
+ while (--n != 0)
+ {
+ if ((*d++ = *s++) == '\0')
+ {
+ break;
+ }
+ }
+ }
+
+ /* Not enough room in dst, add NUL and traverse rest of src */
+ if (n == 0)
+ {
+ if (siz != 0)
+ {
+ *d = '\0'; /* NUL-terminate dst */
+ }
+ while (*s++)
+ ;
+ }
+
+ return(s - src - 1); /* count does not include NUL */
+}
+
+/*
+ * Appends src to string dst of size siz (unlike strncat, siz is the
+ * full size of dst, not space left). At most siz-1 characters
+ * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
+ * Returns strlen(src) + MIN(siz, strlen(initial dst)).
+ * If retval >= siz, truncation occurred.
+ */
+inline size_t strlcat(char *dst, const char *src, size_t siz)
+{
+ char *d = dst;
+ const char *s = src;
+ size_t n = siz;
+ size_t dlen;
+
+ /* Find the end of dst and adjust bytes left but don't go past end */
+ while (n-- != 0 && *d != '\0')
+ {
+ d++;
+ }
+ dlen = d - dst;
+ n = siz - dlen;
+
+ if (n == 0)
+ {
+ return(dlen + strlen(s));
+ }
+ while (*s != '\0')
+ {
+ if (n != 1)
+ {
+ *d++ = *s;
+ n--;
+ }
+ s++;
+ }
+ *d = '\0';
+
+ return(dlen + (s - src)); /* count does not include NUL */
+}
+
+#endif /* ! __*BSD__ */
+#endif // VALENTINA_STRLCPY_H
diff --git a/src/libs/vdxf/stable.h b/src/libs/vdxf/stable.h
index 87d25b41e..f5ea1e47b 100644
--- a/src/libs/vdxf/stable.h
+++ b/src/libs/vdxf/stable.h
@@ -32,6 +32,8 @@
/* I like to include this pragma too, so the build log indicates if pre-compiled headers were in use. */
#pragma message("Compiling precompiled headers for VDxf library.\n")
+#define _CRT_SECURE_NO_WARNINGS
+
/* Add C includes here */
#if defined __cplusplus
diff --git a/src/libs/vdxf/vdxf.pri b/src/libs/vdxf/vdxf.pri
index b2eb8ce71..81c17f424 100644
--- a/src/libs/vdxf/vdxf.pri
+++ b/src/libs/vdxf/vdxf.pri
@@ -24,4 +24,5 @@ HEADERS += \
$$PWD/dxflib/dl_writer_ascii.h \
$$PWD/vdxfengine.h \
$$PWD/vdxfpaintdevice.h \
- $$PWD/dxfdef.h
+ $$PWD/dxfdef.h \
+ $$PWD/dxflib/strlcpy.h
diff --git a/src/libs/vdxf/vdxfengine.cpp b/src/libs/vdxf/vdxfengine.cpp
index c16932982..2ba90f46e 100644
--- a/src/libs/vdxf/vdxfengine.cpp
+++ b/src/libs/vdxf/vdxfengine.cpp
@@ -479,24 +479,17 @@ std::string VDxfEngine::getPenStyle()
{
switch (state->pen().style())
{
- case Qt::SolidLine:
- return "BYLAYER";
- break;
case Qt::DashLine:
return "DASHED";
- break;
case Qt::DotLine:
return "DOT";
- break;
case Qt::DashDotLine:
return "DASHDOT";
- break;
case Qt::DashDotDotLine:
return "DIVIDE";
- break;
+ case Qt::SolidLine:
default:
return "BYLAYER";
- break;
}
}
diff --git a/src/libs/vdxf/vdxfpaintdevice.cpp b/src/libs/vdxf/vdxfpaintdevice.cpp
index 80fcacc49..35b7bd714 100644
--- a/src/libs/vdxf/vdxfpaintdevice.cpp
+++ b/src/libs/vdxf/vdxfpaintdevice.cpp
@@ -126,10 +126,6 @@ int VDxfPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const
return engine->getSize().width();
case QPaintDevice::PdmHeight:
return engine->getSize().height();
- case QPaintDevice::PdmDpiX:
- return static_cast(engine->getResolution());
- case QPaintDevice::PdmDpiY:
- return static_cast(engine->getResolution());
case QPaintDevice::PdmHeightMM:
return qRound(engine->getSize().height() * 25.4 / engine->getResolution());
case QPaintDevice::PdmWidthMM:
@@ -137,8 +133,9 @@ int VDxfPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const
case QPaintDevice::PdmNumColors:
return static_cast(0xffffffff);
case QPaintDevice::PdmPhysicalDpiX:
- return static_cast(engine->getResolution());
case QPaintDevice::PdmPhysicalDpiY:
+ case QPaintDevice::PdmDpiX:
+ case QPaintDevice::PdmDpiY:
return static_cast(engine->getResolution());
#if QT_VERSION > QT_VERSION_CHECK(5, 0, 2)
case QPaintDevice::PdmDevicePixelRatio:
diff --git a/src/libs/vformat/vmeasurements.cpp b/src/libs/vformat/vmeasurements.cpp
index a7c4857ec..62ead1f98 100644
--- a/src/libs/vformat/vmeasurements.cpp
+++ b/src/libs/vformat/vmeasurements.cpp
@@ -101,7 +101,7 @@ VMeasurements::VMeasurements(Unit unit, VContainer *data)
data(data),
type(MeasurementsType::Individual)
{
- SCASSERT(data != nullptr);
+ SCASSERT(data != nullptr)
CreateEmptyIndividualFile(unit);
}
@@ -112,7 +112,7 @@ VMeasurements::VMeasurements(Unit unit, int baseSize, int baseHeight, VContainer
data(data),
type(MeasurementsType::Standard)
{
- SCASSERT(data != nullptr);
+ SCASSERT(data != nullptr)
CreateEmptyStandardFile(unit, baseSize, baseHeight);
}
diff --git a/src/libs/vlayout/vabstractdetail.cpp b/src/libs/vlayout/vabstractdetail.cpp
index 966e01dd6..c28f2f10e 100644
--- a/src/libs/vlayout/vabstractdetail.cpp
+++ b/src/libs/vlayout/vabstractdetail.cpp
@@ -359,7 +359,7 @@ QVector VAbstractDetail::CorrectEquidistantPoints(const QVector VAbstractDetail::CheckLoops(const QVector &points)
{
- const int count = points.size();
+ int count = points.size();
/*If we got less than 4 points no need seek loops.*/
if (count < 4)
{
@@ -458,13 +458,32 @@ QVector VAbstractDetail::CheckLoops(const QVector &points)
switch (status)
{
case ParallelIntersection:
+ {
/*We have found a loop.*/
- // Theoretically there is no big difference which point j or jNext to select.
- // In the end we will draw a line in any case.
- ekvPoints.append(points.at(i));
- ekvPoints.append(points.at(jNext));
- i = j;
+ // Very tricky case
+ // See the file "collection/bugs/Issue_#603.val"
+ const QLineF line1(points.at(i+1), points.at(j));
+ const QLineF line2(points.at(i), points.at(jNext));
+
+ if (line1.length() <= line2.length())
+ {
+ // In this case we did not check a loop edges and can just skip them
+ ekvPoints.append(points.at(i));
+ ekvPoints.append(points.at(jNext));
+
+ i = j; // Skip a loo
+ }
+ else
+ {
+ // In this case a loop edges probably was also chacked and added to the list
+ ekvPoints.clear();// Previous data is wrong and belong to loop.
+ ekvPoints.append(points.at(j));
+ ekvPoints.append(points.at(i+1));
+
+ count = j+1;// All beyond this belong to loop.
+ }
break;
+ }
case BoundedIntersection:
/*We have found a loop.*/
ekvPoints.append(points.at(i));
diff --git a/src/libs/vlayout/vgraphicsfillitem.cpp b/src/libs/vlayout/vgraphicsfillitem.cpp
index 4edcb17cb..d619b1278 100644
--- a/src/libs/vlayout/vgraphicsfillitem.cpp
+++ b/src/libs/vlayout/vgraphicsfillitem.cpp
@@ -40,8 +40,8 @@ VGraphicsFillItem::~VGraphicsFillItem()
//---------------------------------------------------------------------------------------------------------------------
void VGraphicsFillItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
{
- Q_UNUSED(option);
- Q_UNUSED(widget);
+ Q_UNUSED(option)
+ Q_UNUSED(widget)
painter->save();
painter->setBrush(painter->pen().color());
painter->drawPath(path());
diff --git a/src/libs/vlayout/vposter.cpp b/src/libs/vlayout/vposter.cpp
index 79f5d2fbf..5f52cb1b5 100644
--- a/src/libs/vlayout/vposter.cpp
+++ b/src/libs/vlayout/vposter.cpp
@@ -244,13 +244,13 @@ int VPoster::CountColumns(int width) const
//---------------------------------------------------------------------------------------------------------------------
PosterData VPoster::Cut(int i, int j, const QRect &imageRect) const
{
- Q_UNUSED(imageRect);
+ Q_UNUSED(imageRect)
const int x = j*PageRect().width() - j*static_cast(allowence);
const int y = i*PageRect().height() - i*static_cast(allowence);
- SCASSERT(x <= imageRect.width());
- SCASSERT(y <= imageRect.height());
+ SCASSERT(x <= imageRect.width())
+ SCASSERT(y <= imageRect.height())
PosterData data;
data.row = static_cast(i);
diff --git a/src/libs/vmisc/backport/qcommandlineparser.cpp b/src/libs/vmisc/backport/qcommandlineparser.cpp
index ff70eaae1..0294ceb0a 100644
--- a/src/libs/vmisc/backport/qcommandlineparser.cpp
+++ b/src/libs/vmisc/backport/qcommandlineparser.cpp
@@ -426,7 +426,7 @@ void QCommandLineParser::process(const QStringList &arguments)
void QCommandLineParser::process(const QCoreApplication &app)
{
// QCoreApplication::arguments() is static, but the app instance must exist so we require it as parameter
- Q_UNUSED(app);
+ Q_UNUSED(app)
process(QCoreApplication::arguments());
}
diff --git a/src/libs/vmisc/backport/qmarginsf.cpp b/src/libs/vmisc/backport/qmarginsf.cpp
index b683ba242..e57c4b3ee 100644
--- a/src/libs/vmisc/backport/qmarginsf.cpp
+++ b/src/libs/vmisc/backport/qmarginsf.cpp
@@ -355,7 +355,7 @@ QDataStream &operator<<(QDataStream &s, const QMarginsF &m)
QDataStream &operator>>(QDataStream &s, QMarginsF &m)
{
- double left, top, right, bottom;
+ double left = 0, top = 0, right = 0, bottom = 0;
s >> left;
s >> top;
s >> right;
diff --git a/src/libs/vmisc/def.cpp b/src/libs/vmisc/def.cpp
index a21e9e2eb..8eba5da5e 100644
--- a/src/libs/vmisc/def.cpp
+++ b/src/libs/vmisc/def.cpp
@@ -454,9 +454,9 @@ void SetOverrideCursor(const QString &pixmapPath, int hotX, int hotY)
QApplication::setOverrideCursor(QCursor(newPixmap, hotX, hotY));
}
#else
- Q_UNUSED(pixmapPath);
- Q_UNUSED(hotX);
- Q_UNUSED(hotY);
+ Q_UNUSED(pixmapPath)
+ Q_UNUSED(hotX)
+ Q_UNUSED(hotY)
#endif
}
@@ -478,7 +478,7 @@ void SetOverrideCursor(Qt::CursorShape shape)
}
#else
- Q_UNUSED(shape);
+ Q_UNUSED(shape)
#endif
}
@@ -501,7 +501,7 @@ void RestoreOverrideCursor(const QString &pixmapPath)
QApplication::restoreOverrideCursor();
}
#else
- Q_UNUSED(pixmapPath);
+ Q_UNUSED(pixmapPath)
#endif
}
@@ -523,7 +523,7 @@ void RestoreOverrideCursor(Qt::CursorShape shape)
}
#else
- Q_UNUSED(shape);
+ Q_UNUSED(shape)
#endif
}
@@ -1071,7 +1071,7 @@ void InitPMSystems(QComboBox *systemCombo)
// * The default option (blank field or 'None') should appear at the top of the list.
// * The list should be sorted alphabetically so users can find their system easily.
- SCASSERT(systemCombo != nullptr);
+ SCASSERT(systemCombo != nullptr)
systemCombo->addItem(qApp->TrVars()->PMSystemName(listSystems.at(listSystems.size()-1)),
listSystems.at(listSystems.size()-1));
@@ -1150,7 +1150,7 @@ QStringList ListPMSystems()
//---------------------------------------------------------------------------------------------------------------------
QStringList ListNumbers(const VTranslateMeasurements *trM, const QStringList &listMeasurements)
{
- SCASSERT(trM != nullptr);
+ SCASSERT(trM != nullptr)
QStringList numbers;
for (int i=0; i < listMeasurements.size(); ++i)
diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h
index 8a0790b1a..8ef847585 100644
--- a/src/libs/vmisc/def.h
+++ b/src/libs/vmisc/def.h
@@ -49,6 +49,17 @@ template class QSharedPointer;
#include
#endif /* Q_CC_MSVC */
+//There is no automatic disconnection when the 'receiver' is destroyed because it's a functor with no QObject. However,
+//since 5.2 there is an overload which adds a "context object". When that object is destroyed, the connection is broken
+//(the context is also used for the thread affinity: the lambda will be called in the thread of the event loop of the
+// object used as context).
+#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
+#define RECEIVER(obj) (obj),
+#else
+#define RECEIVER(obj)
+#endif
+
+
class QComboBox;
class QMarginsF;
class VTranslateMeasurements;
diff --git a/src/libs/vmisc/qxtcsvmodel.cpp b/src/libs/vmisc/qxtcsvmodel.cpp
index ac7b12061..1135e7b1e 100644
--- a/src/libs/vmisc/qxtcsvmodel.cpp
+++ b/src/libs/vmisc/qxtcsvmodel.cpp
@@ -72,7 +72,7 @@ QT_WARNING_DISABLE_GCC("-Weffc++")
*/
QxtCsvModel::QxtCsvModel(QObject *parent) : QAbstractTableModel(parent)
{
- QXT_INIT_PRIVATE(QxtCsvModel);
+ QXT_INIT_PRIVATE(QxtCsvModel)
}
/*!
@@ -86,7 +86,7 @@ QxtCsvModel::QxtCsvModel(QObject *parent) : QAbstractTableModel(parent)
QxtCsvModel::QxtCsvModel(QIODevice *file, QObject *parent, bool withHeader, QChar separator)
: QAbstractTableModel(parent)
{
- QXT_INIT_PRIVATE(QxtCsvModel);
+ QXT_INIT_PRIVATE(QxtCsvModel)
setSource(file, withHeader, separator);
}
@@ -103,7 +103,7 @@ QxtCsvModel::QxtCsvModel(QIODevice *file, QObject *parent, bool withHeader, QCha
QxtCsvModel::QxtCsvModel(const QString &filename, QObject *parent, bool withHeader, QChar separator)
: QAbstractTableModel(parent)
{
- QXT_INIT_PRIVATE(QxtCsvModel);
+ QXT_INIT_PRIVATE(QxtCsvModel)
QFile src(filename);
setSource(&src, withHeader, separator);
}
diff --git a/src/libs/vmisc/vabstractapplication.cpp b/src/libs/vmisc/vabstractapplication.cpp
index b061115af..d7d97cbae 100644
--- a/src/libs/vmisc/vabstractapplication.cpp
+++ b/src/libs/vmisc/vabstractapplication.cpp
@@ -118,7 +118,7 @@ VAbstractApplication::VAbstractApplication(int &argc, char **argv)
setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
- connect(this, &QApplication::aboutToQuit, [this]()
+ connect(this, &QApplication::aboutToQuit, RECEIVER(this)[this]()
{
// If try to use the method QApplication::exit program can't sync settings and show warning about QApplication
// instance. Solution is to call sync() before quit.
@@ -283,14 +283,14 @@ void VAbstractApplication::setPatternUnit(const Unit &patternUnit)
*/
VCommonSettings *VAbstractApplication::Settings()
{
- SCASSERT(settings != nullptr);
+ SCASSERT(settings != nullptr)
return settings;
}
//---------------------------------------------------------------------------------------------------------------------
QGraphicsScene *VAbstractApplication::getCurrentScene() const
{
- SCASSERT(*currentScene != nullptr);
+ SCASSERT(*currentScene != nullptr)
return *currentScene;
}
diff --git a/src/libs/vmisc/vlockguard.h b/src/libs/vmisc/vlockguard.h
index c6864ac52..fcbf57e65 100644
--- a/src/libs/vmisc/vlockguard.h
+++ b/src/libs/vmisc/vlockguard.h
@@ -189,9 +189,9 @@ bool VLockGuard::TryLock(const QString &lockName, int stale, int timeou
#endif
}
#else
- Q_UNUSED(lockName);
- Q_UNUSED(stale);
- Q_UNUSED(timeout);
+ Q_UNUSED(lockName)
+ Q_UNUSED(stale)
+ Q_UNUSED(timeout)
#endif
return res;
}
diff --git a/src/libs/vmisc/vtablesearch.cpp b/src/libs/vmisc/vtablesearch.cpp
index b03cc4f83..976ffa719 100644
--- a/src/libs/vmisc/vtablesearch.cpp
+++ b/src/libs/vmisc/vtablesearch.cpp
@@ -48,7 +48,7 @@ VTableSearch::VTableSearch(QTableWidget *table, QObject *parent)
//---------------------------------------------------------------------------------------------------------------------
void VTableSearch::Clear()
{
- SCASSERT(table != nullptr);
+ SCASSERT(table != nullptr)
for(int i = 0; i < table->rowCount(); ++i)
{
@@ -96,7 +96,7 @@ void VTableSearch::ShowNext(int newIndex)
//---------------------------------------------------------------------------------------------------------------------
void VTableSearch::Find(const QString &term)
{
- SCASSERT(table != nullptr);
+ SCASSERT(table != nullptr)
Clear();
@@ -194,7 +194,7 @@ void VTableSearch::AddRow(int row)
//---------------------------------------------------------------------------------------------------------------------
void VTableSearch::RefreshList(const QString &term)
{
- SCASSERT(table != nullptr);
+ SCASSERT(table != nullptr)
if (term.isEmpty())
{
diff --git a/src/libs/vobj/vobjpaintdevice.cpp b/src/libs/vobj/vobjpaintdevice.cpp
index e1f42a50e..418a01619 100644
--- a/src/libs/vobj/vobjpaintdevice.cpp
+++ b/src/libs/vobj/vobjpaintdevice.cpp
@@ -147,18 +147,15 @@ int VObjPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const
return engine->getSize().width();
case QPaintDevice::PdmHeight:
return engine->getSize().height();
- case QPaintDevice::PdmDpiX:
- return engine->getResolution();
- case QPaintDevice::PdmDpiY:
- return engine->getResolution();
case QPaintDevice::PdmHeightMM:
return qRound(engine->getSize().height() * 25.4 / engine->getResolution());
case QPaintDevice::PdmWidthMM:
return qRound(engine->getSize().width() * 25.4 / engine->getResolution());
case QPaintDevice::PdmNumColors:
return static_cast(0xffffffff);
+ case QPaintDevice::PdmDpiX:
+ case QPaintDevice::PdmDpiY:
case QPaintDevice::PdmPhysicalDpiX:
- return engine->getResolution();
case QPaintDevice::PdmPhysicalDpiY:
return engine->getResolution();
#if QT_VERSION > QT_VERSION_CHECK(5, 0, 2)
diff --git a/src/libs/vpatterndb/calculator.cpp b/src/libs/vpatterndb/calculator.cpp
index c17d5351b..0ab8c11f8 100644
--- a/src/libs/vpatterndb/calculator.cpp
+++ b/src/libs/vpatterndb/calculator.cpp
@@ -36,8 +36,6 @@
#include "../vmisc/def.h"
#include "../qmuparser/qmuparsererror.h"
-using namespace qmu;
-
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief Calculator class wraper for QMuParser. Make easy initialization math parser.
@@ -142,7 +140,7 @@ void Calculator::InitVariables(const QHash &vars, const QMapname()));
diff --git a/src/libs/vpatterndb/variables/vcurveangle.cpp b/src/libs/vpatterndb/variables/vcurveangle.cpp
index 576d49543..f36ae42cc 100644
--- a/src/libs/vpatterndb/variables/vcurveangle.cpp
+++ b/src/libs/vpatterndb/variables/vcurveangle.cpp
@@ -49,7 +49,7 @@ VCurveAngle::VCurveAngle(const quint32 &id, const quint32 &parentId, const VAbst
:VCurveVariable(id, parentId)
{
SetType(VarType::CurveAngle);
- SCASSERT(curve != nullptr);
+ SCASSERT(curve != nullptr)
if (angle == CurveAngle::StartAngle)
{
SetValue(curve->GetStartAngle());
diff --git a/src/libs/vpatterndb/variables/vcurveclength.cpp b/src/libs/vpatterndb/variables/vcurveclength.cpp
index 1262cd832..ca4f09880 100644
--- a/src/libs/vpatterndb/variables/vcurveclength.cpp
+++ b/src/libs/vpatterndb/variables/vcurveclength.cpp
@@ -50,7 +50,7 @@ VCurveCLength::VCurveCLength(const quint32 &id, const quint32 &parentId, const V
: VCurveVariable(id, parentId)
{
SetType(VarType::CurveCLength);
- SCASSERT(curve != nullptr);
+ SCASSERT(curve != nullptr)
if (cType == CurveCLength::C1)
{
SetValue(FromPixel(curve->GetC1Length(), patternUnit));
diff --git a/src/libs/vpatterndb/variables/vcurvelength.cpp b/src/libs/vpatterndb/variables/vcurvelength.cpp
index 6fbab9ee9..2809c9e4d 100644
--- a/src/libs/vpatterndb/variables/vcurvelength.cpp
+++ b/src/libs/vpatterndb/variables/vcurvelength.cpp
@@ -48,7 +48,7 @@ VCurveLength::VCurveLength(const quint32 &id, const quint32 &parentId, const VAb
:VCurveVariable(id, parentId)
{
SetType(VarType::CurveLength);
- SCASSERT(curve != nullptr);
+ SCASSERT(curve != nullptr)
SetName(curve->name());
SetValue(FromPixel(curve->GetLength(), patternUnit));
}
diff --git a/src/libs/vpatterndb/variables/vellipticalarcradius.cpp b/src/libs/vpatterndb/variables/vellipticalarcradius.cpp
index aa900362f..0503ee75c 100644
--- a/src/libs/vpatterndb/variables/vellipticalarcradius.cpp
+++ b/src/libs/vpatterndb/variables/vellipticalarcradius.cpp
@@ -45,7 +45,7 @@ VEllipticalArcRadius::VEllipticalArcRadius()
VEllipticalArcRadius::VEllipticalArcRadius(const quint32 &id, const quint32 &parentId, const VEllipticalArc *elArc,
const int numberRadius, Unit patternUnit) : VCurveVariable(id, parentId)
{
- SCASSERT(elArc != nullptr);
+ SCASSERT(elArc != nullptr)
SetType(VarType::ArcRadius);
SetName(QString(radius_V+"%1"+"%2").arg(numberRadius).arg(elArc->name()));
diff --git a/src/libs/vpatterndb/variables/vinternalvariable.cpp b/src/libs/vpatterndb/variables/vinternalvariable.cpp
index fe7c7a28f..d22cfa9bd 100644
--- a/src/libs/vpatterndb/variables/vinternalvariable.cpp
+++ b/src/libs/vpatterndb/variables/vinternalvariable.cpp
@@ -57,7 +57,7 @@ VInternalVariable::~VInternalVariable()
//---------------------------------------------------------------------------------------------------------------------
bool VInternalVariable::Filter(quint32 id)
{
- Q_UNUSED(id);
+ Q_UNUSED(id)
return false;
}
diff --git a/src/libs/vpatterndb/variables/vlineangle.cpp b/src/libs/vpatterndb/variables/vlineangle.cpp
index 9f92841e8..bbb7f1e26 100644
--- a/src/libs/vpatterndb/variables/vlineangle.cpp
+++ b/src/libs/vpatterndb/variables/vlineangle.cpp
@@ -53,8 +53,8 @@ VLineAngle::VLineAngle(const VPointF *p1, const quint32 &p1Id, const VPointF *p2
{
SetType(VarType::LineAngle);
- SCASSERT(p1 != nullptr);
- SCASSERT(p2 != nullptr);
+ SCASSERT(p1 != nullptr)
+ SCASSERT(p2 != nullptr)
SetName(QString(angleLine_+"%1_%2").arg(p1->name(), p2->name()));
SetValue(p1, p2);
@@ -90,8 +90,8 @@ bool VLineAngle::Filter(quint32 id)
//---------------------------------------------------------------------------------------------------------------------
void VLineAngle::SetValue(const VPointF *p1, const VPointF *p2)
{
- SCASSERT(p1 != nullptr);
- SCASSERT(p2 != nullptr);
+ SCASSERT(p1 != nullptr)
+ SCASSERT(p2 != nullptr)
//Correct angle. Try avoid results like 6,7563e-15.
const qreal angle = qFloor(QLineF(*p1, *p2).angle() * 100000.) / 100000.;
VInternalVariable::SetValue(angle);
diff --git a/src/libs/vpatterndb/variables/vlinelength.cpp b/src/libs/vpatterndb/variables/vlinelength.cpp
index bd014f65e..8fe836157 100644
--- a/src/libs/vpatterndb/variables/vlinelength.cpp
+++ b/src/libs/vpatterndb/variables/vlinelength.cpp
@@ -50,8 +50,8 @@ VLengthLine::VLengthLine(const VPointF *p1, const quint32 &p1Id, const VPointF *
Unit patternUnit)
:VInternalVariable(), d(new VLengthLineData(p1Id, p2Id, patternUnit))
{
- SCASSERT(p1 != nullptr);
- SCASSERT(p2 != nullptr);
+ SCASSERT(p1 != nullptr)
+ SCASSERT(p2 != nullptr)
SetType(VarType::LineLength);
SetName(QString(line_+"%1_%2").arg(p1->name(), p2->name()));
@@ -88,8 +88,8 @@ bool VLengthLine::Filter(quint32 id)
//---------------------------------------------------------------------------------------------------------------------
void VLengthLine::SetValue(const VPointF *p1, const VPointF *p2)
{
- SCASSERT(p1 != nullptr);
- SCASSERT(p2 != nullptr);
+ SCASSERT(p1 != nullptr)
+ SCASSERT(p2 != nullptr)
VInternalVariable::SetValue(FromPixel(QLineF(*p1, *p2).length(), d->patternUnit));
}
diff --git a/src/libs/vpatterndb/vcontainer.cpp b/src/libs/vpatterndb/vcontainer.cpp
index cbb57ca26..d8404befc 100644
--- a/src/libs/vpatterndb/vcontainer.cpp
+++ b/src/libs/vpatterndb/vcontainer.cpp
@@ -202,7 +202,7 @@ VPiecePath VContainer::GetPiecePath(quint32 id) const
*/
quint32 VContainer::AddGObject(VGObject *obj)
{
- SCASSERT(obj != nullptr);
+ SCASSERT(obj != nullptr)
QSharedPointer pointer(obj);
uniqueNames.insert(obj->name());
return AddObject(d->gObjects, pointer);
@@ -285,7 +285,7 @@ template
void VContainer::UpdateObject(QHash &obj, const quint32 &id, val point)
{
Q_ASSERT_X(id != NULL_ID, Q_FUNC_INFO, "id == 0"); //-V654 //-V712
- SCASSERT(point.isNull() == false);
+ SCASSERT(point.isNull() == false)
point->setId(id);
if (d->gObjects.contains(id))
{
@@ -527,7 +527,7 @@ void VContainer::RemoveVariable(const QString &name)
template
quint32 VContainer::AddObject(QHash &obj, val value)
{
- SCASSERT(value != nullptr);
+ SCASSERT(value != nullptr)
const quint32 id = getNextId();
value->setId(id);
obj[id] = value;
@@ -542,7 +542,7 @@ quint32 VContainer::AddObject(QHash &obj, val value)
*/
void VContainer::UpdateGObject(quint32 id, VGObject* obj)
{
- SCASSERT(obj != nullptr);
+ SCASSERT(obj != nullptr)
QSharedPointer pointer(obj);
UpdateObject(d->gObjects, id, pointer);
uniqueNames.insert(obj->name());
diff --git a/src/libs/vpatterndb/vcontainer.h b/src/libs/vpatterndb/vcontainer.h
index 3631e2543..0d43f14be 100644
--- a/src/libs/vpatterndb/vcontainer.h
+++ b/src/libs/vpatterndb/vcontainer.h
@@ -267,7 +267,7 @@ const QSharedPointer VContainer::GeometricObject(const quint32 &id) const
try
{
QSharedPointer obj = qSharedPointerDynamicCast(gObj);
- SCASSERT(obj.isNull() == false);
+ SCASSERT(obj.isNull() == false)
return obj;
}
catch (const std::bad_alloc &)
@@ -286,13 +286,13 @@ const QSharedPointer VContainer::GeometricObject(const quint32 &id) const
template
QSharedPointer VContainer::GetVariable(QString name) const
{
- SCASSERT(name.isEmpty()==false);
+ SCASSERT(name.isEmpty()==false)
if (d->variables.contains(name))
{
try
{
QSharedPointer value = qSharedPointerDynamicCast(d->variables.value(name));
- SCASSERT(value.isNull() == false);
+ SCASSERT(value.isNull() == false)
return value;
}
catch (const std::bad_alloc &)
diff --git a/src/libs/vpatterndb/vtranslatemeasurements.cpp b/src/libs/vpatterndb/vtranslatemeasurements.cpp
index 602940659..086138a6f 100644
--- a/src/libs/vpatterndb/vtranslatemeasurements.cpp
+++ b/src/libs/vpatterndb/vtranslatemeasurements.cpp
@@ -31,13 +31,11 @@
#include "../qmuparser/qmutranslation.h"
#include "../vmisc/def.h"
-using namespace qmu;
-
//---------------------------------------------------------------------------------------------------------------------
VTranslateMeasurements::VTranslateMeasurements()
- :measurements(QMap()),
- guiTexts(QMap()),
- descriptions(QMap()),
+ :measurements(QMap()),
+ guiTexts(QMap()),
+ descriptions(QMap()),
numbers(QMap()),
formulas(QMap())
{
@@ -60,7 +58,7 @@ VTranslateMeasurements::~VTranslateMeasurements()
bool VTranslateMeasurements::MeasurementsFromUser(QString &newFormula, int position, const QString &token,
int &bias) const
{
- QMap::const_iterator i = measurements.constBegin();
+ QMap::const_iterator i = measurements.constBegin();
while (i != measurements.constEnd())
{
if (token == i.value().translate())
@@ -166,8 +164,9 @@ void VTranslateMeasurements::InitMeasurements()
}
//---------------------------------------------------------------------------------------------------------------------
-void VTranslateMeasurements::InitMeasurement(const QString &name, const QmuTranslation &m, const QmuTranslation &g,
- const QmuTranslation &d, const QString &number, const QString &formula)
+void VTranslateMeasurements::InitMeasurement(const QString &name, const qmu::QmuTranslation &m,
+ const qmu::QmuTranslation &g, const qmu::QmuTranslation &d,
+ const QString &number, const QString &formula)
{
measurements.insert(name, m);
guiTexts.insert(name, g);
@@ -176,16 +175,16 @@ void VTranslateMeasurements::InitMeasurement(const QString &name, const QmuTrans
formulas.insert(name, formula);
}
-#define translate(context, source, disambiguation) QmuTranslation::translate((context), (source), (disambiguation))
+#define translate(context, source, disambiguation) qmu::QmuTranslation::translate((context), (source), (disambiguation))
//---------------------------------------------------------------------------------------------------------------------
void VTranslateMeasurements::InitGroupA()
{
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
//mark such string to translation.
- QmuTranslation m;
- QmuTranslation g;
- QmuTranslation d;
+ qmu::QmuTranslation m;
+ qmu::QmuTranslation g;
+ qmu::QmuTranslation d;
//=================================================================================================================
m = translate("VTranslateMeasurements", "height",
@@ -357,9 +356,9 @@ void VTranslateMeasurements::InitGroupB()
{
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
//mark such string to translation.
- QmuTranslation m;
- QmuTranslation g;
- QmuTranslation d;
+ qmu::QmuTranslation m;
+ qmu::QmuTranslation g;
+ qmu::QmuTranslation d;
//=================================================================================================================
m = translate("VTranslateMeasurements", "width_shoulder",
@@ -404,9 +403,9 @@ void VTranslateMeasurements::InitGroupC()
{
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
//mark such string to translation.
- QmuTranslation m;
- QmuTranslation g;
- QmuTranslation d;
+ qmu::QmuTranslation m;
+ qmu::QmuTranslation g;
+ qmu::QmuTranslation d;
//=================================================================================================================
m = translate("VTranslateMeasurements", "indent_neck_back",
@@ -437,9 +436,9 @@ void VTranslateMeasurements::InitGroupD()
{
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
//mark such string to translation.
- QmuTranslation m;
- QmuTranslation g;
- QmuTranslation d;
+ qmu::QmuTranslation m;
+ qmu::QmuTranslation g;
+ qmu::QmuTranslation d;
//=================================================================================================================
m = translate("VTranslateMeasurements", "hand_palm_length",
@@ -482,9 +481,9 @@ void VTranslateMeasurements::InitGroupE()
{
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
//mark such string to translation.
- QmuTranslation m;
- QmuTranslation g;
- QmuTranslation d;
+ qmu::QmuTranslation m;
+ qmu::QmuTranslation g;
+ qmu::QmuTranslation d;
//=================================================================================================================
m = translate("VTranslateMeasurements", "foot_width",
@@ -521,9 +520,9 @@ void VTranslateMeasurements::InitGroupF()
{
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
//mark such string to translation.
- QmuTranslation m;
- QmuTranslation g;
- QmuTranslation d;
+ qmu::QmuTranslation m;
+ qmu::QmuTranslation g;
+ qmu::QmuTranslation d;
//=================================================================================================================
m = translate("VTranslateMeasurements", "head_circ",
@@ -576,9 +575,9 @@ void VTranslateMeasurements::InitGroupG()
{
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
//mark such string to translation.
- QmuTranslation m;
- QmuTranslation g;
- QmuTranslation d;
+ qmu::QmuTranslation m;
+ qmu::QmuTranslation g;
+ qmu::QmuTranslation d;
//=================================================================================================================
m = translate("VTranslateMeasurements", "neck_mid_circ",
@@ -928,9 +927,9 @@ void VTranslateMeasurements::InitGroupH()
{
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
//mark such string to translation.
- QmuTranslation m;
- QmuTranslation g;
- QmuTranslation d;
+ qmu::QmuTranslation m;
+ qmu::QmuTranslation g;
+ qmu::QmuTranslation d;
//=================================================================================================================
m = translate("VTranslateMeasurements", "neck_front_to_waist_f",
@@ -1233,9 +1232,9 @@ void VTranslateMeasurements::InitGroupI()
{
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
//mark such string to translation.
- QmuTranslation m;
- QmuTranslation g;
- QmuTranslation d;
+ qmu::QmuTranslation m;
+ qmu::QmuTranslation g;
+ qmu::QmuTranslation d;
//=================================================================================================================
m = translate("VTranslateMeasurements", "shoulder_length",
@@ -1344,9 +1343,9 @@ void VTranslateMeasurements::InitGroupJ()
{
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
//mark such string to translation.
- QmuTranslation m;
- QmuTranslation g;
- QmuTranslation d;
+ qmu::QmuTranslation m;
+ qmu::QmuTranslation g;
+ qmu::QmuTranslation d;
//=================================================================================================================
m = translate("VTranslateMeasurements", "bustpoint_to_bustpoint",
@@ -1425,9 +1424,9 @@ void VTranslateMeasurements::InitGroupK()
{
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
//mark such string to translation.
- QmuTranslation m;
- QmuTranslation g;
- QmuTranslation d;
+ qmu::QmuTranslation m;
+ qmu::QmuTranslation g;
+ qmu::QmuTranslation d;
//=================================================================================================================
m = translate("VTranslateMeasurements", "shoulder_tip_to_waist_front",
@@ -1529,9 +1528,9 @@ void VTranslateMeasurements::InitGroupL()
{
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
//mark such string to translation.
- QmuTranslation m;
- QmuTranslation g;
- QmuTranslation d;
+ qmu::QmuTranslation m;
+ qmu::QmuTranslation g;
+ qmu::QmuTranslation d;
//=================================================================================================================
m = translate("VTranslateMeasurements", "arm_shoulder_tip_to_wrist_bent",
@@ -1697,9 +1696,9 @@ void VTranslateMeasurements::InitGroupM()
{
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
//mark such string to translation.
- QmuTranslation m;
- QmuTranslation g;
- QmuTranslation d;
+ qmu::QmuTranslation m;
+ qmu::QmuTranslation g;
+ qmu::QmuTranslation d;
//=================================================================================================================
m = translate("VTranslateMeasurements", "leg_crotch_to_floor",
@@ -1808,9 +1807,9 @@ void VTranslateMeasurements::InitGroupN()
{
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
//mark such string to translation.
- QmuTranslation m;
- QmuTranslation g;
- QmuTranslation d;
+ qmu::QmuTranslation m;
+ qmu::QmuTranslation g;
+ qmu::QmuTranslation d;
//=================================================================================================================
m = translate("VTranslateMeasurements", "crotch_length",
@@ -1880,9 +1879,9 @@ void VTranslateMeasurements::InitGroupO()
{
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
//mark such string to translation.
- QmuTranslation m;
- QmuTranslation g;
- QmuTranslation d;
+ qmu::QmuTranslation m;
+ qmu::QmuTranslation g;
+ qmu::QmuTranslation d;
//=================================================================================================================
m = translate("VTranslateMeasurements", "neck_back_to_waist_front",
@@ -1996,9 +1995,9 @@ void VTranslateMeasurements::InitGroupP()
{
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
//mark such string to translation.
- QmuTranslation m;
- QmuTranslation g;
- QmuTranslation d;
+ qmu::QmuTranslation m;
+ qmu::QmuTranslation g;
+ qmu::QmuTranslation d;
//=================================================================================================================
m = translate("VTranslateMeasurements", "neck_back_to_bust_front",
@@ -2098,9 +2097,9 @@ void VTranslateMeasurements::InitGroupQ()
{
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
//mark such string to translation.
- QmuTranslation m;
- QmuTranslation g;
- QmuTranslation d;
+ qmu::QmuTranslation m;
+ qmu::QmuTranslation g;
+ qmu::QmuTranslation d;
//=================================================================================================================
m = translate("VTranslateMeasurements", "dart_width_shoulder",
diff --git a/src/libs/vpatterndb/vtranslatevars.cpp b/src/libs/vpatterndb/vtranslatevars.cpp
index 51dca3fe9..17b71bafe 100644
--- a/src/libs/vpatterndb/vtranslatevars.cpp
+++ b/src/libs/vpatterndb/vtranslatevars.cpp
@@ -44,19 +44,17 @@
#include "../vmisc/vabstractapplication.h"
#include "vtranslatemeasurements.h"
-using namespace qmu;
-
//---------------------------------------------------------------------------------------------------------------------
VTranslateVars::VTranslateVars()
:VTranslateMeasurements(),
- PMSystemNames(QMap()),
- PMSystemAuthors(QMap()),
- PMSystemBooks(QMap()),
- variables(QMap()),
- functions(QMap()),
- postfixOperators(QMap()),
- placeholders(QMap()),
- stDescriptions(QMap())
+ PMSystemNames(QMap()),
+ PMSystemAuthors(QMap()),
+ PMSystemBooks(QMap()),
+ variables(QMap()),
+ functions(QMap()),
+ postfixOperators(QMap()),
+ placeholders(QMap()),
+ stDescriptions(QMap())
{
InitPatternMakingSystems();
InitVariables();
@@ -69,16 +67,16 @@ VTranslateVars::VTranslateVars()
VTranslateVars::~VTranslateVars()
{}
-#define translate(context, source, disambiguation) QmuTranslation::translate((context), (source), (disambiguation))
+#define translate(context, source, disambiguation) qmu::QmuTranslation::translate((context), (source), (disambiguation))
//---------------------------------------------------------------------------------------------------------------------
void VTranslateVars::InitPatternMakingSystems()
{
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
//mark such string to translation.
- QmuTranslation name;
- QmuTranslation author;
- QmuTranslation book;
+ qmu::QmuTranslation name;
+ qmu::QmuTranslation author;
+ qmu::QmuTranslation book;
//=================================================================================================================
name = translate("VTranslateVars", "Bunka", "System name");
@@ -448,8 +446,8 @@ void VTranslateVars::InitPlaceholder()
#undef translate
//---------------------------------------------------------------------------------------------------------------------
-void VTranslateVars::InitSystem(const QString &code, const QmuTranslation &name, const QmuTranslation &author,
- const QmuTranslation &book)
+void VTranslateVars::InitSystem(const QString &code, const qmu::QmuTranslation &name, const qmu::QmuTranslation &author,
+ const qmu::QmuTranslation &book)
{
PMSystemNames.insert(code, name);
PMSystemAuthors.insert(code, author);
@@ -519,10 +517,10 @@ void VTranslateVars::BiasTokens(int position, int bias, QMap &toke
*/
bool VTranslateVars::VariablesFromUser(QString &newFormula, int position, const QString &token, int &bias) const
{
- QMap::const_iterator i = variables.constBegin();
+ QMap::const_iterator i = variables.constBegin();
while (i != variables.constEnd())
{
- const QmuTranslation &var = i.value();
+ const qmu::QmuTranslation &var = i.value();
if (token.indexOf( var.translate() ) == 0)
{
newFormula.replace(position, var.translate().length(), i.key());
@@ -547,7 +545,7 @@ bool VTranslateVars::VariablesFromUser(QString &newFormula, int position, const
*/
bool VTranslateVars::PostfixOperatorsFromUser(QString &newFormula, int position, const QString &token, int &bias) const
{
- QMap::const_iterator i = postfixOperators.constBegin();
+ QMap::const_iterator i = postfixOperators.constBegin();
while (i != postfixOperators.constEnd())
{
if (token == i.value().translate())
@@ -572,7 +570,7 @@ bool VTranslateVars::PostfixOperatorsFromUser(QString &newFormula, int position,
*/
bool VTranslateVars::FunctionsFromUser(QString &newFormula, int position, const QString &token, int &bias) const
{
- QMap::const_iterator i = functions.constBegin();
+ QMap::const_iterator i = functions.constBegin();
while (i != functions.constEnd())
{
if (token == i.value().translate())
@@ -597,7 +595,7 @@ bool VTranslateVars::FunctionsFromUser(QString &newFormula, int position, const
*/
bool VTranslateVars::VariablesToUser(QString &newFormula, int position, const QString &token, int &bias) const
{
- QMap::const_iterator i = variables.constBegin();
+ QMap::const_iterator i = variables.constBegin();
while (i != variables.constEnd())
{
if (token.indexOf( i.key() ) == 0)
@@ -729,7 +727,7 @@ QString VTranslateVars::FormulaFromUser(const QString &formula, bool osSeparator
}
QString newFormula = formula;// Local copy for making changes
- QmuTokenParser *cal = new QmuTokenParser(formula, osSeparator);// Eval formula
+ qmu::QmuTokenParser *cal = new qmu::QmuTokenParser(formula, osSeparator);// Eval formula
QMap tokens = cal->GetTokens();// Tokens (variables, measurements)
QMap numbers = cal->GetNumbers();// All numbers in expression for changing decimal separator
delete cal;
@@ -850,7 +848,7 @@ QString VTranslateVars::FormulaToUser(const QString &formula, bool osSeparator)
QMap numbers;
try
{
- QmuTokenParser *cal = new QmuTokenParser(formula, false);// Eval formula
+ qmu::QmuTokenParser *cal = new qmu::QmuTokenParser(formula, false);// Eval formula
tokens = cal->GetTokens();// Tokens (variables, measurements)
numbers = cal->GetNumbers();// All numbers in expression for changing decimal separator
delete cal;
@@ -979,7 +977,7 @@ void VTranslateVars::Retranslate()
}
//---------------------------------------------------------------------------------------------------------------------
-QMap VTranslateVars::GetFunctions() const
+QMap VTranslateVars::GetFunctions() const
{
return functions;
}
diff --git a/src/libs/vpropertyexplorer/plugins/Vector3d/vvector3dproperty.cpp b/src/libs/vpropertyexplorer/plugins/Vector3d/vvector3dproperty.cpp
index fd24a78c3..ed4316d5b 100644
--- a/src/libs/vpropertyexplorer/plugins/Vector3d/vvector3dproperty.cpp
+++ b/src/libs/vpropertyexplorer/plugins/Vector3d/vvector3dproperty.cpp
@@ -20,8 +20,6 @@
#include "vvector3dproperty.h"
-using namespace VPE;
-
#include
#include
#include
@@ -30,7 +28,7 @@ using namespace VPE;
#include "../../vproperty_p.h"
#include "../vnumberproperty.h"
-QVector3DProperty::QVector3DProperty(const QString& name)
+VPE::QVector3DProperty::QVector3DProperty(const QString& name)
: VProperty(name, QVariant::String) // todo: QVariant::Vector3D??
{
QVariant tmpFloat(0); tmpFloat.convert(QVariant::Double);
@@ -42,7 +40,7 @@ QVector3DProperty::QVector3DProperty(const QString& name)
//! Get the data how it should be displayed
-QVariant QVector3DProperty::data (int column, int role) const
+QVariant VPE::QVector3DProperty::data (int column, int role) const
{
if (column == DPC_Data && Qt::DisplayRole == role)
{
@@ -56,7 +54,7 @@ QVariant QVector3DProperty::data (int column, int role) const
}
//! Returns item flags
-Qt::ItemFlags QVector3DProperty::flags(int column) const
+Qt::ItemFlags VPE::QVector3DProperty::flags(int column) const
{
if (column == DPC_Name || column == DPC_Data)
{
@@ -68,7 +66,7 @@ Qt::ItemFlags QVector3DProperty::flags(int column) const
//! Returns the Vector3d
-Vector3D QVector3DProperty::getVector() const
+VPE::Vector3D VPE::QVector3DProperty::getVector() const
{
Vector3D tmpVect;
@@ -85,12 +83,12 @@ Vector3D QVector3DProperty::getVector() const
}
//! Sets the Vector3d
-void QVector3DProperty::setVector(const Vector3D &vect)
+void VPE::QVector3DProperty::setVector(const Vector3D &vect)
{
setVector(vect.X, vect.Y, vect.Z);
}
-void QVector3DProperty::setVector(double x, double y, double z)
+void VPE::QVector3DProperty::setVector(double x, double y, double z)
{
if (d_ptr->Children.count() < 3)
{
@@ -105,12 +103,12 @@ void QVector3DProperty::setVector(double x, double y, double z)
d_ptr->Children.at(2)->setValue(tmpZ);
}
-QString QVector3DProperty::type() const
+QString VPE::QVector3DProperty::type() const
{
return "vector3d";
}
-VProperty* QVector3DProperty::clone(bool include_children, VProperty* container) const
+VPE::VProperty* VPE::QVector3DProperty::clone(bool include_children, VProperty* container) const
{
if (!container)
{
@@ -130,7 +128,7 @@ VProperty* QVector3DProperty::clone(bool include_children, VProperty* container)
return VProperty::clone(false, container); // Child
}
-void QVector3DProperty::setValue(const QVariant &value)
+void VPE::QVector3DProperty::setValue(const QVariant &value)
{
QStringList tmpStrings = value.toString().split(",");
if (tmpStrings.count() == 3)
@@ -140,7 +138,7 @@ void QVector3DProperty::setValue(const QVariant &value)
}
-QVariant QVector3DProperty::getValue() const
+QVariant VPE::QVector3DProperty::getValue() const
{
Vector3D tmpVect = getVector();
return QString("%1,%2,%3").arg(QString::number(tmpVect.X), QString::number(tmpVect.Y), QString::number(tmpVect.Z));
diff --git a/src/libs/vpropertyexplorer/plugins/vboolproperty.cpp b/src/libs/vpropertyexplorer/plugins/vboolproperty.cpp
index 6d14192c7..2e776c036 100644
--- a/src/libs/vpropertyexplorer/plugins/vboolproperty.cpp
+++ b/src/libs/vpropertyexplorer/plugins/vboolproperty.cpp
@@ -25,12 +25,11 @@
#include "../vproperty_p.h"
-using namespace VPE;
-QVariant VBoolProperty::TrueText;
-QVariant VBoolProperty::FalseText;
+QVariant VPE::VBoolProperty::TrueText;
+QVariant VPE::VBoolProperty::FalseText;
-VBoolProperty::VBoolProperty(const QString& name) :
+VPE::VBoolProperty::VBoolProperty(const QString& name) :
VProperty(name, QVariant::Bool)
{
d_ptr->VariantValue.setValue(false);
@@ -49,7 +48,7 @@ VBoolProperty::VBoolProperty(const QString& name) :
//! Get the data how it should be displayed
-QVariant VBoolProperty::data (int column, int role) const
+QVariant VPE::VBoolProperty::data (int column, int role) const
{
if (column == DPC_Data && (Qt::DisplayRole == role || Qt::EditRole == role))
{
@@ -63,7 +62,7 @@ QVariant VBoolProperty::data (int column, int role) const
return VProperty::data(column, role);
}
-bool VBoolProperty::setData(const QVariant &data, int role)
+bool VPE::VBoolProperty::setData(const QVariant &data, int role)
{
if (Qt::CheckStateRole == role)
{
@@ -75,7 +74,7 @@ bool VBoolProperty::setData(const QVariant &data, int role)
}
//! Returns item flags
-Qt::ItemFlags VBoolProperty::flags(int column) const
+Qt::ItemFlags VPE::VBoolProperty::flags(int column) const
{
if (column == DPC_Data)
{
@@ -85,12 +84,12 @@ Qt::ItemFlags VBoolProperty::flags(int column) const
return VProperty::flags(column);
}
-QString VBoolProperty::type() const
+QString VPE::VBoolProperty::type() const
{
return "bool";
}
-VProperty *VBoolProperty::clone(bool include_children, VProperty *container) const
+VPE::VProperty *VPE::VBoolProperty::clone(bool include_children, VProperty *container) const
{
return VProperty::clone(include_children, container ? container : new VBoolProperty(getName()));
}
diff --git a/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp b/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp
index e0eb6fc4c..b68175186 100644
--- a/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp
+++ b/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp
@@ -31,16 +31,14 @@
class QAbstractItemDelegate;
class QStyleOptionViewItem;
-using namespace VPE;
-
-VColorProperty::VColorProperty(const QString &name) :
+VPE::VColorProperty::VColorProperty(const QString &name) :
VProperty(name, QVariant::Color)
{
}
//! Get the data how it should be displayed
-QVariant VColorProperty::data (int column, int role) const
+QVariant VPE::VColorProperty::data (int column, int role) const
{
if (column == DPC_Data && (Qt::DisplayRole == role))
{
@@ -59,11 +57,11 @@ QVariant VColorProperty::data (int column, int role) const
}
//! Returns an editor widget, or NULL if it doesn't supply one
-QWidget* VColorProperty::createEditor(QWidget* parent, const QStyleOptionViewItem& options,
- const QAbstractItemDelegate* delegate)
+QWidget* VPE::VColorProperty::createEditor(QWidget* parent, const QStyleOptionViewItem& options,
+ const QAbstractItemDelegate* delegate)
{
- Q_UNUSED(options);
- Q_UNUSED(delegate);
+ Q_UNUSED(options)
+ Q_UNUSED(delegate)
VColorPropertyEditor* tmpWidget = new VColorPropertyEditor(parent);
tmpWidget->setLocale(parent->locale());
@@ -72,7 +70,7 @@ QWidget* VColorProperty::createEditor(QWidget* parent, const QStyleOptionViewIte
}
//! Sets the property's data to the editor (returns false, if the standard delegate should do that)
-bool VColorProperty::setEditorData(QWidget* editor)
+bool VPE::VColorProperty::setEditorData(QWidget* editor)
{
VColorPropertyEditor* tmpWidget = qobject_cast(editor);
if (tmpWidget)
@@ -86,7 +84,7 @@ bool VColorProperty::setEditorData(QWidget* editor)
}
//! Gets the data from the widget
-QVariant VColorProperty::getEditorData(const QWidget *editor) const
+QVariant VPE::VColorProperty::getEditorData(const QWidget *editor) const
{
const VColorPropertyEditor* tmpWidget = qobject_cast(editor);
if (tmpWidget)
@@ -97,12 +95,12 @@ QVariant VColorProperty::getEditorData(const QWidget *editor) const
return QVariant();
}
-QString VColorProperty::type() const
+QString VPE::VColorProperty::type() const
{
return "color";
}
-VProperty *VColorProperty::clone(bool include_children, VProperty *container) const
+VPE::VProperty *VPE::VColorProperty::clone(bool include_children, VProperty *container) const
{
return VProperty::clone(include_children, container ? container : new VColorProperty(getName()));
}
diff --git a/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp b/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp
index cc68925f0..5ee58279f 100644
--- a/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp
+++ b/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp
@@ -35,9 +35,7 @@
class QHBoxLayout;
-using namespace VPE;
-
-VColorPropertyEditor::VColorPropertyEditor(QWidget *parent)
+VPE::VColorPropertyEditor::VColorPropertyEditor(QWidget *parent)
: QWidget(parent), Color(), ToolButton(nullptr), TextLabel(nullptr), ColorLabel(nullptr), Spacer(nullptr)
{
setAutoFillBackground(true);
@@ -75,7 +73,7 @@ VColorPropertyEditor::VColorPropertyEditor(QWidget *parent)
//ColorLabel->hide(); // for now, we just use the standard display and only add the button
}
-void VColorPropertyEditor::SetColor(const QColor& color_)
+void VPE::VColorPropertyEditor::SetColor(const QColor& color_)
{
if (Color != color_)
{
@@ -85,7 +83,7 @@ void VColorPropertyEditor::SetColor(const QColor& color_)
}
}
-QPixmap VColorPropertyEditor::GetColorPixmap(const QColor& color, quint32 size)
+QPixmap VPE::VColorPropertyEditor::GetColorPixmap(const QColor& color, quint32 size)
{
QImage tmpImgage(static_cast(size), static_cast(size), QImage::Format_ARGB32_Premultiplied);
tmpImgage.fill(static_cast(color.rgb()));
@@ -93,12 +91,12 @@ QPixmap VColorPropertyEditor::GetColorPixmap(const QColor& color, quint32 size)
// todo: support alpha channel
}
-QString VColorPropertyEditor::GetColorString(const QColor& color)
+QString VPE::VColorPropertyEditor::GetColorString(const QColor& color)
{
return QString("[%1, %2, %3] (%4)").arg(color.red()).arg(color.green()).arg(color.blue()).arg(color.alpha());
}
-void VColorPropertyEditor::onToolButtonClicked()
+void VPE::VColorPropertyEditor::onToolButtonClicked()
{
bool ok = false;
QRgb oldRgba = Color.rgba();
@@ -112,7 +110,7 @@ void VColorPropertyEditor::onToolButtonClicked()
}
}
-bool VColorPropertyEditor::eventFilter(QObject *obj, QEvent *ev)
+bool VPE::VColorPropertyEditor::eventFilter(QObject *obj, QEvent *ev)
{
if (obj == ToolButton && ev->type() == QEvent::KeyPress)
{
@@ -125,12 +123,12 @@ bool VColorPropertyEditor::eventFilter(QObject *obj, QEvent *ev)
}
-VColorPropertyEditor::~VColorPropertyEditor()
+VPE::VColorPropertyEditor::~VColorPropertyEditor()
{
//
}
-QColor VColorPropertyEditor::GetColor() const
+QColor VPE::VColorPropertyEditor::GetColor() const
{
return Color;
}
diff --git a/src/libs/vpropertyexplorer/plugins/vemptyproperty.cpp b/src/libs/vpropertyexplorer/plugins/vemptyproperty.cpp
index 38ba60ee7..924c191da 100644
--- a/src/libs/vpropertyexplorer/plugins/vemptyproperty.cpp
+++ b/src/libs/vpropertyexplorer/plugins/vemptyproperty.cpp
@@ -35,27 +35,25 @@ namespace VPE {
class VPropertyPrivate;
} // namespace VPE
-using namespace VPE;
-
-VEmptyProperty::VEmptyProperty(const QString& name)
+VPE::VEmptyProperty::VEmptyProperty(const QString& name)
: VProperty(name, QVariant::Invalid)
{
}
-VEmptyProperty::VEmptyProperty(VPropertyPrivate *d)
+VPE::VEmptyProperty::VEmptyProperty(VPropertyPrivate *d)
: VProperty(d)
{
}
-VEmptyProperty::~VEmptyProperty()
+VPE::VEmptyProperty::~VEmptyProperty()
{
//
}
//! Get the data how it should be displayed
-QVariant VEmptyProperty::data (int column, int role) const
+QVariant VPE::VEmptyProperty::data (int column, int role) const
{
if (column == DPC_Data && (Qt::DisplayRole == role || Qt::EditRole == role))
{
@@ -74,39 +72,39 @@ QVariant VEmptyProperty::data (int column, int role) const
}
//! Returns an editor widget, or NULL if it doesn't supply one
-QWidget* VEmptyProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options,
- const QAbstractItemDelegate* delegate)
+QWidget* VPE::VEmptyProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options,
+ const QAbstractItemDelegate* delegate)
{
- Q_UNUSED(options);
- Q_UNUSED(parent);
- Q_UNUSED(delegate);
+ Q_UNUSED(options)
+ Q_UNUSED(parent)
+ Q_UNUSED(delegate)
return NULL;
}
//! Gets the data from the widget
-QVariant VEmptyProperty::getEditorData(const QWidget *editor) const
+QVariant VPE::VEmptyProperty::getEditorData(const QWidget *editor) const
{
- Q_UNUSED(editor);
+ Q_UNUSED(editor)
return QVariant();
}
//! Returns item flags
-Qt::ItemFlags VEmptyProperty::flags(int column) const
+Qt::ItemFlags VPE::VEmptyProperty::flags(int column) const
{
- Q_UNUSED(column);
+ Q_UNUSED(column)
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
}
-QString VEmptyProperty::type() const
+QString VPE::VEmptyProperty::type() const
{
return "empty";
}
-VProperty* VEmptyProperty::clone(bool include_children, VProperty* container) const
+VPE::VProperty* VPE::VEmptyProperty::clone(bool include_children, VProperty* container) const
{
return VProperty::clone(include_children, container ? container : new VEmptyProperty(getName()));
}
diff --git a/src/libs/vpropertyexplorer/plugins/venumproperty.cpp b/src/libs/vpropertyexplorer/plugins/venumproperty.cpp
index 24495253b..02d2b37c4 100644
--- a/src/libs/vpropertyexplorer/plugins/venumproperty.cpp
+++ b/src/libs/vpropertyexplorer/plugins/venumproperty.cpp
@@ -30,9 +30,7 @@
class QAbstractItemDelegate;
class QStyleOptionViewItem;
-using namespace VPE;
-
-VEnumProperty::VEnumProperty(const QString& name)
+VPE::VEnumProperty::VEnumProperty(const QString& name)
: VProperty(name, QVariant::Int), EnumerationLiterals()
{
VProperty::d_ptr->VariantValue = 0;
@@ -41,7 +39,7 @@ VEnumProperty::VEnumProperty(const QString& name)
//! Get the data how it should be displayed
-QVariant VEnumProperty::data (int column, int role) const
+QVariant VPE::VEnumProperty::data (int column, int role) const
{
if (EnumerationLiterals.empty())
{
@@ -69,11 +67,11 @@ QVariant VEnumProperty::data (int column, int role) const
//! Returns an editor widget, or NULL if it doesn't supply one
-QWidget* VEnumProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options,
- const QAbstractItemDelegate* delegate)
+QWidget* VPE::VEnumProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options,
+ const QAbstractItemDelegate* delegate)
{
- Q_UNUSED(options);
- Q_UNUSED(delegate);
+ Q_UNUSED(options)
+ Q_UNUSED(delegate)
QComboBox* tmpEditor = new QComboBox(parent);
tmpEditor->clear();
tmpEditor->setLocale(parent->locale());
@@ -87,7 +85,7 @@ QWidget* VEnumProperty::createEditor(QWidget * parent, const QStyleOptionViewIte
}
//! Gets the data from the widget
-QVariant VEnumProperty::getEditorData(const QWidget *editor) const
+QVariant VPE::VEnumProperty::getEditorData(const QWidget *editor) const
{
const QComboBox* tmpEditor = qobject_cast(editor);
if (tmpEditor)
@@ -99,19 +97,19 @@ QVariant VEnumProperty::getEditorData(const QWidget *editor) const
}
//! Sets the enumeration literals
-void VEnumProperty::setLiterals(const QStringList& literals)
+void VPE::VEnumProperty::setLiterals(const QStringList& literals)
{
EnumerationLiterals = literals;
}
//! Get the settings. This function has to be implemented in a subclass in order to have an effect
-QStringList VEnumProperty::getLiterals() const
+QStringList VPE::VEnumProperty::getLiterals() const
{
return EnumerationLiterals;
}
//! Sets the value of the property
-void VEnumProperty::setValue(const QVariant& value)
+void VPE::VEnumProperty::setValue(const QVariant& value)
{
int tmpIndex = value.toInt();
@@ -129,17 +127,17 @@ void VEnumProperty::setValue(const QVariant& value)
}
}
-QString VEnumProperty::type() const
+QString VPE::VEnumProperty::type() const
{
return "enum";
}
-VProperty* VEnumProperty::clone(bool include_children, VProperty* container) const
+VPE::VProperty* VPE::VEnumProperty::clone(bool include_children, VProperty* container) const
{
return VProperty::clone(include_children, container ? container : new VEnumProperty(getName()));
}
-void VEnumProperty::setSetting(const QString& key, const QVariant& value)
+void VPE::VEnumProperty::setSetting(const QString& key, const QVariant& value)
{
if (key == "literals")
{
@@ -147,7 +145,7 @@ void VEnumProperty::setSetting(const QString& key, const QVariant& value)
}
}
-QVariant VEnumProperty::getSetting(const QString& key) const
+QVariant VPE::VEnumProperty::getSetting(const QString& key) const
{
if (key == "literals")
{
@@ -157,12 +155,12 @@ QVariant VEnumProperty::getSetting(const QString& key) const
return VProperty::getSetting(key);
}
-QStringList VEnumProperty::getSettingKeys() const
+QStringList VPE::VEnumProperty::getSettingKeys() const
{
return QStringList("literals");
}
-void VEnumProperty::currentIndexChanged(int index)
+void VPE::VEnumProperty::currentIndexChanged(int index)
{
Q_UNUSED(index)
UserChangeEvent *event = new UserChangeEvent();
diff --git a/src/libs/vpropertyexplorer/plugins/vfileproperty.cpp b/src/libs/vpropertyexplorer/plugins/vfileproperty.cpp
index e5f900321..9406b3e7b 100644
--- a/src/libs/vpropertyexplorer/plugins/vfileproperty.cpp
+++ b/src/libs/vpropertyexplorer/plugins/vfileproperty.cpp
@@ -31,45 +31,43 @@
class QStyleOptionViewItem;
-using namespace VPE;
-
-VFileProperty::VFileProperty(const QString& name)
+VPE::VFileProperty::VFileProperty(const QString& name)
: VProperty(new VFilePropertyPrivate(name, QVariant::String))
{
}
-VFileProperty::~VFileProperty()
+VPE::VFileProperty::~VFileProperty()
{
//
}
-void VFileProperty::setFileFilters(const QString& filefilters)
+void VPE::VFileProperty::setFileFilters(const QString& filefilters)
{
static_cast(d_ptr)->FileFilters = filefilters;
}
-QString VFileProperty::getFileFilters() const
+QString VPE::VFileProperty::getFileFilters() const
{
return static_cast(d_ptr)->FileFilters;
}
-void VFileProperty::setFile(const QString& file)
+void VPE::VFileProperty::setFile(const QString& file)
{
d_ptr->VariantValue.setValue(file);
}
-QString VFileProperty::getFile() const
+QString VPE::VFileProperty::getFile() const
{
return d_ptr->VariantValue.toString();
}
-QVariant VFileProperty::data (int column, int role) const
+QVariant VPE::VFileProperty::data (int column, int role) const
{
if (column == DPC_Data && (Qt::DisplayRole == role || Qt::EditRole == role))
{
@@ -81,10 +79,10 @@ QVariant VFileProperty::data (int column, int role) const
}
-QWidget* VFileProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options,
+QWidget* VPE::VFileProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options,
const QAbstractItemDelegate* delegate)
{
- Q_UNUSED(options);
+ Q_UNUSED(options)
VFileEditWidget* tmpWidget = new VFileEditWidget(parent);
if (delegate)
@@ -100,7 +98,7 @@ QWidget* VFileProperty::createEditor(QWidget * parent, const QStyleOptionViewIte
}
-bool VFileProperty::setEditorData(QWidget* editor)
+bool VPE::VFileProperty::setEditorData(QWidget* editor)
{
VFileEditWidget* tmpWidget = qobject_cast(editor);
if (tmpWidget)
@@ -114,7 +112,7 @@ bool VFileProperty::setEditorData(QWidget* editor)
}
-QVariant VFileProperty::getEditorData(const QWidget *editor) const
+QVariant VPE::VFileProperty::getEditorData(const QWidget *editor) const
{
const VFileEditWidget* tmpWidget = qobject_cast(editor);
if (tmpWidget)
@@ -125,7 +123,7 @@ QVariant VFileProperty::getEditorData(const QWidget *editor) const
return QVariant();
}
-void VFileProperty::setSetting(const QString& key, const QVariant& value)
+void VPE::VFileProperty::setSetting(const QString& key, const QVariant& value)
{
if (key == "FileFilters")
{
@@ -137,7 +135,7 @@ void VFileProperty::setSetting(const QString& key, const QVariant& value)
}
}
-QVariant VFileProperty::getSetting(const QString& key) const
+QVariant VPE::VFileProperty::getSetting(const QString& key) const
{
if (key == "FileFilters")
{
@@ -151,28 +149,28 @@ QVariant VFileProperty::getSetting(const QString& key) const
return VProperty::getSetting(key);
}
-QStringList VFileProperty::getSettingKeys() const
+QStringList VPE::VFileProperty::getSettingKeys() const
{
return QStringList("FileFilters") << "Directory";
}
-QString VFileProperty::type() const
+QString VPE::VFileProperty::type() const
{
return "file";
}
-VProperty* VFileProperty::clone(bool include_children, VProperty* container) const
+VPE::VProperty* VPE::VFileProperty::clone(bool include_children, VProperty* container) const
{
return VProperty::clone(include_children, container ? container : new VFileProperty(getName()));
}
-bool VFileProperty::isDirectory() const
+bool VPE::VFileProperty::isDirectory() const
{
return static_cast(d_ptr)->Directory;
}
-void VFileProperty::setDirectory(bool is_directory)
+void VPE::VFileProperty::setDirectory(bool is_directory)
{
static_cast(d_ptr)->Directory = is_directory;
}
diff --git a/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.cpp b/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.cpp
index 942c976b8..1a8a6f94d 100644
--- a/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.cpp
+++ b/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.cpp
@@ -45,9 +45,7 @@ class QDragMoveEvent;
class QDropEvent;
class QHBoxLayout;
-using namespace VPE;
-
-VFileEditWidget::VFileEditWidget(QWidget *parent, bool is_directory)
+VPE::VFileEditWidget::VFileEditWidget(QWidget *parent, bool is_directory)
: QWidget(parent), CurrentFilePath(), ToolButton(nullptr), FileLineEdit(nullptr), FileDialogFilter(), FilterList(),
Directory(is_directory)
{
@@ -79,13 +77,13 @@ VFileEditWidget::VFileEditWidget(QWidget *parent, bool is_directory)
}
-VFileEditWidget::~VFileEditWidget()
+VPE::VFileEditWidget::~VFileEditWidget()
{
// nothing needs to be done here
}
-void VFileEditWidget::setFile(const QString &value, bool emit_signal)
+void VPE::VFileEditWidget::setFile(const QString &value, bool emit_signal)
{
if (CurrentFilePath != value)
{
@@ -101,24 +99,24 @@ void VFileEditWidget::setFile(const QString &value, bool emit_signal)
}
-void VFileEditWidget::setFilter(const QString &dialog_filter, const QStringList& filter_list)
+void VPE::VFileEditWidget::setFilter(const QString &dialog_filter, const QStringList& filter_list)
{
FileDialogFilter = dialog_filter;
FilterList = filter_list;
}
-void VFileEditWidget::setDirectory(bool dir)
+void VPE::VFileEditWidget::setDirectory(bool dir)
{
Directory = dir;
}
-QString VFileEditWidget::getFile() const
+QString VPE::VFileEditWidget::getFile() const
{
return CurrentFilePath;
}
-void VFileEditWidget::onToolButtonClicked()
+void VPE::VFileEditWidget::onToolButtonClicked()
{
QString filepath = (Directory ? QFileDialog::getExistingDirectory(0, tr("Directory"), CurrentFilePath)
: QFileDialog::getOpenFileName(0, tr("Open File"), CurrentFilePath,
@@ -130,7 +128,7 @@ void VFileEditWidget::onToolButtonClicked()
}
-bool VFileEditWidget::eventFilter(QObject *obj, QEvent *ev)
+bool VPE::VFileEditWidget::eventFilter(QObject *obj, QEvent *ev)
{
if (ev->type() == QEvent::DragEnter || ev->type() == QEvent::Drop)
{
@@ -170,13 +168,13 @@ bool VFileEditWidget::eventFilter(QObject *obj, QEvent *ev)
return QWidget::eventFilter(obj, ev);
}
-bool VFileEditWidget::isDirectory()
+bool VPE::VFileEditWidget::isDirectory()
{
return Directory;
}
-void VFileEditWidget::dragEnterEvent(QDragEnterEvent* event)
+void VPE::VFileEditWidget::dragEnterEvent(QDragEnterEvent* event)
{
QString tmpFileName;
if (checkMimeData(event->mimeData(), tmpFileName))
@@ -187,18 +185,18 @@ void VFileEditWidget::dragEnterEvent(QDragEnterEvent* event)
}
// cppcheck-suppress unusedFunction
-void VFileEditWidget::dragMoveEvent(QDragMoveEvent* event)
+void VPE::VFileEditWidget::dragMoveEvent(QDragMoveEvent* event)
{
event->acceptProposedAction();
}
// cppcheck-suppress unusedFunction
-void VFileEditWidget::dragLeaveEvent(QDragLeaveEvent* event)
+void VPE::VFileEditWidget::dragLeaveEvent(QDragLeaveEvent* event)
{
event->accept();
}
-void VFileEditWidget::dropEvent(QDropEvent* event)
+void VPE::VFileEditWidget::dropEvent(QDropEvent* event)
{
QString tmpFileName;
if (checkMimeData(event->mimeData(), tmpFileName))
@@ -212,7 +210,7 @@ void VFileEditWidget::dropEvent(QDropEvent* event)
}
-bool VFileEditWidget::checkMimeData(const QMimeData* data, QString& file) const
+bool VPE::VFileEditWidget::checkMimeData(const QMimeData* data, QString& file) const
{
if (data->hasUrls())
{
@@ -235,7 +233,7 @@ bool VFileEditWidget::checkMimeData(const QMimeData* data, QString& file) const
return false;
}
-bool VFileEditWidget::checkFileFilter(const QString& file) const
+bool VPE::VFileEditWidget::checkFileFilter(const QString& file) const
{
if (FilterList.isEmpty())
{
diff --git a/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp b/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp
index c2f04a636..970a8e590 100644
--- a/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp
+++ b/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp
@@ -45,16 +45,14 @@
class QAbstractItemDelegate;
class QStyleOptionViewItem;
-using namespace VPE;
-
-VLineColorProperty::VLineColorProperty(const QString &name)
+VPE::VLineColorProperty::VLineColorProperty(const QString &name)
: VProperty(name, QVariant::Int), colors(), indexList()
{
VProperty::d_ptr->VariantValue = 0;
VProperty::d_ptr->VariantValue.convert(QVariant::Int);
}
-QVariant VLineColorProperty::data(int column, int role) const
+QVariant VPE::VLineColorProperty::data(int column, int role) const
{
if (colors.empty())
{
@@ -82,11 +80,11 @@ QVariant VLineColorProperty::data(int column, int role) const
}
}
-QWidget *VLineColorProperty::createEditor(QWidget *parent, const QStyleOptionViewItem &options,
- const QAbstractItemDelegate *delegate)
+QWidget *VPE::VLineColorProperty::createEditor(QWidget *parent, const QStyleOptionViewItem &options,
+ const QAbstractItemDelegate *delegate)
{
- Q_UNUSED(options);
- Q_UNUSED(delegate);
+ Q_UNUSED(options)
+ Q_UNUSED(delegate)
QComboBox* tmpEditor = new QComboBox(parent);
int size = tmpEditor->iconSize().height();
@@ -113,7 +111,7 @@ QWidget *VLineColorProperty::createEditor(QWidget *parent, const QStyleOptionVie
return VProperty::d_ptr->editor;
}
-QVariant VLineColorProperty::getEditorData(const QWidget *editor) const
+QVariant VPE::VLineColorProperty::getEditorData(const QWidget *editor) const
{
const QComboBox* tmpEditor = qobject_cast(editor);
if (tmpEditor)
@@ -124,7 +122,7 @@ QVariant VLineColorProperty::getEditorData(const QWidget *editor) const
return QVariant(0);
}
-void VLineColorProperty::setColors(const QMap &colors)
+void VPE::VLineColorProperty::setColors(const QMap &colors)
{
this->colors = colors;
indexList.clear();
@@ -137,12 +135,12 @@ void VLineColorProperty::setColors(const QMap &colors)
}
// cppcheck-suppress unusedFunction
-QMap VLineColorProperty::getColors() const
+QMap VPE::VLineColorProperty::getColors() const
{
return colors;
}
-void VLineColorProperty::setValue(const QVariant &value)
+void VPE::VLineColorProperty::setValue(const QVariant &value)
{
int tmpIndex = value.toInt();
@@ -160,17 +158,17 @@ void VLineColorProperty::setValue(const QVariant &value)
}
}
-QString VLineColorProperty::type() const
+QString VPE::VLineColorProperty::type() const
{
return QStringLiteral("lineColor");
}
-VProperty *VLineColorProperty::clone(bool include_children, VProperty *container) const
+VPE::VProperty *VPE::VLineColorProperty::clone(bool include_children, VProperty *container) const
{
return VProperty::clone(include_children, container ? container : new VLineColorProperty(getName()));
}
-int VLineColorProperty::IndexOfColor(const QMap &colors, const QString &color)
+int VPE::VLineColorProperty::IndexOfColor(const QMap &colors, const QString &color)
{
QVector indexList;
QMap::const_iterator i = colors.constBegin();
@@ -182,7 +180,7 @@ int VLineColorProperty::IndexOfColor(const QMap &colors, const
return indexList.indexOf(color);
}
-void VLineColorProperty::currentIndexChanged(int index)
+void VPE::VLineColorProperty::currentIndexChanged(int index)
{
Q_UNUSED(index)
UserChangeEvent *event = new UserChangeEvent();
diff --git a/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp b/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp
index ece3d58bd..277281ee6 100644
--- a/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp
+++ b/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp
@@ -42,16 +42,14 @@
class QAbstractItemDelegate;
class QStyleOptionViewItem;
-using namespace VPE;
-
-VLineTypeProperty::VLineTypeProperty(const QString &name)
+VPE::VLineTypeProperty::VLineTypeProperty(const QString &name)
: VProperty(name, QVariant::Int), styles(), indexList()
{
VProperty::d_ptr->VariantValue = 0;
VProperty::d_ptr->VariantValue.convert(QVariant::Int);
}
-QVariant VLineTypeProperty::data(int column, int role) const
+QVariant VPE::VLineTypeProperty::data(int column, int role) const
{
if (styles.empty())
{
@@ -79,11 +77,11 @@ QVariant VLineTypeProperty::data(int column, int role) const
}
}
-QWidget *VLineTypeProperty::createEditor(QWidget *parent, const QStyleOptionViewItem &options,
+QWidget *VPE::VLineTypeProperty::createEditor(QWidget *parent, const QStyleOptionViewItem &options,
const QAbstractItemDelegate *delegate)
{
- Q_UNUSED(options);
- Q_UNUSED(delegate);
+ Q_UNUSED(options)
+ Q_UNUSED(delegate)
QComboBox* tmpEditor = new QComboBox(parent);
tmpEditor->clear();
tmpEditor->setLocale(parent->locale());
@@ -106,7 +104,7 @@ QWidget *VLineTypeProperty::createEditor(QWidget *parent, const QStyleOptionView
return VProperty::d_ptr->editor;
}
-QVariant VLineTypeProperty::getEditorData(const QWidget *editor) const
+QVariant VPE::VLineTypeProperty::getEditorData(const QWidget *editor) const
{
const QComboBox* tmpEditor = qobject_cast(editor);
if (tmpEditor)
@@ -117,7 +115,7 @@ QVariant VLineTypeProperty::getEditorData(const QWidget *editor) const
return QVariant(0);
}
-void VLineTypeProperty::setStyles(const QMap &styles)
+void VPE::VLineTypeProperty::setStyles(const QMap &styles)
{
this->styles = styles;
indexList.clear();
@@ -130,12 +128,12 @@ void VLineTypeProperty::setStyles(const QMap &styles)
}
// cppcheck-suppress unusedFunction
-QMap VLineTypeProperty::getStyles() const
+QMap VPE::VLineTypeProperty::getStyles() const
{
return styles;
}
-void VLineTypeProperty::setValue(const QVariant &value)
+void VPE::VLineTypeProperty::setValue(const QVariant &value)
{
int tmpIndex = value.toInt();
@@ -153,17 +151,17 @@ void VLineTypeProperty::setValue(const QVariant &value)
}
}
-QString VLineTypeProperty::type() const
+QString VPE::VLineTypeProperty::type() const
{
return QStringLiteral("lineType");
}
-VProperty *VLineTypeProperty::clone(bool include_children, VProperty *container) const
+VPE::VProperty *VPE::VLineTypeProperty::clone(bool include_children, VProperty *container) const
{
return VProperty::clone(include_children, container ? container : new VLineTypeProperty(getName()));
}
-int VLineTypeProperty::IndexOfStyle(const QMap &styles, const QString &style)
+int VPE::VLineTypeProperty::IndexOfStyle(const QMap