Refactoring. Backport QOverload template.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-01-12 15:25:20 +02:00
parent 15339939ef
commit 5c8c940f32
46 changed files with 225 additions and 170 deletions

View File

@ -44,7 +44,7 @@ TapePreferencesConfigurationPage::TapePreferencesConfigurationPage(QWidget *pare
ui->setupUi(this); ui->setupUi(this);
InitLanguages(ui->langCombo); InitLanguages(ui->langCombo);
connect(ui->langCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this]() connect(ui->langCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this]()
{ {
m_langChanged = true; m_langChanged = true;
}); });
@ -56,7 +56,7 @@ TapePreferencesConfigurationPage::TapePreferencesConfigurationPage(QWidget *pare
//---------------------- Pattern making system //---------------------- Pattern making system
InitPMSystems(ui->systemCombo); InitPMSystems(ui->systemCombo);
ui->systemBookValueLabel->setFixedHeight(4 * QFontMetrics(ui->systemBookValueLabel->font()).lineSpacing()); ui->systemBookValueLabel->setFixedHeight(4 * QFontMetrics(ui->systemBookValueLabel->font()).lineSpacing());
connect(ui->systemCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this]() connect(ui->systemCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this]()
{ {
m_systemChanged = true; m_systemChanged = true;
QString text = qApp->TrVars()->PMSystemAuthor(ui->systemCombo->currentData().toString()); QString text = qApp->TrVars()->PMSystemAuthor(ui->systemCombo->currentData().toString());
@ -98,8 +98,7 @@ TapePreferencesConfigurationPage::TapePreferencesConfigurationPage(QWidget *pare
m_defGradationChanged = true; m_defGradationChanged = true;
}; };
connect(ui->defHeightCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, connect(ui->defHeightCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, DefGradationChanged);
DefGradationChanged);
ui->defSizeCombo->addItems(VMeasurement::WholeListSizes(Unit::Cm)); ui->defSizeCombo->addItems(VMeasurement::WholeListSizes(Unit::Cm));
index = ui->defSizeCombo->findText(QString().setNum(qApp->TapeSettings()->GetDefSize())); index = ui->defSizeCombo->findText(QString().setNum(qApp->TapeSettings()->GetDefSize()));
@ -107,8 +106,7 @@ TapePreferencesConfigurationPage::TapePreferencesConfigurationPage(QWidget *pare
{ {
ui->defSizeCombo->setCurrentIndex(index); ui->defSizeCombo->setCurrentIndex(index);
} }
connect(ui->defHeightCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, connect(ui->defHeightCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, DefGradationChanged);
DefGradationChanged);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -64,10 +64,10 @@ DialogNewMeasurements::DialogNewMeasurements(QWidget *parent)
ui->comboBoxBaseSize->setCurrentIndex(index); ui->comboBoxBaseSize->setCurrentIndex(index);
} }
connect(ui->comboBoxMType, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, connect(ui->comboBoxMType, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&DialogNewMeasurements::CurrentTypeChanged); &DialogNewMeasurements::CurrentTypeChanged);
connect(ui->comboBoxUnit, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, connect(ui->comboBoxUnit, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&DialogNewMeasurements::CurrentUnitChanged); &DialogNewMeasurements::CurrentUnitChanged);
} }

View File

@ -2014,23 +2014,20 @@ void TMainWindow::InitWindow()
labelGradationHeights = new QLabel(tr("Height:")); labelGradationHeights = new QLabel(tr("Height:"));
gradationHeights = SetGradationList(labelGradationHeights, listHeights); gradationHeights = SetGradationList(labelGradationHeights, listHeights);
SetDefaultHeight(static_cast<int>(VContainer::height())); SetDefaultHeight(static_cast<int>(VContainer::height()));
connect(gradationHeights, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(gradationHeights, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &TMainWindow::ChangedHeight); this, &TMainWindow::ChangedHeight);
labelGradationSizes = new QLabel(tr("Size:")); labelGradationSizes = new QLabel(tr("Size:"));
gradationSizes = SetGradationList(labelGradationSizes, listSizes); gradationSizes = SetGradationList(labelGradationSizes, listSizes);
SetDefaultSize(static_cast<int>(VContainer::size())); SetDefaultSize(static_cast<int>(VContainer::size()));
connect(gradationSizes, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(gradationSizes, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &TMainWindow::ChangedSize); this, &TMainWindow::ChangedSize);
connect(ui->doubleSpinBoxBaseValue, connect(ui->doubleSpinBoxBaseValue, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
this, &TMainWindow::SaveMBaseValue); this, &TMainWindow::SaveMBaseValue);
connect(ui->doubleSpinBoxInSizes, connect(ui->doubleSpinBoxInSizes, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
this, &TMainWindow::SaveMSizeIncrease); this, &TMainWindow::SaveMSizeIncrease);
connect(ui->doubleSpinBoxInHeights, connect(ui->doubleSpinBoxInHeights, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
this, &TMainWindow::SaveMHeightIncrease); this, &TMainWindow::SaveMHeightIncrease);
SetDecimals(); SetDecimals();
@ -2076,7 +2073,7 @@ void TMainWindow::InitWindow()
connect(ui->lineEditCustomerName, &QLineEdit::editingFinished, this, &TMainWindow::SaveCustomerName); connect(ui->lineEditCustomerName, &QLineEdit::editingFinished, this, &TMainWindow::SaveCustomerName);
connect(ui->lineEditEmail, &QLineEdit::editingFinished, this, &TMainWindow::SaveEmail); connect(ui->lineEditEmail, &QLineEdit::editingFinished, this, &TMainWindow::SaveEmail);
connect(ui->comboBoxGender, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, connect(ui->comboBoxGender, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&TMainWindow::SaveGender); &TMainWindow::SaveGender);
connect(ui->dateEditBirthDate, &QDateEdit::dateChanged, this, &TMainWindow::SaveBirthDate); connect(ui->dateEditBirthDate, &QDateEdit::dateChanged, this, &TMainWindow::SaveBirthDate);
connect(ui->pushButtonGrow, &QPushButton::clicked, this, &TMainWindow::DeployFormula); connect(ui->pushButtonGrow, &QPushButton::clicked, this, &TMainWindow::DeployFormula);
@ -2093,7 +2090,7 @@ void TMainWindow::InitWindow()
InitPMSystems(ui->comboBoxPMSystem); InitPMSystems(ui->comboBoxPMSystem);
const qint32 index = ui->comboBoxPMSystem->findData(QLatin1Char('p')+m->PMSystem()); const qint32 index = ui->comboBoxPMSystem->findData(QLatin1Char('p')+m->PMSystem());
ui->comboBoxPMSystem->setCurrentIndex(index); ui->comboBoxPMSystem->setCurrentIndex(index);
connect(ui->comboBoxPMSystem, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, connect(ui->comboBoxPMSystem, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&TMainWindow::SavePMSystem); &TMainWindow::SavePMSystem);
connect(ui->lineEditFind, &QLineEdit::textChanged, [this] (const QString &term){search->Find(term);}); connect(ui->lineEditFind, &QLineEdit::textChanged, [this] (const QString &term){search->Find(term);});
@ -3078,8 +3075,7 @@ void TMainWindow::InitUnits()
comboBoxUnits->setCurrentIndex(indexUnit); comboBoxUnits->setCurrentIndex(indexUnit);
} }
connect(comboBoxUnits, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, connect(comboBoxUnits, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &TMainWindow::PatternUnitChanged);
&TMainWindow::PatternUnitChanged);
ui->toolBarGradation->addWidget(comboBoxUnits); ui->toolBarGradation->addWidget(comboBoxUnits);
} }

View File

@ -49,7 +49,7 @@ PreferencesConfigurationPage::PreferencesConfigurationPage(QWidget *parent)
ui->autoSaveCheck->setChecked(qApp->ValentinaSettings()->GetAutosaveState()); ui->autoSaveCheck->setChecked(qApp->ValentinaSettings()->GetAutosaveState());
InitLanguages(ui->langCombo); InitLanguages(ui->langCombo);
connect(ui->langCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this]() connect(ui->langCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this]()
{ {
m_langChanged = true; m_langChanged = true;
}); });
@ -60,7 +60,7 @@ PreferencesConfigurationPage::PreferencesConfigurationPage(QWidget *parent)
//----------------------- Unit setup //----------------------- Unit setup
InitUnits(); InitUnits();
connect(ui->unitCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this]() connect(ui->unitCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this]()
{ {
m_unitChanged = true; m_unitChanged = true;
}); });
@ -73,7 +73,7 @@ PreferencesConfigurationPage::PreferencesConfigurationPage(QWidget *parent)
{ {
ui->labelCombo->setCurrentIndex(index); ui->labelCombo->setCurrentIndex(index);
} }
connect(ui->labelCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this]() connect(ui->labelCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this]()
{ {
m_labelLangChanged = true; m_labelLangChanged = true;
}); });
@ -81,7 +81,7 @@ PreferencesConfigurationPage::PreferencesConfigurationPage(QWidget *parent)
//---------------------- Pattern making system //---------------------- Pattern making system
InitPMSystems(ui->systemCombo); InitPMSystems(ui->systemCombo);
ui->systemBookValueLabel->setFixedHeight(4 * QFontMetrics(ui->systemBookValueLabel->font()).lineSpacing()); ui->systemBookValueLabel->setFixedHeight(4 * QFontMetrics(ui->systemBookValueLabel->font()).lineSpacing());
connect(ui->systemCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this]() connect(ui->systemCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this]()
{ {
m_systemChanged = true; m_systemChanged = true;
QString text = qApp->TrVars()->PMSystemAuthor(ui->systemCombo->currentData().toString()); QString text = qApp->TrVars()->PMSystemAuthor(ui->systemCombo->currentData().toString());

View File

@ -71,34 +71,34 @@ DialogLayoutSettings::DialogLayoutSettings(VLayoutGenerator *generator, QWidget
RestoreDefaults(); RestoreDefaults();
} }
connect(ui->comboBoxPrinter, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxPrinter, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &DialogLayoutSettings::PrinterMargins); this, &DialogLayoutSettings::PrinterMargins);
connect(ui->comboBoxTemplates, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxTemplates, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &DialogLayoutSettings::TemplateSelected); this, &DialogLayoutSettings::TemplateSelected);
connect(ui->comboBoxPaperSizeUnit, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxPaperSizeUnit, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &DialogLayoutSettings::ConvertPaperSize); this, &DialogLayoutSettings::ConvertPaperSize);
connect(ui->doubleSpinBoxPaperWidth, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxPaperWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
this, &DialogLayoutSettings::PaperSizeChanged); this, &DialogLayoutSettings::PaperSizeChanged);
connect(ui->doubleSpinBoxPaperHeight, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxPaperHeight, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
this, &DialogLayoutSettings::PaperSizeChanged); this, &DialogLayoutSettings::PaperSizeChanged);
connect(ui->doubleSpinBoxPaperWidth, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxPaperWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
this, &DialogLayoutSettings::FindTemplate); this, &DialogLayoutSettings::FindTemplate);
connect(ui->doubleSpinBoxPaperHeight, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxPaperHeight, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
this, &DialogLayoutSettings::FindTemplate); this, &DialogLayoutSettings::FindTemplate);
connect(ui->doubleSpinBoxPaperWidth, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxPaperWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
this, &DialogLayoutSettings::CorrectMaxFileds); this, &DialogLayoutSettings::CorrectMaxFileds);
connect(ui->doubleSpinBoxPaperHeight, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxPaperHeight, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
this, &DialogLayoutSettings::CorrectMaxFileds); this, &DialogLayoutSettings::CorrectMaxFileds);
connect(ui->checkBoxIgnoreFileds, &QCheckBox::stateChanged, this, &DialogLayoutSettings::IgnoreAllFields); connect(ui->checkBoxIgnoreFileds, &QCheckBox::stateChanged, this, &DialogLayoutSettings::IgnoreAllFields);
connect(ui->toolButtonPortrait, &QToolButton::toggled, this, &DialogLayoutSettings::Swap); connect(ui->toolButtonPortrait, &QToolButton::toggled, this, &DialogLayoutSettings::Swap);
connect(ui->toolButtonLandscape, &QToolButton::toggled, this, &DialogLayoutSettings::Swap); connect(ui->toolButtonLandscape, &QToolButton::toggled, this, &DialogLayoutSettings::Swap);
connect(ui->comboBoxLayoutUnit, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxLayoutUnit, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &DialogLayoutSettings::ConvertLayoutSize); this, &DialogLayoutSettings::ConvertLayoutSize);
QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok); QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok);

View File

@ -156,10 +156,8 @@ DialogPatternProperties::DialogPatternProperties(VPattern *doc, VContainer *pat
ui->radioButtonDefFromP->setChecked(doc->IsDefCustom()); ui->radioButtonDefFromP->setChecked(doc->IsDefCustom());
connect(ui->comboBoxHeight, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxHeight, QOverload<int>::of(&QComboBox::currentIndexChanged), this, DefValueChanged);
this, DefValueChanged); connect(ui->comboBoxSize, QOverload<int>::of(&QComboBox::currentIndexChanged), this, DefValueChanged);
connect(ui->comboBoxSize, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, DefValueChanged);
const bool readOnly = doc->IsReadOnly(); const bool readOnly = doc->IsReadOnly();
ui->checkBoxPatternReadOnly->setChecked(readOnly); ui->checkBoxPatternReadOnly->setChecked(readOnly);
@ -207,9 +205,9 @@ DialogPatternProperties::DialogPatternProperties(VPattern *doc, VContainer *pat
VCommonSettings::PredefinedTimeFormats() + settings->GetUserDefinedTimeFormats(), VCommonSettings::PredefinedTimeFormats() + settings->GetUserDefinedTimeFormats(),
doc->GetLabelTimeFormat()); doc->GetLabelTimeFormat());
connect(ui->comboBoxDateFormat, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxDateFormat, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &DialogPatternProperties::LabelDataChanged); this, &DialogPatternProperties::LabelDataChanged);
connect(ui->comboBoxTimeFormat, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxTimeFormat, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &DialogPatternProperties::LabelDataChanged); this, &DialogPatternProperties::LabelDataChanged);
} }

View File

@ -105,7 +105,7 @@ DialogSaveLayout::DialogSaveLayout(int count, Draw mode, const QString &fileName
connect(bOk, &QPushButton::clicked, this, &DialogSaveLayout::Save); connect(bOk, &QPushButton::clicked, this, &DialogSaveLayout::Save);
connect(ui->lineEditFileName, &QLineEdit::textChanged, this, &DialogSaveLayout::ShowExample); connect(ui->lineEditFileName, &QLineEdit::textChanged, this, &DialogSaveLayout::ShowExample);
connect(ui->comboBoxFormat, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxFormat, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &DialogSaveLayout::ShowExample); this, &DialogSaveLayout::ShowExample);
connect(ui->pushButtonBrowse, &QPushButton::clicked, this, [this]() connect(ui->pushButtonBrowse, &QPushButton::clicked, this, [this]()
{ {
@ -141,17 +141,17 @@ DialogSaveLayout::DialogSaveLayout(int count, Draw mode, const QString &fileName
ReadSettings(); ReadSettings();
// connect for the template drop down box of the tiled pds // connect for the template drop down box of the tiled pds
connect(ui->comboBoxTemplates, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxTemplates, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &DialogSaveLayout::WriteSettings); this, &DialogSaveLayout::WriteSettings);
// connects for the margins of the tiled pdf // connects for the margins of the tiled pdf
connect(ui->doubleSpinBoxLeftField, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxLeftField, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
this, &DialogSaveLayout::WriteSettings); this, &DialogSaveLayout::WriteSettings);
connect(ui->doubleSpinBoxTopField, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxTopField, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
this, &DialogSaveLayout::WriteSettings); this, &DialogSaveLayout::WriteSettings);
connect(ui->doubleSpinBoxRightField, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxRightField, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
this, &DialogSaveLayout::WriteSettings); this, &DialogSaveLayout::WriteSettings);
connect(ui->doubleSpinBoxBottomField, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxBottomField, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
this, &DialogSaveLayout::WriteSettings); this, &DialogSaveLayout::WriteSettings);
// connects for the orientation buttons for the tiled pdf // connects for the orientation buttons for the tiled pdf

View File

@ -1907,8 +1907,7 @@ void MainWindow::ToolBarOption()
// set default height // set default height
SetDefaultHeight(); SetDefaultHeight();
connect(gradationHeights.data(), connect(gradationHeights.data(), QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &MainWindow::ChangedHeight); this, &MainWindow::ChangedHeight);
gradationSizesLabel = new QLabel(tr("Size:"), this); gradationSizesLabel = new QLabel(tr("Size:"), this);
@ -1917,8 +1916,7 @@ void MainWindow::ToolBarOption()
// set default size // set default size
SetDefaultSize(); SetDefaultSize();
connect(gradationSizes.data(), connect(gradationSizes.data(), QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &MainWindow::ChangedSize); this, &MainWindow::ChangedSize);
ui->toolBarOption->addSeparator(); ui->toolBarOption->addSeparator();
@ -1931,7 +1929,7 @@ void MainWindow::ToolBarOption()
doubleSpinBoxScale->setDecimals(1); doubleSpinBoxScale->setDecimals(1);
doubleSpinBoxScale->setSuffix("%"); doubleSpinBoxScale->setSuffix("%");
ScaleChanged(ui->view->transform().m11()); ScaleChanged(ui->view->transform().m11());
connect(doubleSpinBoxScale.data(), static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), connect(doubleSpinBoxScale.data(), QOverload<double>::of(&QDoubleSpinBox::valueChanged),
this, [this](double d){ui->view->Zoom(d/100.0);}); this, [this](double d){ui->view->Zoom(d/100.0);});
ui->toolBarOption->addWidget(doubleSpinBoxScale); ui->toolBarOption->addWidget(doubleSpinBoxScale);
@ -1979,7 +1977,7 @@ void MainWindow::ToolBarDraws()
ui->toolBarDraws->addWidget(comboBoxDraws); ui->toolBarDraws->addWidget(comboBoxDraws);
comboBoxDraws->setSizeAdjustPolicy(QComboBox::AdjustToContents); comboBoxDraws->setSizeAdjustPolicy(QComboBox::AdjustToContents);
comboBoxDraws->setEnabled(false); comboBoxDraws->setEnabled(false);
connect(comboBoxDraws, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), connect(comboBoxDraws, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, [this](int index){ChangePP(index);}); this, [this](int index){ChangePP(index);});
connect(ui->actionOptionDraw, &QAction::triggered, this, [this]() connect(ui->actionOptionDraw, &QAction::triggered, this, [this]()

View File

@ -0,0 +1,86 @@
/************************************************************************
**
** @file qoverload.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 12 1, 2018
**
** @brief
** @copyright
** This source code is part of the Valentina project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2018 Valentina project
** <https://bitbucket.org/dismine/valentina> 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 <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#ifndef QOVERLOAD_H
#define QOVERLOAD_H
#include <QtGlobal>
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_COMPILER_VARIADIC_TEMPLATES)
template <typename... Args>
struct QNonConstOverload
{
template <typename R, typename T>
Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args...)) const Q_DECL_NOTHROW -> decltype(ptr)
{ return ptr; }
template <typename R, typename T>
static Q_DECL_CONSTEXPR auto of(R (T::*ptr)(Args...)) Q_DECL_NOTHROW -> decltype(ptr)
{ return ptr; }
};
template <typename... Args>
struct QConstOverload
{
template <typename R, typename T>
Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args...) const) const Q_DECL_NOTHROW -> decltype(ptr)
{ return ptr; }
template <typename R, typename T>
static Q_DECL_CONSTEXPR auto of(R (T::*ptr)(Args...) const) Q_DECL_NOTHROW -> decltype(ptr)
{ return ptr; }
};
template <typename... Args>
struct QOverload : QConstOverload<Args...>, QNonConstOverload<Args...>
{
using QConstOverload<Args...>::of;
using QConstOverload<Args...>::operator();
using QNonConstOverload<Args...>::of;
using QNonConstOverload<Args...>::operator();
template <typename R>
Q_DECL_CONSTEXPR auto operator()(R (*ptr)(Args...)) const Q_DECL_NOTHROW -> decltype(ptr)
{ return ptr; }
template <typename R>
static Q_DECL_CONSTEXPR auto of(R (*ptr)(Args...)) Q_DECL_NOTHROW -> decltype(ptr)
{ return ptr; }
};
#if defined(__cpp_variable_templates) && __cpp_variable_templates >= 201304 // C++14
template <typename... Args> Q_CONSTEXPR Q_DECL_UNUSED QOverload<Args...> qOverload = {};
template <typename... Args> Q_CONSTEXPR Q_DECL_UNUSED QConstOverload<Args...> qConstOverload = {};
template <typename... Args> Q_CONSTEXPR Q_DECL_UNUSED QNonConstOverload<Args...> qNonConstOverload = {};
#endif
#endif // Q_COMPILER_VARIADIC_TEMPLATES
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#endif // QOVERLOAD_H

View File

@ -30,6 +30,8 @@
#include <QtGlobal> #include <QtGlobal>
#include "backport/qoverload.h"
#define PRINTDPI 96.0 #define PRINTDPI 96.0
extern const qreal PrintDPI; extern const qreal PrintDPI;

View File

@ -35,7 +35,8 @@ HEADERS += \
$$PWD/diagnostic.h \ $$PWD/diagnostic.h \
$$PWD/dialogs/dialogexporttocsv.h \ $$PWD/dialogs/dialogexporttocsv.h \
$$PWD/customevents.h \ $$PWD/customevents.h \
$$PWD/defglobal.h $$PWD/defglobal.h \
$$PWD/backport/qoverload.h
# Qt's versions # Qt's versions
# 5.2.0, 5.2.1 # 5.2.0, 5.2.1

View File

@ -74,8 +74,7 @@ QWidget* VPE::VEnumProperty::createEditor(QWidget * parent, const QStyleOptionVi
tmpEditor->setLocale(parent->locale()); tmpEditor->setLocale(parent->locale());
tmpEditor->addItems(EnumerationLiterals); tmpEditor->addItems(EnumerationLiterals);
tmpEditor->setCurrentIndex(VProperty::d_ptr->VariantValue.toInt()); tmpEditor->setCurrentIndex(VProperty::d_ptr->VariantValue.toInt());
connect(tmpEditor, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, connect(tmpEditor, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &VEnumProperty::currentIndexChanged);
&VEnumProperty::currentIndexChanged);
VProperty::d_ptr->editor = tmpEditor; VProperty::d_ptr->editor = tmpEditor;
return VProperty::d_ptr->editor; return VProperty::d_ptr->editor;

View File

@ -101,7 +101,7 @@ QWidget *VPE::VLineColorProperty::createEditor(QWidget *parent, const QStyleOpti
tmpEditor->setLocale(parent->locale()); tmpEditor->setLocale(parent->locale());
tmpEditor->setCurrentIndex(VProperty::d_ptr->VariantValue.toInt()); tmpEditor->setCurrentIndex(VProperty::d_ptr->VariantValue.toInt());
connect(tmpEditor, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, connect(tmpEditor, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&VLineColorProperty::currentIndexChanged); &VLineColorProperty::currentIndexChanged);
VProperty::d_ptr->editor = tmpEditor; VProperty::d_ptr->editor = tmpEditor;

View File

@ -94,7 +94,7 @@ QWidget *VPE::VLineTypeProperty::createEditor(QWidget *parent, const QStyleOptio
} }
tmpEditor->setCurrentIndex(VProperty::d_ptr->VariantValue.toInt()); tmpEditor->setCurrentIndex(VProperty::d_ptr->VariantValue.toInt());
connect(tmpEditor, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, connect(tmpEditor, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&VLineTypeProperty::currentIndexChanged); &VLineTypeProperty::currentIndexChanged);
VProperty::d_ptr->editor = tmpEditor; VProperty::d_ptr->editor = tmpEditor;

View File

@ -62,8 +62,7 @@ QWidget* VPE::VIntegerProperty::createEditor(QWidget * parent, const QStyleOptio
tmpEditor->setSingleStep(static_cast<int>(singleStep)); tmpEditor->setSingleStep(static_cast<int>(singleStep));
tmpEditor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); tmpEditor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
tmpEditor->setValue(VProperty::d_ptr->VariantValue.toInt()); tmpEditor->setValue(VProperty::d_ptr->VariantValue.toInt());
connect(tmpEditor, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, connect(tmpEditor, QOverload<int>::of(&QSpinBox::valueChanged), this, &VIntegerProperty::valueChanged);
&VIntegerProperty::valueChanged);
VProperty::d_ptr->editor = tmpEditor; VProperty::d_ptr->editor = tmpEditor;
return VProperty::d_ptr->editor; return VProperty::d_ptr->editor;
@ -170,8 +169,7 @@ QWidget* VPE::VDoubleProperty::createEditor(QWidget * parent, const QStyleOption
tmpEditor->setSingleStep(singleStep); tmpEditor->setSingleStep(singleStep);
tmpEditor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); tmpEditor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
tmpEditor->setValue(VProperty::d_ptr->VariantValue.toDouble()); tmpEditor->setValue(VProperty::d_ptr->VariantValue.toDouble());
connect(tmpEditor, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), this, connect(tmpEditor, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &VIntegerProperty::valueChanged);
&VIntegerProperty::valueChanged);
VProperty::d_ptr->editor = tmpEditor; VProperty::d_ptr->editor = tmpEditor;
return VProperty::d_ptr->editor; return VProperty::d_ptr->editor;

View File

@ -67,7 +67,7 @@ QWidget* VPE::VObjectProperty::createEditor(QWidget * parent, const QStyleOption
tmpEditor->setLocale(parent->locale()); tmpEditor->setLocale(parent->locale());
FillList(tmpEditor, objects); FillList(tmpEditor, objects);
tmpEditor->setCurrentIndex(tmpEditor->findData(VProperty::d_ptr->VariantValue.toUInt())); tmpEditor->setCurrentIndex(tmpEditor->findData(VProperty::d_ptr->VariantValue.toUInt()));
connect(tmpEditor, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, connect(tmpEditor, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&VObjectProperty::currentIndexChanged); &VObjectProperty::currentIndexChanged);
VProperty::d_ptr->editor = tmpEditor; VProperty::d_ptr->editor = tmpEditor;

View File

@ -36,6 +36,7 @@
#include <QtGlobal> #include <QtGlobal>
#include "vpropertyexplorer_global.h" #include "vpropertyexplorer_global.h"
#include "../vmisc/backport/qoverload.h"
template <typename T> class QList; template <typename T> class QList;

View File

@ -68,7 +68,7 @@ DialogEditLabel::DialogEditLabel(VAbstractPattern *doc, QWidget *parent)
connect(ui->toolButtonNewLabel, &QToolButton::clicked, this, &DialogEditLabel::NewTemplate); connect(ui->toolButtonNewLabel, &QToolButton::clicked, this, &DialogEditLabel::NewTemplate);
connect(ui->toolButtonExportLabel, &QToolButton::clicked, this, &DialogEditLabel::ExportTemplate); connect(ui->toolButtonExportLabel, &QToolButton::clicked, this, &DialogEditLabel::ExportTemplate);
connect(ui->toolButtonImportLabel, &QToolButton::clicked, this, &DialogEditLabel::ImportTemplate); connect(ui->toolButtonImportLabel, &QToolButton::clicked, this, &DialogEditLabel::ImportTemplate);
connect(ui->spinBoxFontSize, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, connect(ui->spinBoxFontSize, QOverload<int>::of(&QSpinBox::valueChanged), this,
&DialogEditLabel::SaveAdditionalFontSize); &DialogEditLabel::SaveAdditionalFontSize);
InitPlaceholders(); InitPlaceholders();

View File

@ -89,9 +89,9 @@ DialogAlongLine::DialogAlongLine(const VContainer *data, const quint32 &toolId,
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogAlongLine::NamePointChanged); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogAlongLine::NamePointChanged);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogAlongLine::FormulaTextChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogAlongLine::FormulaTextChanged);
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogAlongLine::DeployFormulaTextEdit); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogAlongLine::DeployFormulaTextEdit);
connect(ui->comboBoxFirstPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxFirstPoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogAlongLine::PointChanged); this, &DialogAlongLine::PointChanged);
connect(ui->comboBoxSecondPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxSecondPoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogAlongLine::PointChanged); this, &DialogAlongLine::PointChanged);
vis = new VisToolAlongLine(data); vis = new VisToolAlongLine(data);

View File

@ -82,11 +82,11 @@ DialogBisector::DialogBisector(const VContainer *data, const quint32 &toolId, QW
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogBisector::NamePointChanged); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogBisector::NamePointChanged);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogBisector::FormulaTextChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogBisector::FormulaTextChanged);
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogBisector::DeployFormulaTextEdit); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogBisector::DeployFormulaTextEdit);
connect(ui->comboBoxFirstPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxFirstPoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogBisector::PointNameChanged); this, &DialogBisector::PointNameChanged);
connect(ui->comboBoxSecondPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxSecondPoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogBisector::PointNameChanged); this, &DialogBisector::PointNameChanged);
connect(ui->comboBoxThirdPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxThirdPoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogBisector::PointNameChanged); this, &DialogBisector::PointNameChanged);
vis = new VisToolBisector(data); vis = new VisToolBisector(data);

View File

@ -64,13 +64,13 @@ DialogCubicBezier::DialogCubicBezier(const VContainer *data, const quint32 &tool
DialogTool::CheckState(); DialogTool::CheckState();
connect(ui->comboBoxP1, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxP1, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogCubicBezier::PointNameChanged); this, &DialogCubicBezier::PointNameChanged);
connect(ui->comboBoxP2, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxP2, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogCubicBezier::PointNameChanged); this, &DialogCubicBezier::PointNameChanged);
connect(ui->comboBoxP3, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxP3, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogCubicBezier::PointNameChanged); this, &DialogCubicBezier::PointNameChanged);
connect(ui->comboBoxP4, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxP4, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogCubicBezier::PointNameChanged); this, &DialogCubicBezier::PointNameChanged);
vis = new VisToolCubicBezier(data); vis = new VisToolCubicBezier(data);

View File

@ -76,7 +76,7 @@ DialogCubicBezierPath::DialogCubicBezierPath(const VContainer *data, const quint
ui->doubleSpinBoxApproximationScale->setMaximum(maxCurveApproximationScale); ui->doubleSpinBoxApproximationScale->setMaximum(maxCurveApproximationScale);
connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogCubicBezierPath::PointChanged); connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogCubicBezierPath::PointChanged);
connect(ui->comboBoxPoint, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxPoint, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &DialogCubicBezierPath::currentPointChanged); this, &DialogCubicBezierPath::currentPointChanged);
vis = new VisToolCubicBezierPath(data); vis = new VisToolCubicBezierPath(data);

View File

@ -79,7 +79,7 @@ DialogFlippingByAxis::DialogFlippingByAxis(const VContainer *data, const quint32
CheckState(); CheckState();
connect(ui->lineEditSuffix, &QLineEdit::textChanged, this, &DialogFlippingByAxis::SuffixChanged); connect(ui->lineEditSuffix, &QLineEdit::textChanged, this, &DialogFlippingByAxis::SuffixChanged);
connect(ui->comboBoxOriginPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxOriginPoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogFlippingByAxis::PointChanged); this, &DialogFlippingByAxis::PointChanged);
vis = new VisToolFlippingByAxis(data); vis = new VisToolFlippingByAxis(data);

View File

@ -79,11 +79,9 @@ DialogFlippingByLine::DialogFlippingByLine(const VContainer *data, const quint32
CheckState(); CheckState();
connect(ui->lineEditSuffix, &QLineEdit::textChanged, this, &DialogFlippingByLine::SuffixChanged); connect(ui->lineEditSuffix, &QLineEdit::textChanged, this, &DialogFlippingByLine::SuffixChanged);
connect(ui->comboBoxFirstLinePoint, connect(ui->comboBoxFirstLinePoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &DialogFlippingByLine::PointChanged); this, &DialogFlippingByLine::PointChanged);
connect(ui->comboBoxSecondLinePoint, connect(ui->comboBoxSecondLinePoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &DialogFlippingByLine::PointChanged); this, &DialogFlippingByLine::PointChanged);
vis = new VisToolFlippingByLine(data); vis = new VisToolFlippingByLine(data);

View File

@ -76,11 +76,11 @@ DialogHeight::DialogHeight(const VContainer *data, const quint32 &toolId, QWidge
FillComboBoxLineColors(ui->comboBoxLineColor); FillComboBoxLineColors(ui->comboBoxLineColor);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogHeight::NamePointChanged); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogHeight::NamePointChanged);
connect(ui->comboBoxBasePoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxBasePoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogHeight::PointNameChanged); this, &DialogHeight::PointNameChanged);
connect(ui->comboBoxP1Line, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxP1Line, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogHeight::PointNameChanged); this, &DialogHeight::PointNameChanged);
connect(ui->comboBoxP2Line, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxP2Line, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogHeight::PointNameChanged); this, &DialogHeight::PointNameChanged);
vis = new VisToolHeight(data); vis = new VisToolHeight(data);

View File

@ -64,9 +64,9 @@ DialogLine::DialogLine(const VContainer *data, const quint32 &toolId, QWidget *p
number = 0; number = 0;
connect(ui->comboBoxFirstPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxFirstPoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogLine::PointNameChanged); this, &DialogLine::PointNameChanged);
connect(ui->comboBoxSecondPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxSecondPoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogLine::PointNameChanged); this, &DialogLine::PointNameChanged);
vis = new VisToolLine(data); vis = new VisToolLine(data);

View File

@ -74,13 +74,13 @@ DialogLineIntersect::DialogLineIntersect(const VContainer *data, const quint32 &
FillComboBoxPoints(ui->comboBoxP2Line2); FillComboBoxPoints(ui->comboBoxP2Line2);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogLineIntersect::NamePointChanged); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogLineIntersect::NamePointChanged);
connect(ui->comboBoxP1Line1, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxP1Line1, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogLineIntersect::PointNameChanged); this, &DialogLineIntersect::PointNameChanged);
connect(ui->comboBoxP2Line1, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxP2Line1, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogLineIntersect::PointNameChanged); this, &DialogLineIntersect::PointNameChanged);
connect(ui->comboBoxP1Line2, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxP1Line2, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogLineIntersect::PointNameChanged); this, &DialogLineIntersect::PointNameChanged);
connect(ui->comboBoxP2Line2, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxP2Line2, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogLineIntersect::PointNameChanged); this, &DialogLineIntersect::PointNameChanged);
vis = new VisToolLineIntersect(data); vis = new VisToolLineIntersect(data);
@ -160,17 +160,13 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type)
{ {
this->setModal(true); this->setModal(true);
this->show(); this->show();
connect(ui->comboBoxP1Line1, connect(ui->comboBoxP1Line1, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
&DialogLineIntersect::PointChanged); &DialogLineIntersect::PointChanged);
connect(ui->comboBoxP2Line1, connect(ui->comboBoxP2Line1, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
&DialogLineIntersect::PointChanged); &DialogLineIntersect::PointChanged);
connect(ui->comboBoxP1Line2, connect(ui->comboBoxP1Line2, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
&DialogLineIntersect::PointChanged); &DialogLineIntersect::PointChanged);
connect(ui->comboBoxP2Line2, connect(ui->comboBoxP2Line2, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
&DialogLineIntersect::PointChanged); &DialogLineIntersect::PointChanged);
} }
} }

View File

@ -91,13 +91,11 @@ DialogLineIntersectAxis::DialogLineIntersectAxis(const VContainer *data, const q
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogLineIntersectAxis::AngleTextChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogLineIntersectAxis::AngleTextChanged);
connect(ui->pushButtonGrowLengthAngle, &QPushButton::clicked, this, &DialogLineIntersectAxis::DeployAngleTextEdit); connect(ui->pushButtonGrowLengthAngle, &QPushButton::clicked, this, &DialogLineIntersectAxis::DeployAngleTextEdit);
connect(timerFormula, &QTimer::timeout, this, &DialogLineIntersectAxis::EvalAngle); connect(timerFormula, &QTimer::timeout, this, &DialogLineIntersectAxis::EvalAngle);
connect(ui->comboBoxFirstLinePoint, connect(ui->comboBoxFirstLinePoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &DialogLineIntersectAxis::PointNameChanged); this, &DialogLineIntersectAxis::PointNameChanged);
connect(ui->comboBoxSecondLinePoint, connect(ui->comboBoxSecondLinePoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &DialogLineIntersectAxis::PointNameChanged); this, &DialogLineIntersectAxis::PointNameChanged);
connect(ui->comboBoxAxisPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxAxisPoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogLineIntersectAxis::PointNameChanged); this, &DialogLineIntersectAxis::PointNameChanged);
vis = new VisToolLineIntersectAxis(data); vis = new VisToolLineIntersectAxis(data);

View File

@ -84,9 +84,9 @@ DialogNormal::DialogNormal(const VContainer *data, const quint32 &toolId, QWidge
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogNormal::NamePointChanged); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogNormal::NamePointChanged);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogNormal::FormulaTextChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogNormal::FormulaTextChanged);
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogNormal::DeployFormulaTextEdit); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogNormal::DeployFormulaTextEdit);
connect(ui->comboBoxFirstPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxFirstPoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogNormal::PointNameChanged); this, &DialogNormal::PointNameChanged);
connect(ui->comboBoxSecondPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxSecondPoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogNormal::PointNameChanged); this, &DialogNormal::PointNameChanged);
vis = new VisToolNormal(data); vis = new VisToolNormal(data);

View File

@ -79,8 +79,7 @@ DialogPointFromCircleAndTangent::DialogPointFromCircleAndTangent(const VContaine
FillComboBoxCrossCirclesPoints(ui->comboBoxResult); FillComboBoxCrossCirclesPoints(ui->comboBoxResult);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointFromCircleAndTangent::NamePointChanged); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointFromCircleAndTangent::NamePointChanged);
connect(ui->comboBoxCircleCenter, connect(ui->comboBoxCircleCenter, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &DialogPointFromCircleAndTangent::PointChanged); this, &DialogPointFromCircleAndTangent::PointChanged);
connect(ui->toolButtonExprRadius, &QPushButton::clicked, this, connect(ui->toolButtonExprRadius, &QPushButton::clicked, this,

View File

@ -80,11 +80,11 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, const quint32
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointOfContact::NamePointChanged); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointOfContact::NamePointChanged);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogPointOfContact::FormulaTextChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogPointOfContact::FormulaTextChanged);
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogPointOfContact::DeployFormulaTextEdit); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogPointOfContact::DeployFormulaTextEdit);
connect(ui->comboBoxFirstPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxFirstPoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogPointOfContact::PointNameChanged); this, &DialogPointOfContact::PointNameChanged);
connect(ui->comboBoxSecondPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxSecondPoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogPointOfContact::PointNameChanged); this, &DialogPointOfContact::PointNameChanged);
connect(ui->comboBoxCenter, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxCenter, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogPointOfContact::PointNameChanged); this, &DialogPointOfContact::PointNameChanged);
vis = new VisToolPointOfContact(data); vis = new VisToolPointOfContact(data);

View File

@ -65,9 +65,9 @@ DialogPointOfIntersection::DialogPointOfIntersection(const VContainer *data, con
FillComboBoxPoints(ui->comboBoxSecondPoint); FillComboBoxPoints(ui->comboBoxSecondPoint);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointOfIntersection::NamePointChanged); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointOfIntersection::NamePointChanged);
connect(ui->comboBoxFirstPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxFirstPoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogPointOfIntersection::PointNameChanged); this, &DialogPointOfIntersection::PointNameChanged);
connect(ui->comboBoxSecondPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxSecondPoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogPointOfIntersection::PointNameChanged); this, &DialogPointOfIntersection::PointNameChanged);
vis = new VisToolPointOfIntersection(data); vis = new VisToolPointOfIntersection(data);

View File

@ -60,9 +60,9 @@ DialogPointOfIntersectionArcs::DialogPointOfIntersectionArcs(const VContainer *d
FillComboBoxCrossCirclesPoints(ui->comboBoxResult); FillComboBoxCrossCirclesPoints(ui->comboBoxResult);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointOfIntersectionArcs::NamePointChanged); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointOfIntersectionArcs::NamePointChanged);
connect(ui->comboBoxArc1, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxArc1, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogPointOfIntersectionArcs::ArcChanged); this, &DialogPointOfIntersectionArcs::ArcChanged);
connect(ui->comboBoxArc1, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxArc1, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogPointOfIntersectionArcs::ArcChanged); this, &DialogPointOfIntersectionArcs::ArcChanged);
vis = new VisToolPointOfIntersectionArcs(data); vis = new VisToolPointOfIntersectionArcs(data);

View File

@ -85,11 +85,9 @@ DialogPointOfIntersectionCircles::DialogPointOfIntersectionCircles(const VContai
FillComboBoxCrossCirclesPoints(ui->comboBoxResult); FillComboBoxCrossCirclesPoints(ui->comboBoxResult);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointOfIntersectionCircles::NamePointChanged); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointOfIntersectionCircles::NamePointChanged);
connect(ui->comboBoxCircle1Center, connect(ui->comboBoxCircle1Center, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &DialogPointOfIntersectionCircles::PointChanged); this, &DialogPointOfIntersectionCircles::PointChanged);
connect(ui->comboBoxCircle2Center, connect(ui->comboBoxCircle2Center, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &DialogPointOfIntersectionCircles::PointChanged); this, &DialogPointOfIntersectionCircles::PointChanged);
connect(ui->toolButtonExprCircle1Radius, &QPushButton::clicked, this, connect(ui->toolButtonExprCircle1Radius, &QPushButton::clicked, this,

View File

@ -63,9 +63,9 @@ DialogPointOfIntersectionCurves::DialogPointOfIntersectionCurves(const VContaine
FillComboBoxHCrossCurvesPoint(ui->comboBoxHCorrection); FillComboBoxHCrossCurvesPoint(ui->comboBoxHCorrection);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointOfIntersectionCurves::NamePointChanged); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointOfIntersectionCurves::NamePointChanged);
connect(ui->comboBoxCurve1, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxCurve1, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogPointOfIntersectionCurves::CurveChanged); this, &DialogPointOfIntersectionCurves::CurveChanged);
connect(ui->comboBoxCurve2, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxCurve2, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogPointOfIntersectionCurves::CurveChanged); this, &DialogPointOfIntersectionCurves::CurveChanged);
vis = new VisToolPointOfIntersectionCurves(data); vis = new VisToolPointOfIntersectionCurves(data);

View File

@ -97,7 +97,7 @@ DialogRotation::DialogRotation(const VContainer *data, const quint32 &toolId, QW
connect(ui->toolButtonExprAngle, &QPushButton::clicked, this, &DialogRotation::FXAngle); connect(ui->toolButtonExprAngle, &QPushButton::clicked, this, &DialogRotation::FXAngle);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogRotation::AngleChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogRotation::AngleChanged);
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogRotation::DeployAngleTextEdit); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogRotation::DeployAngleTextEdit);
connect(ui->comboBoxOriginPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxOriginPoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogRotation::PointChanged); this, &DialogRotation::PointChanged);
vis = new VisToolRotation(data); vis = new VisToolRotation(data);

View File

@ -84,11 +84,11 @@ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, const quint32 &
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogShoulderPoint::NamePointChanged); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogShoulderPoint::NamePointChanged);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogShoulderPoint::FormulaTextChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogShoulderPoint::FormulaTextChanged);
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogShoulderPoint::DeployFormulaTextEdit); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogShoulderPoint::DeployFormulaTextEdit);
connect(ui->comboBoxP1Line, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxP1Line, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogShoulderPoint::PointNameChanged); this, &DialogShoulderPoint::PointNameChanged);
connect(ui->comboBoxP2Line, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxP2Line, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogShoulderPoint::PointNameChanged); this, &DialogShoulderPoint::PointNameChanged);
connect(ui->comboBoxP3, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxP3, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogShoulderPoint::PointNameChanged); this, &DialogShoulderPoint::PointNameChanged);
vis = new VisToolShoulderPoint(data); vis = new VisToolShoulderPoint(data);

View File

@ -111,9 +111,9 @@ DialogSpline::DialogSpline(const VContainer *data, const quint32 &toolId, QWidge
CheckState(); CheckState();
connect(ui->comboBoxP1, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxP1, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogSpline::PointNameChanged); this, &DialogSpline::PointNameChanged);
connect(ui->comboBoxP4, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxP4, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogSpline::PointNameChanged); this, &DialogSpline::PointNameChanged);
connect(ui->toolButtonExprAngle1, &QPushButton::clicked, this, &DialogSpline::FXAngle1); connect(ui->toolButtonExprAngle1, &QPushButton::clicked, this, &DialogSpline::FXAngle1);

View File

@ -108,7 +108,7 @@ DialogSplinePath::DialogSplinePath(const VContainer *data, const quint32 &toolId
ui->doubleSpinBoxApproximationScale->setMaximum(maxCurveApproximationScale); ui->doubleSpinBoxApproximationScale->setMaximum(maxCurveApproximationScale);
connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogSplinePath::PointChanged); connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogSplinePath::PointChanged);
connect(ui->comboBoxPoint, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxPoint, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &DialogSplinePath::currentPointChanged); this, &DialogSplinePath::currentPointChanged);
connect(ui->toolButtonExprAngle1, &QPushButton::clicked, this, &DialogSplinePath::FXAngle1); connect(ui->toolButtonExprAngle1, &QPushButton::clicked, this, &DialogSplinePath::FXAngle1);

View File

@ -67,13 +67,13 @@ DialogTriangle::DialogTriangle(const VContainer *data, const quint32 &toolId, QW
FillComboBoxPoints(ui->comboBoxSecondPoint); FillComboBoxPoints(ui->comboBoxSecondPoint);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogTriangle::NamePointChanged); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogTriangle::NamePointChanged);
connect(ui->comboBoxFirstPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxFirstPoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogTriangle::PointNameChanged); this, &DialogTriangle::PointNameChanged);
connect(ui->comboBoxSecondPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxSecondPoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogTriangle::PointNameChanged); this, &DialogTriangle::PointNameChanged);
connect(ui->comboBoxAxisP1, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxAxisP1, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogTriangle::PointNameChanged); this, &DialogTriangle::PointNameChanged);
connect(ui->comboBoxAxisP2, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxAxisP2, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
this, &DialogTriangle::PointNameChanged); this, &DialogTriangle::PointNameChanged);
vis = new VisToolTriangle(data); vis = new VisToolTriangle(data);

View File

@ -71,20 +71,15 @@ DialogTrueDarts::DialogTrueDarts(const VContainer *data, const quint32 &toolId,
connect(ui->lineEditFirstNewDartPoint, &QLineEdit::textChanged, this, &DialogTrueDarts::NameDartPoint1Changed); connect(ui->lineEditFirstNewDartPoint, &QLineEdit::textChanged, this, &DialogTrueDarts::NameDartPoint1Changed);
connect(ui->lineEditSecondNewDartPoint, &QLineEdit::textChanged, this, &DialogTrueDarts::NameDartPoint2Changed); connect(ui->lineEditSecondNewDartPoint, &QLineEdit::textChanged, this, &DialogTrueDarts::NameDartPoint2Changed);
connect(ui->comboBoxFirstBasePoint, connect(ui->comboBoxFirstBasePoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &DialogTrueDarts::PointNameChanged); this, &DialogTrueDarts::PointNameChanged);
connect(ui->comboBoxSecondBasePoint, connect(ui->comboBoxSecondBasePoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &DialogTrueDarts::PointNameChanged); this, &DialogTrueDarts::PointNameChanged);
connect(ui->comboBoxFirstDartPoint, connect(ui->comboBoxFirstDartPoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &DialogTrueDarts::PointNameChanged); this, &DialogTrueDarts::PointNameChanged);
connect(ui->comboBoxSecondDartPoint, connect(ui->comboBoxSecondDartPoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &DialogTrueDarts::PointNameChanged); this, &DialogTrueDarts::PointNameChanged);
connect(ui->comboBoxThirdDartPoint, connect(ui->comboBoxThirdDartPoint, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &DialogTrueDarts::PointNameChanged); this, &DialogTrueDarts::PointNameChanged);
vis = new VisToolTrueDarts(data); vis = new VisToolTrueDarts(data);

View File

@ -43,7 +43,7 @@ DialogInsertNode::DialogInsertNode(const VContainer *data, quint32 toolId, QWidg
CheckPieces(); CheckPieces();
CheckItem(); CheckItem();
connect(ui->comboBoxPiece, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this]() connect(ui->comboBoxPiece, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this]()
{ {
CheckPieces(); CheckPieces();
}); });

View File

@ -74,7 +74,7 @@ DialogPiecePath::DialogPiecePath(const VContainer *data, quint32 toolId, QWidget
ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabSeamAllowance)); ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabSeamAllowance));
ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabPassmarks)); ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabPassmarks));
connect(ui->comboBoxPiece, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this]() connect(ui->comboBoxPiece, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this]()
{ {
ValidObjects(PathIsValid()); ValidObjects(PathIsValid());
}); });
@ -792,7 +792,7 @@ void DialogPiecePath::InitPathTab()
connect(ui->lineEditName, &QLineEdit::textChanged, this, &DialogPiecePath::NameChanged); connect(ui->lineEditName, &QLineEdit::textChanged, this, &DialogPiecePath::NameChanged);
InitPathTypes(); InitPathTypes();
connect(ui->comboBoxType, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxType, QOverload<int>::of(&QComboBox::currentIndexChanged),
[this]() [this]()
{ {
ui->comboBoxPenType->setEnabled(GetType() == PiecePathType::InternalPath); ui->comboBoxPenType->setEnabled(GetType() == PiecePathType::InternalPath);
@ -826,14 +826,14 @@ void DialogPiecePath::InitSeamAllowanceTab()
ui->plainTextEditFormulaWidth->setPlainText(qApp->LocaleToString(m_saWidth)); ui->plainTextEditFormulaWidth->setPlainText(qApp->LocaleToString(m_saWidth));
InitNodesList(); InitNodesList();
connect(ui->comboBoxNodes, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, connect(ui->comboBoxNodes, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&DialogPiecePath::NodeChanged); &DialogPiecePath::NodeChanged);
connect(ui->pushButtonDefBefore, &QPushButton::clicked, this, &DialogPiecePath::ReturnDefBefore); connect(ui->pushButtonDefBefore, &QPushButton::clicked, this, &DialogPiecePath::ReturnDefBefore);
connect(ui->pushButtonDefAfter, &QPushButton::clicked, this, &DialogPiecePath::ReturnDefAfter); connect(ui->pushButtonDefAfter, &QPushButton::clicked, this, &DialogPiecePath::ReturnDefAfter);
InitNodeAngles(ui->comboBoxAngle); InitNodeAngles(ui->comboBoxAngle);
connect(ui->comboBoxAngle, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, connect(ui->comboBoxAngle, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&DialogPiecePath::NodeAngleChanged); &DialogPiecePath::NodeAngleChanged);
connect(ui->toolButtonExprWidth, &QPushButton::clicked, this, &DialogPiecePath::FXWidth); connect(ui->toolButtonExprWidth, &QPushButton::clicked, this, &DialogPiecePath::FXWidth);
@ -857,12 +857,12 @@ void DialogPiecePath::InitSeamAllowanceTab()
void DialogPiecePath::InitPassmarksTab() void DialogPiecePath::InitPassmarksTab()
{ {
InitPassmarksList(); InitPassmarksList();
connect(ui->comboBoxPassmarks, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxPassmarks, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &DialogPiecePath::PassmarkChanged); this, &DialogPiecePath::PassmarkChanged);
connect(ui->buttonGroupMarkType, static_cast<void(QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), connect(ui->buttonGroupMarkType, QOverload<int>::of(&QButtonGroup::buttonClicked),
this, &DialogPiecePath::PassmarkLineTypeChanged); this, &DialogPiecePath::PassmarkLineTypeChanged);
connect(ui->buttonGroupAngleType, static_cast<void(QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), connect(ui->buttonGroupAngleType, QOverload<int>::of(&QButtonGroup::buttonClicked),
this, &DialogPiecePath::PassmarkAngleTypeChanged); this, &DialogPiecePath::PassmarkAngleTypeChanged);
} }

View File

@ -46,7 +46,7 @@ DialogPin::DialogPin(const VContainer *data, quint32 toolId, QWidget *parent)
flagError = false; flagError = false;
CheckState(); CheckState();
connect(ui->comboBoxPiece, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this]() connect(ui->comboBoxPiece, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this]()
{ {
CheckPieces(); CheckPieces();
}); });

View File

@ -89,7 +89,7 @@ DialogPlaceLabel::DialogPlaceLabel(const VContainer *data, quint32 toolId, QWidg
connect(timerHeight, &QTimer::timeout, this, &DialogPlaceLabel::EvalHeight); connect(timerHeight, &QTimer::timeout, this, &DialogPlaceLabel::EvalHeight);
connect(timerAngle, &QTimer::timeout, this, &DialogPlaceLabel::EvalAngle); connect(timerAngle, &QTimer::timeout, this, &DialogPlaceLabel::EvalAngle);
connect(ui->comboBoxPiece, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this]() connect(ui->comboBoxPiece, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this]()
{ {
CheckPieces(); CheckPieces();
}); });

View File

@ -2670,14 +2670,14 @@ void DialogSeamAllowance::InitSeamAllowanceTab()
uiTabPaths->plainTextEditFormulaWidth->setPlainText(qApp->LocaleToString(m_saWidth)); uiTabPaths->plainTextEditFormulaWidth->setPlainText(qApp->LocaleToString(m_saWidth));
InitNodesList(); InitNodesList();
connect(uiTabPaths->comboBoxNodes, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, connect(uiTabPaths->comboBoxNodes, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&DialogSeamAllowance::NodeChanged); &DialogSeamAllowance::NodeChanged);
connect(uiTabPaths->pushButtonDefBefore, &QPushButton::clicked, this, &DialogSeamAllowance::ReturnDefBefore); connect(uiTabPaths->pushButtonDefBefore, &QPushButton::clicked, this, &DialogSeamAllowance::ReturnDefBefore);
connect(uiTabPaths->pushButtonDefAfter, &QPushButton::clicked, this, &DialogSeamAllowance::ReturnDefAfter); connect(uiTabPaths->pushButtonDefAfter, &QPushButton::clicked, this, &DialogSeamAllowance::ReturnDefAfter);
InitNodeAngles(uiTabPaths->comboBoxAngle); InitNodeAngles(uiTabPaths->comboBoxAngle);
connect(uiTabPaths->comboBoxAngle, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, connect(uiTabPaths->comboBoxAngle, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&DialogSeamAllowance::NodeAngleChanged); &DialogSeamAllowance::NodeAngleChanged);
uiTabPaths->listWidgetCustomSA->setContextMenuPolicy(Qt::CustomContextMenu); uiTabPaths->listWidgetCustomSA->setContextMenuPolicy(Qt::CustomContextMenu);
@ -2685,11 +2685,11 @@ void DialogSeamAllowance::InitSeamAllowanceTab()
&DialogSeamAllowance::ShowCustomSAContextMenu); &DialogSeamAllowance::ShowCustomSAContextMenu);
connect(uiTabPaths->listWidgetCustomSA, &QListWidget::currentRowChanged, this, connect(uiTabPaths->listWidgetCustomSA, &QListWidget::currentRowChanged, this,
&DialogSeamAllowance::CustomSAChanged); &DialogSeamAllowance::CustomSAChanged);
connect(uiTabPaths->comboBoxStartPoint, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), connect(uiTabPaths->comboBoxStartPoint, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &DialogSeamAllowance::CSAStartPointChanged); this, &DialogSeamAllowance::CSAStartPointChanged);
connect(uiTabPaths->comboBoxEndPoint, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, connect(uiTabPaths->comboBoxEndPoint, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&DialogSeamAllowance::CSAEndPointChanged); &DialogSeamAllowance::CSAEndPointChanged);
connect(uiTabPaths->comboBoxIncludeType, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), connect(uiTabPaths->comboBoxIncludeType, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &DialogSeamAllowance::CSAIncludeTypeChanged); this, &DialogSeamAllowance::CSAIncludeTypeChanged);
connect(uiTabPaths->toolButtonExprWidth, &QPushButton::clicked, this, &DialogSeamAllowance::FXWidth); connect(uiTabPaths->toolButtonExprWidth, &QPushButton::clicked, this, &DialogSeamAllowance::FXWidth);
@ -2804,11 +2804,9 @@ void DialogSeamAllowance::InitLabelsTab()
InitPinPoint(uiTabLabels->comboBoxDLTopLeftPin); InitPinPoint(uiTabLabels->comboBoxDLTopLeftPin);
InitPinPoint(uiTabLabels->comboBoxDLBottomRightPin); InitPinPoint(uiTabLabels->comboBoxDLBottomRightPin);
connect(uiTabLabels->comboBoxDLTopLeftPin, connect(uiTabLabels->comboBoxDLTopLeftPin, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &DialogSeamAllowance::DetailPinPointChanged); this, &DialogSeamAllowance::DetailPinPointChanged);
connect(uiTabLabels->comboBoxDLBottomRightPin, connect(uiTabLabels->comboBoxDLBottomRightPin, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &DialogSeamAllowance::DetailPinPointChanged); this, &DialogSeamAllowance::DetailPinPointChanged);
connect(uiTabLabels->pushButtonDLWidth, &QPushButton::clicked, this, &DialogSeamAllowance::EditDLFormula); connect(uiTabLabels->pushButtonDLWidth, &QPushButton::clicked, this, &DialogSeamAllowance::EditDLFormula);
@ -2837,11 +2835,9 @@ void DialogSeamAllowance::InitLabelsTab()
InitPinPoint(uiTabLabels->comboBoxPLTopLeftPin); InitPinPoint(uiTabLabels->comboBoxPLTopLeftPin);
InitPinPoint(uiTabLabels->comboBoxPLBottomRightPin); InitPinPoint(uiTabLabels->comboBoxPLBottomRightPin);
connect(uiTabLabels->comboBoxPLTopLeftPin, connect(uiTabLabels->comboBoxPLTopLeftPin, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &DialogSeamAllowance::PatternPinPointChanged); this, &DialogSeamAllowance::PatternPinPointChanged);
connect(uiTabLabels->comboBoxPLBottomRightPin, connect(uiTabLabels->comboBoxPLBottomRightPin, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &DialogSeamAllowance::PatternPinPointChanged); this, &DialogSeamAllowance::PatternPinPointChanged);
connect(uiTabLabels->pushButtonPLWidth, &QPushButton::clicked, this, &DialogSeamAllowance::EditPLFormula); connect(uiTabLabels->pushButtonPLWidth, &QPushButton::clicked, this, &DialogSeamAllowance::EditPLFormula);
@ -2891,11 +2887,9 @@ void DialogSeamAllowance::InitGrainlineTab()
InitPinPoint(uiTabGrainline->comboBoxGrainlineTopPin); InitPinPoint(uiTabGrainline->comboBoxGrainlineTopPin);
InitPinPoint(uiTabGrainline->comboBoxGrainlineBottomPin); InitPinPoint(uiTabGrainline->comboBoxGrainlineBottomPin);
connect(uiTabGrainline->comboBoxGrainlineTopPin, connect(uiTabGrainline->comboBoxGrainlineTopPin, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &DialogSeamAllowance::GrainlinePinPointChanged); this, &DialogSeamAllowance::GrainlinePinPointChanged);
connect(uiTabGrainline->comboBoxGrainlineBottomPin, connect(uiTabGrainline->comboBoxGrainlineBottomPin, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &DialogSeamAllowance::GrainlinePinPointChanged); this, &DialogSeamAllowance::GrainlinePinPointChanged);
} }
@ -2911,12 +2905,12 @@ void DialogSeamAllowance::InitPinsTab()
void DialogSeamAllowance::InitPassmarksTab() void DialogSeamAllowance::InitPassmarksTab()
{ {
InitPassmarksList(); InitPassmarksList();
connect(uiTabPassmarks->comboBoxPassmarks, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), connect(uiTabPassmarks->comboBoxPassmarks, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &DialogSeamAllowance::PassmarkChanged); this, &DialogSeamAllowance::PassmarkChanged);
connect(uiTabPassmarks->buttonGroupLineType, static_cast<void(QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), connect(uiTabPassmarks->buttonGroupLineType, QOverload<int>::of(&QButtonGroup::buttonClicked),
this, &DialogSeamAllowance::PassmarkLineTypeChanged); this, &DialogSeamAllowance::PassmarkLineTypeChanged);
connect(uiTabPassmarks->buttonGroupAngleType, static_cast<void(QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), connect(uiTabPassmarks->buttonGroupAngleType, QOverload<int>::of(&QButtonGroup::buttonClicked),
this, &DialogSeamAllowance::PassmarkAngleTypeChanged); this, &DialogSeamAllowance::PassmarkAngleTypeChanged);
connect(uiTabPassmarks->checkBoxShowSecondPassmark, &QCheckBox::stateChanged, this, connect(uiTabPassmarks->checkBoxShowSecondPassmark, &QCheckBox::stateChanged, this,
&DialogSeamAllowance::PassmarkShowSecondChanged); &DialogSeamAllowance::PassmarkShowSecondChanged);