From 7000eecf97ede3e9b010aa6e06455dccdee321e6 Mon Sep 17 00:00:00 2001 From: Leonardo Zide Date: Thu, 23 Apr 2026 22:34:59 -0700 Subject: [PATCH] Updated connect calls from macros to pointers. --- common/lc_blenderpreferences.cpp | 118 +++++++++++++++--------------- common/lc_blenderpreferences.h | 4 +- common/lc_edgecolordialog.cpp | 36 ++++----- common/lc_http.cpp | 2 +- common/lc_instructionsdialog.cpp | 12 +-- common/lc_mainwindow.cpp | 34 ++++----- common/lc_partselectionwidget.cpp | 4 +- common/lc_previewwidget.cpp | 2 +- common/lc_timelinewidget.cpp | 6 +- common/lc_updatedialog.cpp | 2 +- qt/lc_renderdialog.cpp | 4 +- 11 files changed, 111 insertions(+), 113 deletions(-) diff --git a/common/lc_blenderpreferences.cpp b/common/lc_blenderpreferences.cpp index f7993363..7a400eb2 100644 --- a/common/lc_blenderpreferences.cpp +++ b/common/lc_blenderpreferences.cpp @@ -26,7 +26,6 @@ #include "lc_http.h" #include "lc_zipfile.h" #include "lc_file.h" -#include "lc_qutils.h" #include "project.h" #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) @@ -288,26 +287,26 @@ lcBlenderPreferencesDialog::lcBlenderPreferencesDialog(int Width, int Height, do mApplyButton->setToolTip(tr("Apply addon paths and settings preferences")); mApplyButton->setEnabled(false); ButtonBox->addButton(mApplyButton, QDialogButtonBox::ActionRole); - connect(mApplyButton,SIGNAL(clicked()), this, SLOT(accept())); + connect(mApplyButton, &QPushButton::clicked, this, &lcBlenderPreferencesDialog::accept); mPathsButton = new QPushButton(tr("Hide Paths"), ButtonBox); mPathsButton->setToolTip(tr("Hide addon path preferences dialog")); ButtonBox->addButton(mPathsButton,QDialogButtonBox::ActionRole); - connect(mPathsButton,SIGNAL(clicked()), this, SLOT(ShowPathsGroup())); + connect(mPathsButton, &QPushButton::clicked, this, &lcBlenderPreferencesDialog::ShowPathsGroup); mResetButton = new QPushButton(tr("Reset"), ButtonBox); mResetButton->setEnabled(false); mResetButton->setToolTip(tr("Reset addon paths and settings preferences")); ButtonBox->addButton(mResetButton,QDialogButtonBox::ActionRole); - connect(mResetButton,SIGNAL(clicked()), this, SLOT(ResetSettings())); + connect(mResetButton, &QPushButton::clicked, this, &lcBlenderPreferencesDialog::ResetSettings); ButtonBox->addButton(QDialogButtonBox::Cancel); - connect(ButtonBox,SIGNAL(rejected()), this, SLOT(reject())); + connect(ButtonBox, &QDialogButtonBox::rejected, this, &lcBlenderPreferencesDialog::reject); if (!QFileInfo(lcGetProfileString(LC_PROFILE_BLENDER_LDRAW_CONFIG_PATH)).isReadable() && !lcGetProfileString(LC_PROFILE_BLENDER_IMPORT_MODULE).isEmpty()) mApplyButton->setEnabled(true); - connect(mPreferences,SIGNAL(SettingChangedSig(bool)), this, SLOT(EnableButton(bool))); + connect(mPreferences, &lcBlenderPreferences::SettingChangedSig, this, &lcBlenderPreferencesDialog::EnableButton); Layout->addWidget(ButtonBox); @@ -440,12 +439,12 @@ lcBlenderPreferences::lcBlenderPreferences(int Width, int Height, double Scale, QLineEdit* PathLineEdit = new QLineEdit(BlenderExeBox); mExeGridLayout->addWidget(PathLineEdit,1,1); mPathLineEditList << PathLineEdit; - connect(PathLineEdit, SIGNAL(editingFinished()), this, SLOT(ConfigureBlenderAddon())); + connect(PathLineEdit, &QLineEdit::editingFinished, this, [this]() { ConfigureBlenderAddon(); }); QPushButton* PathBrowseButton = new QPushButton(tr("Browse..."), BlenderExeBox); mExeGridLayout->addWidget(PathBrowseButton,1,2); mPathBrowseButtonList << PathBrowseButton; - connect(PathBrowseButton, SIGNAL(clicked(bool)), this, SLOT(BrowseBlender(bool))); + connect(PathBrowseButton, &QPushButton::clicked, this, &lcBlenderPreferences::BrowseBlender); QGroupBox* BlenderAddonVersionBox = new QGroupBox(tr("%1 Blender LDraw Addon").arg(LC_PRODUCTNAME_STR),mContent); mForm->addRow(BlenderAddonVersionBox); @@ -475,13 +474,13 @@ lcBlenderPreferences::lcBlenderPreferences(int Width, int Height, double Scale, mAddonUpdateButton = new QPushButton(tr("Update"), BlenderAddonVersionBox); mAddonUpdateButton->setToolTip(tr("Update %1 Blender LDraw addon").arg(LC_PRODUCTNAME_STR)); mAddonGridLayout->addWidget(mAddonUpdateButton,1,2); - connect(mAddonUpdateButton, SIGNAL(clicked(bool)), this, SLOT(UpdateBlenderAddon())); + connect(mAddonUpdateButton, &QPushButton::clicked, this, &lcBlenderPreferences::UpdateBlenderAddon); mAddonStdOutButton = new QPushButton(tr("Output..."), BlenderAddonVersionBox); mAddonStdOutButton->setToolTip(tr("Open the standrd output log")); mAddonStdOutButton->setEnabled(false); mAddonGridLayout->addWidget(mAddonStdOutButton,1,3); - connect(mAddonStdOutButton, SIGNAL(clicked(bool)), this, SLOT(GetStandardOutput())); + connect(mAddonStdOutButton, &QPushButton::clicked, this, &lcBlenderPreferences::GetStandardOutput); mModulesBox = new QGroupBox(tr("Enabled Addon Modules"),mContent); QHBoxLayout* ModulesLayout = new QHBoxLayout(mModulesBox); @@ -491,12 +490,12 @@ lcBlenderPreferences::lcBlenderPreferences(int Width, int Height, double Scale, mImportActBox = new QCheckBox(tr("LDraw Import TN"),mModulesBox); mImportActBox->setToolTip(tr("Enable addon import module (adapted from LDraw Import by Toby Nelson) in Blender")); ModulesLayout->addWidget(mImportActBox); - connect(mImportActBox, SIGNAL(clicked(bool)), this, SLOT(EnableImportModule())); + connect(mImportActBox, &QCheckBox::clicked, this, &lcBlenderPreferences::EnableImportModule); mImportMMActBox = new QCheckBox(tr("LDraw Import MM"),mModulesBox); mImportMMActBox->setToolTip(tr("Enable addon import module (adapted from LDraw Import by Matthew Morrison) in Blender")); ModulesLayout->addWidget(mImportMMActBox); - connect(mImportMMActBox, SIGNAL(clicked(bool)), this, SLOT(EnableImportModule())); + connect(mImportMMActBox, &QCheckBox::clicked, this, &lcBlenderPreferences::EnableImportModule); mRenderActBox = new QCheckBox(tr("%1 Image Render").arg(LC_PRODUCTNAME_STR), mModulesBox); mRenderActBox->setToolTip(tr("Addon image render module in Blender")); @@ -658,8 +657,8 @@ void lcBlenderPreferences::InitPathsAndSettings() if (IsVisible) { - connect(PathBrowseButton, SIGNAL(clicked(bool)), this, SLOT (BrowseBlender(bool))); - connect(PathLineEdit, SIGNAL(editingFinished()), this, SLOT (PathChanged())); + connect(PathBrowseButton, &QPushButton::clicked, this, &lcBlenderPreferences::BrowseBlender); + connect(PathLineEdit, &QLineEdit::editingFinished, this, &lcBlenderPreferences::PathChanged); } } @@ -694,9 +693,9 @@ void lcBlenderPreferences::InitPathsAndSettings() CheckBox->setChecked(mBlenderSettings[LblIdx].value.toInt()); CheckBox->setToolTip(mBlenderSettings[LblIdx].tooltip); if (LblIdx == LBL_CROP_IMAGE) - connect(CheckBox, SIGNAL(toggled(bool)), this, SLOT (SetModelSize(bool))); + connect(CheckBox, &QCheckBox::toggled, this, &lcBlenderPreferences::SetModelSize); else - connect(CheckBox, SIGNAL(clicked()), this, SLOT (SettingChanged())); + connect(CheckBox, &QCheckBox::clicked, this, [this]() { SettingIndexChanged(); }); mCheckBoxList << CheckBox; mSettingsSubform->addRow(Label,CheckBox); } @@ -706,7 +705,7 @@ void lcBlenderPreferences::InitPathsAndSettings() LineEdit->setProperty("ControlID",QVariant(LblIdx)); if (LblIdx == LBL_IMAGE_WIDTH || LblIdx == LBL_IMAGE_HEIGHT) { - connect(LineEdit, SIGNAL(textChanged(const QString&)), this, SLOT (SizeChanged(const QString&))); + connect(LineEdit, &QLineEdit::textChanged, this, &lcBlenderPreferences::SizeChanged); LineEdit->setValidator(new QIntValidator(16, LC_RENDER_IMAGE_MAX_SIZE)); } else if(LblIdx == LBL_DEFAULT_COLOUR) @@ -714,7 +713,7 @@ void lcBlenderPreferences::InitPathsAndSettings() LineEdit->setReadOnly(true); LineEdit->setStyleSheet("Text-align:left"); mDefaultColourEditAction = LineEdit->addAction(QIcon(), QLineEdit::TrailingPosition); - connect(mDefaultColourEditAction, SIGNAL(triggered(bool)), this, SLOT (ColorButtonClicked(bool))); + connect(mDefaultColourEditAction, &QAction::triggered, this, &lcBlenderPreferences::ColorButtonClicked); } else { @@ -725,7 +724,7 @@ void lcBlenderPreferences::InitPathsAndSettings() LineEdit->setValidator(new QIntValidator(1,1000)); else LineEdit->setValidator(new QDoubleValidator(0.01,100.0,2)); - connect(LineEdit, SIGNAL(textEdited(const QString&)), this, SLOT (SettingChanged(const QString&))); + connect(LineEdit, &QLineEdit::textEdited, this, &lcBlenderPreferences::SettingTextChanged); } LineEdit->setToolTip(mBlenderSettings[LblIdx].tooltip); mLineEditList << LineEdit; @@ -747,9 +746,9 @@ void lcBlenderPreferences::InitPathsAndSettings() int CurrentIndex = int(ComboBox->findData(QVariant::fromValue(Value))); ComboBox->setCurrentIndex(CurrentIndex); if (LblIdx == LBL_COLOUR_SCHEME) - connect(ComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT (ValidateColourScheme(int))); + connect(ComboBox, qOverload(&QComboBox::currentIndexChanged), this, &lcBlenderPreferences::ValidateColourScheme); else - connect(ComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT (SettingChanged(int))); + connect(ComboBox, qOverload(&QComboBox::currentIndexChanged), this, &lcBlenderPreferences::SettingIndexChanged); mComboBoxList << ComboBox; ComboBoxItemsIndex++; mSettingsSubform->addRow(Label,ComboBox); @@ -807,8 +806,8 @@ void lcBlenderPreferences::InitPathsAndSettingsMM() if (IsVisible) { - connect(PathBrowseButton, SIGNAL(clicked(bool)), this, SLOT (BrowseBlender(bool))); - connect(PathLineEdit, SIGNAL(editingFinished()), this, SLOT (PathChanged())); + connect(PathBrowseButton, &QPushButton::clicked, this, &lcBlenderPreferences::BrowseBlender); + connect(PathLineEdit, &QLineEdit::editingFinished, this, &lcBlenderPreferences::PathChanged); } } @@ -843,9 +842,9 @@ void lcBlenderPreferences::InitPathsAndSettingsMM() CheckBox->setChecked(mBlenderSettingsMM[LblIdx].value.toInt()); CheckBox->setToolTip(mBlenderSettingsMM[LblIdx].tooltip); if (LblIdx == LBL_CROP_IMAGE_MM) - connect(CheckBox, SIGNAL(toggled(bool)), this, SLOT (SetModelSize(bool))); + connect(CheckBox, &QCheckBox::toggled, this, &lcBlenderPreferences::SetModelSize); else - connect(CheckBox, SIGNAL(clicked()), this, SLOT (SettingChanged())); + connect(CheckBox, &QCheckBox::clicked, this, [this]() { SettingIndexChanged(); }); mCheckBoxList << CheckBox; mSettingsSubform->addRow(Label,CheckBox); } @@ -855,7 +854,7 @@ void lcBlenderPreferences::InitPathsAndSettingsMM() LineEdit->setProperty("ControlID",QVariant(LblIdx)); if (LblIdx == LBL_RESOLUTION_WIDTH || LblIdx == LBL_RESOLUTION_HEIGHT) { - connect(LineEdit, SIGNAL(textChanged(const QString&)), this, SLOT (SizeChanged(const QString&))); + connect(LineEdit, &QLineEdit::textChanged, this, &lcBlenderPreferences::SizeChanged); LineEdit->setValidator(new QIntValidator(16, LC_RENDER_IMAGE_MAX_SIZE)); } else @@ -871,7 +870,7 @@ void lcBlenderPreferences::InitPathsAndSettingsMM() LineEdit->setValidator(new QDoubleValidator(0.0,10.0,1)); else LineEdit->setValidator(new QIntValidator(1, LC_RENDER_IMAGE_MAX_SIZE)); - connect(LineEdit, SIGNAL(textEdited(const QString&)), this, SLOT (SettingChanged(const QString&))); + connect(LineEdit, &QLineEdit::textEdited, this, &lcBlenderPreferences::SettingTextChanged); } LineEdit->setToolTip(mBlenderSettingsMM[LblIdx].tooltip); mLineEditList << LineEdit; @@ -891,9 +890,9 @@ void lcBlenderPreferences::InitPathsAndSettingsMM() int CurrentIndex = int(ComboBox->findData(QVariant::fromValue(Value))); ComboBox->setCurrentIndex(CurrentIndex); if (LblIdx == LBL_COLOUR_SCHEME_MM) - connect(ComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT (ValidateColourScheme(int))); + connect(ComboBox, qOverload(&QComboBox::currentIndexChanged), this, &lcBlenderPreferences::ValidateColourScheme); else - connect(ComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT (SettingChanged(int))); + connect(ComboBox, qOverload(&QComboBox::currentIndexChanged), this, &lcBlenderPreferences::SettingIndexChanged); mComboBoxList << ComboBox; ComboBoxItemsIndex++; mSettingsSubform->addRow(Label,ComboBox); @@ -912,12 +911,11 @@ void lcBlenderPreferences::UpdateBlenderAddon() { mAddonUpdateButton->setEnabled(false); - disconnect(mPathLineEditList[PATH_BLENDER], SIGNAL(editingFinished()), this, SLOT (ConfigureBlenderAddon())); + disconnect(mPathLineEditList[PATH_BLENDER], &QLineEdit::editingFinished, this, nullptr); - ConfigureBlenderAddon(sender() == mPathBrowseButtonList[PATH_BLENDER], - sender() == mAddonUpdateButton); + ConfigureBlenderAddon(sender() == mPathBrowseButtonList[PATH_BLENDER], sender() == mAddonUpdateButton); - connect(mPathLineEditList[PATH_BLENDER], SIGNAL(editingFinished()), this, SLOT (ConfigureBlenderAddon())); + connect(mPathLineEditList[PATH_BLENDER], &QLineEdit::editingFinished, this, [this]() { ConfigureBlenderAddon(); }); } void lcBlenderPreferences::ConfigureBlenderAddon(bool TestBlender, bool AddonUpdate, bool ModuleChange) @@ -986,7 +984,7 @@ void lcBlenderPreferences::ConfigureBlenderAddon(bool TestBlender, bool AddonUpd QString ProcessAction = tr("addon install"); if (Action == PR_INSTALL) { - connect(mProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(ReadStdOut())); + connect(mProcess, &QProcess::readyReadStandardOutput, this, [this]() { ReadStdOut(); }); const QString& LdrawLibPath = QFileInfo(lcGetProfileString(LC_PROFILE_PARTS_LIBRARY)).absolutePath(); QStringList SystemEnvironment = QProcess::systemEnvironment(); SystemEnvironment.prepend("LDRAW_DIRECTORY=" + LdrawLibPath); @@ -996,7 +994,7 @@ void lcBlenderPreferences::ConfigureBlenderAddon(bool TestBlender, bool AddonUpd else { ProcessAction = tr("test"); - disconnect(&mUpdateTimer, SIGNAL(timeout()), this, SLOT(Update())); + disconnect(&mUpdateTimer, &QTimer::timeout, this, &lcBlenderPreferences::Update); } mProcess->setWorkingDirectory(BlenderDir); @@ -1040,7 +1038,7 @@ void lcBlenderPreferences::ConfigureBlenderAddon(bool TestBlender, bool AddonUpd while (QTime::currentTime() < Waiting) QCoreApplication::processEvents(QEventLoop::AllEvents, 100); } - connect(&mUpdateTimer, SIGNAL(timeout()), this, SLOT(Update())); + connect(&mUpdateTimer, &QTimer::timeout, this, &lcBlenderPreferences::Update); const QString StdOut = QString(mProcess->readAllStandardOutput()); if (!StdOut.contains(BlenderTestString)) { @@ -1075,7 +1073,7 @@ void lcBlenderPreferences::ConfigureBlenderAddon(bool TestBlender, bool AddonUpd return PR_OK; }; - connect(&mUpdateTimer, SIGNAL(timeout()), this, SLOT(Update())); + connect(&mUpdateTimer, &QTimer::timeout, this, &lcBlenderPreferences::Update); mUpdateTimer.start(500); QDir ConfigDir(BlenderConfigDir); @@ -1411,7 +1409,7 @@ int lcBlenderPreferences::GetBlenderAddon(const QString& BlenderDir) auto GetBlenderAddonVersionMatch = [&]() { lcHttpManager* HttpManager = new lcHttpManager(gAddonPreferences); - connect(HttpManager, SIGNAL(DownloadFinished(lcHttpReply*)), gAddonPreferences, SLOT(DownloadFinished(lcHttpReply*))); + connect(HttpManager, &lcHttpManager::DownloadFinished, gAddonPreferences, &lcBlenderPreferences::DownloadFinished); gAddonPreferences->mHttpReply = HttpManager->DownloadFile(QLatin1String(LC_BLENDER_ADDON_LATEST_URL)); while (gAddonPreferences->mHttpReply) QApplication::processEvents(); @@ -1549,7 +1547,7 @@ int lcBlenderPreferences::GetBlenderAddon(const QString& BlenderDir) BlenderAddonValidated = false; lcHttpManager* HttpManager = new lcHttpManager(gAddonPreferences); - connect(HttpManager, SIGNAL(DownloadFinished(lcHttpReply*)), gAddonPreferences, SLOT(DownloadFinished(lcHttpReply*))); + connect(HttpManager, &lcHttpManager::DownloadFinished, gAddonPreferences, &lcBlenderPreferences::DownloadFinished); gAddonPreferences->mHttpReply = HttpManager->DownloadFile(QLatin1String(LC_BLENDER_ADDON_URL)); while (gAddonPreferences->mHttpReply) QApplication::processEvents(); @@ -1761,7 +1759,7 @@ void lcBlenderPreferences::ShowResult() ShowMessage(this, Message); } -void lcBlenderPreferences::SettingChanged(const QString& Value) +void lcBlenderPreferences::SettingTextChanged(const QString& Value) { bool Change = false; @@ -1783,7 +1781,7 @@ void lcBlenderPreferences::SettingChanged(const QString& Value) } } -void lcBlenderPreferences::SettingChanged(int Index) +void lcBlenderPreferences::SettingIndexChanged(int Index) { int LblIdx = -1; bool Change = false; @@ -2371,8 +2369,8 @@ void lcBlenderPreferences::ResetSettings() QDialogButtonBox ButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, Dialog); Layout->addWidget(&ButtonBox); - connect(&ButtonBox, SIGNAL(accepted()), Dialog, SLOT(accept())); - connect(&ButtonBox, SIGNAL(rejected()), Dialog, SLOT(reject())); + connect(&ButtonBox, &QDialogButtonBox::accepted, Dialog, &QDialog::accept); + connect(&ButtonBox, &QDialogButtonBox::rejected, Dialog, &QDialog::reject); if (Dialog->exec() == QDialog::Accepted) { @@ -2395,8 +2393,8 @@ void lcBlenderPreferences::ResetSettings() if (mImportActBox->isChecked()) { - disconnect(mLineEditList[CTL_IMAGE_HEIGHT_EDIT], SIGNAL(textChanged(const QString&)), this, SLOT (SizeChanged(const QString&))); - disconnect(mLineEditList[CTL_IMAGE_WIDTH_EDIT], SIGNAL(textChanged(const QString&)), this, SLOT (SizeChanged(const QString&))); + disconnect(mLineEditList[CTL_IMAGE_HEIGHT_EDIT], &QLineEdit::textChanged, this, &lcBlenderPreferences::SizeChanged); + disconnect(mLineEditList[CTL_IMAGE_WIDTH_EDIT], &QLineEdit::textChanged, this, &lcBlenderPreferences::SizeChanged); for (int LblIdx = 0; LblIdx < NumSettings(); LblIdx++) { @@ -2442,13 +2440,13 @@ void lcBlenderPreferences::ResetSettings() mPathLineEditList[LblIdx]->setText(Paths[LblIdx].value); } - connect(mLineEditList[CTL_IMAGE_HEIGHT_EDIT],SIGNAL(textChanged(const QString&)), this, SLOT (SizeChanged(const QString&))); - connect(mLineEditList[CTL_IMAGE_WIDTH_EDIT], SIGNAL(textChanged(const QString&)), this, SLOT (SizeChanged(const QString&))); + connect(mLineEditList[CTL_IMAGE_HEIGHT_EDIT], &QLineEdit::textChanged, this, &lcBlenderPreferences::SizeChanged); + connect(mLineEditList[CTL_IMAGE_WIDTH_EDIT], &QLineEdit::textChanged, this, &lcBlenderPreferences::SizeChanged); } else if (mImportMMActBox->isChecked()) { - disconnect(mLineEditList[CTL_RESOLUTION_HEIGHT_EDIT], SIGNAL(textChanged(const QString&)), this, SLOT (SizeChanged(const QString&))); - disconnect(mLineEditList[CTL_RESOLUTION_WIDTH_EDIT], SIGNAL(textChanged(const QString&)), this, SLOT (SizeChanged(const QString&))); + disconnect(mLineEditList[CTL_RESOLUTION_HEIGHT_EDIT], &QLineEdit::textChanged, this, &lcBlenderPreferences::SizeChanged); + disconnect(mLineEditList[CTL_RESOLUTION_WIDTH_EDIT], &QLineEdit::textChanged, this, &lcBlenderPreferences::SizeChanged); for (int LblIdx = 0; LblIdx < NumSettingsMM(); LblIdx++) { @@ -2492,8 +2490,8 @@ void lcBlenderPreferences::ResetSettings() mPathLineEditList[LblIdx]->setText(Paths[LblIdx].value); } - connect(mLineEditList[CTL_RESOLUTION_HEIGHT_EDIT], SIGNAL(textChanged(const QString&)), this, SLOT (SizeChanged(const QString&))); - connect(mLineEditList[CTL_RESOLUTION_WIDTH_EDIT], SIGNAL(textChanged(const QString&)), this, SLOT (SizeChanged(const QString&))); + connect(mLineEditList[CTL_RESOLUTION_HEIGHT_EDIT], &QLineEdit::textChanged, this, &lcBlenderPreferences::SizeChanged); + connect(mLineEditList[CTL_RESOLUTION_WIDTH_EDIT], &QLineEdit::textChanged, this, &lcBlenderPreferences::SizeChanged); } emit SettingChangedSig(true); @@ -2900,7 +2898,7 @@ void lcBlenderPreferences::ColorButtonClicked(bool) QWidget* Parent = mLineEditList[CTL_DEFAULT_COLOUR_EDIT]; lcColorPickerPopup* Popup = new lcColorPickerPopup(Parent, ColorIndex); - connect(Popup, SIGNAL(selected(int)), SLOT(SetDefaultColor(int))); + connect(Popup, &lcColorPickerPopup::Selected, this, &lcBlenderPreferences::SetDefaultColor); Popup->setMinimumSize(300, 200); #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) @@ -3015,25 +3013,25 @@ void lcBlenderPreferences::SizeChanged(const QString& Value) { if (sender() == mLineEditList[Width_Edit]) { - disconnect(mLineEditList[Height_Edit],SIGNAL(textChanged(const QString&)), this, SLOT (SizeChanged(const QString&))); + disconnect(mLineEditList[Height_Edit], &QLineEdit::textChanged, this, &lcBlenderPreferences::SizeChanged); const QString Height = QString::number(qRound(double(mImageHeight * NewValue / mImageWidth))); mLineEditList[Height_Edit]->setText(Height); Change = Settings[Height_Edit].value != Height; - connect(mLineEditList[Height_Edit],SIGNAL(textChanged(const QString&)), this, SLOT (SizeChanged(const QString&))); + connect(mLineEditList[Height_Edit], &QLineEdit::textChanged, this, &lcBlenderPreferences::SizeChanged); } else if (sender() == mLineEditList[Height_Edit]) { - disconnect(mLineEditList[Width_Edit],SIGNAL(textChanged(const QString&)), this, SLOT (SizeChanged(const QString&))); + disconnect(mLineEditList[Width_Edit], &QLineEdit::textChanged, this, &lcBlenderPreferences::SizeChanged); const QString Width = QString::number(qRound(double(NewValue * mImageWidth / mImageHeight))); mLineEditList[Width_Edit]->setText(Width); Change = Settings[Height_Edit].value != Width; - connect(mLineEditList[Width_Edit],SIGNAL(textChanged(const QString&)), this, SLOT (SizeChanged(const QString&))); + connect(mLineEditList[Width_Edit], &QLineEdit::textChanged, this, &lcBlenderPreferences::SizeChanged); } // Change is provided here for consistency only as ImageWidth, @@ -3131,8 +3129,8 @@ void lcBlenderPreferences::SetModelSize(bool Update) } } - disconnect(mLineEditList[Width_Edit],SIGNAL(textChanged(const QString&)), this, SLOT (SizeChanged(const QString&))); - disconnect(mLineEditList[Height_Edit],SIGNAL(textChanged(const QString&)), this, SLOT (SizeChanged(const QString&))); + disconnect(mLineEditList[Width_Edit], &QLineEdit::textChanged, this, &lcBlenderPreferences::SizeChanged); + disconnect(mLineEditList[Height_Edit], &QLineEdit::textChanged, this, &lcBlenderPreferences::SizeChanged); const QString Width = QString::number(CropImage ? ImageWidth : mImageWidth); const QString Height = QString::number(CropImage ? ImageHeight : mImageHeight); @@ -3143,8 +3141,8 @@ void lcBlenderPreferences::SetModelSize(bool Update) if (Update) SettingsModified(true); - connect(mLineEditList[Height_Edit],SIGNAL(textChanged(const QString&)), this, SLOT (SizeChanged(const QString&))); - connect(mLineEditList[Width_Edit],SIGNAL(textChanged(const QString&)), this, SLOT (SizeChanged(const QString&))); + connect(mLineEditList[Height_Edit], &QLineEdit::textChanged, this, &lcBlenderPreferences::SizeChanged); + connect(mLineEditList[Width_Edit], &QLineEdit::textChanged, this, &lcBlenderPreferences::SizeChanged); } void lcBlenderPreferences::ValidateColourScheme(int Index) diff --git a/common/lc_blenderpreferences.h b/common/lc_blenderpreferences.h index 150bbb2f..47448d6e 100644 --- a/common/lc_blenderpreferences.h +++ b/common/lc_blenderpreferences.h @@ -105,8 +105,8 @@ private slots: void ColorButtonClicked(bool); void SetModelSize(bool = false); void ValidateColourScheme(int); - void SettingChanged(int = -1); - void SettingChanged(const QString&); + void SettingIndexChanged(int = -1); + void SettingTextChanged(const QString&); void PathChanged(); bool PromptAccept(); void Update(); diff --git a/common/lc_edgecolordialog.cpp b/common/lc_edgecolordialog.cpp index fc06d61b..a1a631f6 100644 --- a/common/lc_edgecolordialog.cpp +++ b/common/lc_edgecolordialog.cpp @@ -36,12 +36,12 @@ lcAutomateEdgeColorDialog::lcAutomateEdgeColorDialog(QWidget* Parent, bool ShowH PartEdgeContrastSlider->setRange(0, 100); PartEdgeContrastSlider->setValue(mPartEdgeContrast * 100); PartEdgeContrastSlider->setToolTip(tr("Set the amount of contrast - 0.50 is midway.")); - connect(PartEdgeContrastSlider, SIGNAL(valueChanged(int)), this, SLOT(SliderValueChanged(int))); + connect(PartEdgeContrastSlider, &QSlider::valueChanged, this, &lcAutomateEdgeColorDialog::SliderValueChanged); emit PartEdgeContrastSlider->valueChanged(PartEdgeContrastSlider->value()); ResetPartEdgeContrastButton = new QToolButton(this); ResetPartEdgeContrastButton->setText(tr("Reset")); - connect(ResetPartEdgeContrastButton, SIGNAL(clicked()), this, SLOT(ResetSliderButtonClicked())); + connect(ResetPartEdgeContrastButton, &QToolButton::clicked, this, &lcAutomateEdgeColorDialog::ResetSliderButtonClicked); EdgeSettingsLayout->addWidget(PartEdgeContrastLabel,0,0); EdgeSettingsLayout->addWidget(PartEdgeContrastSlider,0,1); @@ -57,12 +57,12 @@ lcAutomateEdgeColorDialog::lcAutomateEdgeColorDialog(QWidget* Parent, bool ShowH PartColorValueLDIndexSlider->setToolTip(ShowHighContrastDialog ? tr("Set to classify where color values are light or dark - e.g. Dark Bluish Gray (72) is light at 0.39.") : tr("Set to specify amount of edge color tint or shade from the saturation adjusted part color")); - connect(PartColorValueLDIndexSlider, SIGNAL(valueChanged(int)), this, SLOT(SliderValueChanged(int))); + connect(PartColorValueLDIndexSlider, &QSlider::valueChanged, this, &lcAutomateEdgeColorDialog::SliderValueChanged); emit PartColorValueLDIndexSlider->valueChanged(PartColorValueLDIndexSlider->value()); ResetPartColorValueLDIndexButton = new QToolButton(this); ResetPartColorValueLDIndexButton->setText(tr("Reset")); - connect(ResetPartColorValueLDIndexButton, SIGNAL(clicked()), this, SLOT(ResetSliderButtonClicked())); + connect(ResetPartColorValueLDIndexButton, &QToolButton::clicked, this, &lcAutomateEdgeColorDialog::ResetSliderButtonClicked); EdgeSettingsLayout->addWidget(PartColorValueLDIndexLabel,LDIndexRow,0); EdgeSettingsLayout->addWidget(PartColorValueLDIndexSlider,LDIndexRow,1); @@ -86,17 +86,17 @@ lcAutomateEdgeColorDialog::lcAutomateEdgeColorDialog(QWidget* Parent, bool ShowH StudCylinderColorEnabledBox = new QCheckBox(tr("Stud Cylinder Color:"), this); StudCylinderColorEnabledBox->setChecked(mStudCylinderColorEnabled); - connect(StudCylinderColorEnabledBox, SIGNAL(clicked()), this, SLOT(ColorCheckBoxClicked())); + connect(StudCylinderColorEnabledBox, &QCheckBox::clicked, this, &lcAutomateEdgeColorDialog::ColorCheckBoxClicked); StudCylinderColorButton = new QToolButton(this); StudCylinderColorButton->setEnabled(mStudCylinderColorEnabled); SetButtonPixmap(mStudCylinderColor, StudCylinderColorButton); - connect(StudCylinderColorButton, SIGNAL(clicked()), this, SLOT(ColorButtonClicked())); + connect(StudCylinderColorButton, &QToolButton::clicked, this, &lcAutomateEdgeColorDialog::ColorButtonClicked); ResetStudCylinderColorButton = new QToolButton(this); ResetStudCylinderColorButton->setText(tr("Reset")); ResetStudCylinderColorButton->setEnabled(mStudCylinderColorEnabled); - connect(ResetStudCylinderColorButton, SIGNAL(clicked()), this, SLOT(ResetColorButtonClicked())); + connect(ResetStudCylinderColorButton, &QToolButton::clicked, this, &lcAutomateEdgeColorDialog::ResetColorButtonClicked); HighContrastColorLayout->addWidget(StudCylinderColorEnabledBox,0,0); HighContrastColorLayout->addWidget(StudCylinderColorButton,0,1); @@ -104,17 +104,17 @@ lcAutomateEdgeColorDialog::lcAutomateEdgeColorDialog(QWidget* Parent, bool ShowH PartEdgeColorEnabledBox = new QCheckBox(tr("Parts Edge Color:"), this); PartEdgeColorEnabledBox->setChecked(mPartEdgeColorEnabled); - connect(PartEdgeColorEnabledBox, SIGNAL(clicked()), this, SLOT(ColorCheckBoxClicked())); + connect(PartEdgeColorEnabledBox, &QCheckBox::clicked, this, &lcAutomateEdgeColorDialog::ColorCheckBoxClicked); PartEdgeColorButton = new QToolButton(this); PartEdgeColorButton->setEnabled(mPartEdgeColorEnabled); SetButtonPixmap(mPartEdgeColor, PartEdgeColorButton); - connect(PartEdgeColorButton, SIGNAL(clicked()), this, SLOT(ColorButtonClicked())); + connect(PartEdgeColorButton, &QToolButton::clicked, this, &lcAutomateEdgeColorDialog::ColorButtonClicked); ResetPartEdgeColorButton = new QToolButton(this); ResetPartEdgeColorButton->setText(tr("Reset")); ResetPartEdgeColorButton->setEnabled(mPartEdgeColorEnabled); - connect(ResetPartEdgeColorButton, SIGNAL(clicked()), this, SLOT(ResetColorButtonClicked())); + connect(ResetPartEdgeColorButton, &QToolButton::clicked, this, &lcAutomateEdgeColorDialog::ResetColorButtonClicked); HighContrastColorLayout->addWidget(PartEdgeColorEnabledBox,1,0); HighContrastColorLayout->addWidget(PartEdgeColorButton,1,1); @@ -122,17 +122,17 @@ lcAutomateEdgeColorDialog::lcAutomateEdgeColorDialog(QWidget* Parent, bool ShowH BlackEdgeColorEnabledBox = new QCheckBox(tr("Black Parts Edge Color:"), this); BlackEdgeColorEnabledBox->setChecked(mBlackEdgeColorEnabled); - connect(BlackEdgeColorEnabledBox, SIGNAL(clicked()), this, SLOT(ColorCheckBoxClicked())); + connect(BlackEdgeColorEnabledBox, &QCheckBox::clicked, this, &lcAutomateEdgeColorDialog::ColorCheckBoxClicked); BlackEdgeColorButton = new QToolButton(this); BlackEdgeColorButton->setEnabled(mBlackEdgeColorEnabled); SetButtonPixmap(mBlackEdgeColor, BlackEdgeColorButton); - connect(BlackEdgeColorButton, SIGNAL(clicked()), this, SLOT(ColorButtonClicked())); + connect(BlackEdgeColorButton, &QToolButton::clicked, this, &lcAutomateEdgeColorDialog::ColorButtonClicked); ResetBlackEdgeColorButton = new QToolButton(this); ResetBlackEdgeColorButton->setText(tr("Reset")); ResetBlackEdgeColorButton->setEnabled(mBlackEdgeColorEnabled); - connect(ResetBlackEdgeColorButton, SIGNAL(clicked()), this, SLOT(ResetColorButtonClicked())); + connect(ResetBlackEdgeColorButton, &QToolButton::clicked, this, &lcAutomateEdgeColorDialog::ResetColorButtonClicked); HighContrastColorLayout->addWidget(BlackEdgeColorEnabledBox,2,0); HighContrastColorLayout->addWidget(BlackEdgeColorButton,2,1); @@ -140,17 +140,17 @@ lcAutomateEdgeColorDialog::lcAutomateEdgeColorDialog(QWidget* Parent, bool ShowH DarkEdgeColorEnabledBox = new QCheckBox(tr("Dark Parts Edge Color:"), this); DarkEdgeColorEnabledBox->setChecked(mDarkEdgeColorEnabled); - connect(DarkEdgeColorEnabledBox, SIGNAL(clicked()), this, SLOT(ColorCheckBoxClicked())); + connect(DarkEdgeColorEnabledBox, &QCheckBox::clicked, this, &lcAutomateEdgeColorDialog::ColorCheckBoxClicked); DarkEdgeColorButton = new QToolButton(this); DarkEdgeColorButton->setEnabled(mDarkEdgeColorEnabled); SetButtonPixmap(mDarkEdgeColor, DarkEdgeColorButton); - connect(DarkEdgeColorButton, SIGNAL(clicked()), this, SLOT(ColorButtonClicked())); + connect(DarkEdgeColorButton, &QToolButton::clicked, this, &lcAutomateEdgeColorDialog::ColorButtonClicked); ResetDarkEdgeColorButton = new QToolButton(this); ResetDarkEdgeColorButton->setText(tr("Reset")); ResetDarkEdgeColorButton->setEnabled(mDarkEdgeColorEnabled); - connect(ResetDarkEdgeColorButton, SIGNAL(clicked()), this, SLOT(ResetColorButtonClicked())); + connect(ResetDarkEdgeColorButton, &QToolButton::clicked, this, &lcAutomateEdgeColorDialog::ResetColorButtonClicked); HighContrastColorLayout->addWidget(DarkEdgeColorEnabledBox,3,0); HighContrastColorLayout->addWidget(DarkEdgeColorButton,3,1); @@ -158,8 +158,8 @@ lcAutomateEdgeColorDialog::lcAutomateEdgeColorDialog(QWidget* Parent, bool ShowH QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this); MainLayout->addWidget(buttonBox); - QObject::connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); - QObject::connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + QObject::connect(buttonBox, &QDialogButtonBox::accepted, this, &lcAutomateEdgeColorDialog::accept); + QObject::connect(buttonBox, &QDialogButtonBox::rejected, this, &lcAutomateEdgeColorDialog::reject); setMinimumSize(220,100); } diff --git a/common/lc_http.cpp b/common/lc_http.cpp index 7a6c6c44..6ee5f085 100644 --- a/common/lc_http.cpp +++ b/common/lc_http.cpp @@ -78,7 +78,7 @@ lcHttpReply* lcHttpManager::DownloadFile(const QString& Url) lcHttpManager::lcHttpManager(QObject* Owner) : QNetworkAccessManager(Owner) { - connect(this, SIGNAL(finished(QNetworkReply*)), this, SLOT(Finished(QNetworkReply*))); + connect(this, &QNetworkAccessManager::finished, this, &lcHttpManager::Finished); } lcHttpReply* lcHttpManager::lcHttpManager::DownloadFile(const QString& Url) diff --git a/common/lc_instructionsdialog.cpp b/common/lc_instructionsdialog.cpp index 2e9b5ec6..f6f315cf 100644 --- a/common/lc_instructionsdialog.cpp +++ b/common/lc_instructionsdialog.cpp @@ -189,7 +189,7 @@ lcInstructionsPageListWidget::lcInstructionsPageListWidget(QWidget* Parent, lcIn PageSetupButton->setText(tr("Page Setup")); ButtonsLayout->addWidget(PageSetupButton); - connect(PageSetupButton, SIGNAL(clicked()), this, SLOT(ShowPageSetupDialog())); + connect(PageSetupButton, &QToolButton::clicked, this, &lcInstructionsPageListWidget::ShowPageSetupDialog); ButtonsLayout->addStretch(1); @@ -570,14 +570,14 @@ lcInstructionsDialog::lcInstructionsDialog(QWidget* Parent, Project* Project) for (size_t PageNumber = 0; PageNumber < mInstructions->mPages.size(); PageNumber++) mPageListWidget->mThumbnailsWidget->addItem(QString(tr("Page %1")).arg(PageNumber + 1)); - connect(mPageListWidget->mThumbnailsWidget, SIGNAL(currentRowChanged(int)), this, SLOT(CurrentThumbnailChanged(int))); + connect(mPageListWidget->mThumbnailsWidget, &QListWidget::currentRowChanged, this, &lcInstructionsDialog::CurrentThumbnailChanged); mPageListWidget->mThumbnailsWidget->setCurrentRow(0); connect(mPrintAction, &QAction::triggered, this, &lcInstructionsDialog::ShowPrintDialog); - connect(mVerticalPageAction, SIGNAL(toggled(bool)), this, SLOT(UpdatePageSettings())); - connect(mHorizontalPageAction, SIGNAL(toggled(bool)), this, SLOT(UpdatePageSettings())); - connect(mRowsSpinBox, SIGNAL(valueChanged(int)), this, SLOT(UpdatePageSettings())); - connect(mColumnsSpinBox, SIGNAL(valueChanged(int)), this, SLOT(UpdatePageSettings())); + connect(mVerticalPageAction, &QAction::toggled, this, &lcInstructionsDialog::UpdatePageSettings); + connect(mHorizontalPageAction, &QAction::toggled, this, &lcInstructionsDialog::UpdatePageSettings); + connect(mRowsSpinBox, &QSpinBox::valueChanged, this, &lcInstructionsDialog::UpdatePageSettings); + connect(mColumnsSpinBox, &QSpinBox::valueChanged, this, &lcInstructionsDialog::UpdatePageSettings); } void lcInstructionsDialog::ShowPrintDialog() diff --git a/common/lc_mainwindow.cpp b/common/lc_mainwindow.cpp index ad639b54..99a4c471 100644 --- a/common/lc_mainwindow.cpp +++ b/common/lc_mainwindow.cpp @@ -115,11 +115,11 @@ void lcMainWindow::CreateWidgets() mModelTabWidget->tabBar()->setContextMenuPolicy(Qt::CustomContextMenu); setCentralWidget(mModelTabWidget); - connect(mModelTabWidget->tabBar(), SIGNAL(tabCloseRequested(int)), this, SLOT(ModelTabClosed(int))); - connect(mModelTabWidget->tabBar(), SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(ModelTabContextMenuRequested(const QPoint&))); - connect(mModelTabWidget, SIGNAL(currentChanged(int)), this, SLOT(ModelTabChanged(int))); + connect(mModelTabWidget->tabBar(), &QTabBar::tabCloseRequested, this, &lcMainWindow::ModelTabClosed); + connect(mModelTabWidget->tabBar(), &QTabBar::customContextMenuRequested, this, &lcMainWindow::ModelTabContextMenuRequested); + connect(mModelTabWidget, &QTabWidget::currentChanged, this, &lcMainWindow::ModelTabChanged); - connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(ClipboardChanged())); + connect(QApplication::clipboard(), &QClipboard::dataChanged, this, &lcMainWindow::ClipboardChanged); ClipboardChanged(); QSettings Settings; @@ -138,7 +138,7 @@ void lcMainWindow::CreateActions() { QAction* Action = new QAction(qApp->translate("Menu", gCommands[CommandIdx].MenuName), this); Action->setStatusTip(qApp->translate("Status", gCommands[CommandIdx].StatusText)); - connect(Action, SIGNAL(triggered()), this, SLOT(ActionTriggered())); + connect(Action, &QAction::triggered, this, &lcMainWindow::ActionTriggered); addAction(Action); mActions[CommandIdx] = Action; } @@ -541,7 +541,7 @@ void lcMainWindow::CreateMenus() ViewMenu->addAction(mActions[LC_VIEW_RESET_VIEWS]); ViewMenu->addSeparator(); QMenu* ToolBarsMenu = ViewMenu->addMenu(tr("T&oolbars")); - connect(ToolBarsMenu, SIGNAL(aboutToShow()), this, SLOT(UpdateDockWidgetActions())); + connect(ToolBarsMenu, &QMenu::aboutToShow, this, &lcMainWindow::UpdateDockWidgetActions); ToolBarsMenu->addAction(mActions[LC_VIEW_TOOLBAR_PARTS]); ToolBarsMenu->addAction(mActions[LC_VIEW_TOOLBAR_COLORS]); ToolBarsMenu->addAction(mActions[LC_VIEW_TOOLBAR_PROPERTIES]); @@ -736,7 +736,7 @@ void lcMainWindow::CreateToolBars() mColorButton->setToolTip(tr("Change Selection Color")); ColorButtonLayout->addWidget(mColorButton); - connect(mColorButton, SIGNAL(clicked()), this, SLOT(ColorButtonClicked())); + connect(mColorButton, &QToolButton::clicked, this, &lcMainWindow::ColorButtonClicked); ColorLayout->addWidget(mColorList); @@ -775,9 +775,9 @@ void lcMainWindow::CreateToolBars() PropertiesLayout->addWidget(TransformWidget); - connect(mTransformXEdit, SIGNAL(returnPressed()), mActions[LC_EDIT_TRANSFORM], SIGNAL(triggered())); - connect(mTransformYEdit, SIGNAL(returnPressed()), mActions[LC_EDIT_TRANSFORM], SIGNAL(triggered())); - connect(mTransformZEdit, SIGNAL(returnPressed()), mActions[LC_EDIT_TRANSFORM], SIGNAL(triggered())); + connect(mTransformXEdit, &QLineEdit::returnPressed, mActions[LC_EDIT_TRANSFORM], &QAction::trigger); + connect(mTransformYEdit, &QLineEdit::returnPressed, mActions[LC_EDIT_TRANSFORM], &QAction::trigger); + connect(mTransformZEdit, &QLineEdit::returnPressed, mActions[LC_EDIT_TRANSFORM], &QAction::trigger); mPropertiesToolBar->setWidget(PropertiesWidget); addDockWidget(Qt::RightDockWidgetArea, mPropertiesToolBar); @@ -797,10 +797,10 @@ void lcMainWindow::CreateToolBars() tabifyDockWidget(mPropertiesToolBar, mTimelineToolBar); tabifyDockWidget(mTimelineToolBar, mPreviewToolBar); - connect(mPropertiesToolBar, SIGNAL(topLevelChanged(bool)), this, SLOT(EnableWindowFlags(bool))); - connect(mTimelineToolBar, SIGNAL(topLevelChanged(bool)), this, SLOT(EnableWindowFlags(bool))); - connect(mPartsToolBar, SIGNAL(topLevelChanged(bool)), this, SLOT(EnableWindowFlags(bool))); - connect(mColorsToolBar, SIGNAL(topLevelChanged(bool)), this, SLOT(EnableWindowFlags(bool))); + connect(mPropertiesToolBar, &QDockWidget::topLevelChanged, this, &lcMainWindow::EnableWindowFlags); + connect(mTimelineToolBar, &QDockWidget::topLevelChanged, this, &lcMainWindow::EnableWindowFlags); + connect(mPartsToolBar, &QDockWidget::topLevelChanged, this, &lcMainWindow::EnableWindowFlags); + connect(mColorsToolBar, &QDockWidget::topLevelChanged, this, &lcMainWindow::EnableWindowFlags); mPartsToolBar->raise(); } @@ -809,7 +809,7 @@ lcView* lcMainWindow::CreateView(lcModel* Model) { lcView* NewView = new lcView(lcViewType::View, Model); - connect(NewView, SIGNAL(FocusReceived()), this, SLOT(ViewFocusReceived())); + connect(NewView, &lcView::FocusReceived, this, &lcMainWindow::ViewFocusReceived); AddView(NewView); @@ -834,7 +834,7 @@ void lcMainWindow::CreatePreviewWidget() mPreviewToolBar->setWidget(mPreviewWidget); addDockWidget(Qt::RightDockWidgetArea, mPreviewToolBar); - connect(mPreviewToolBar, SIGNAL(topLevelChanged(bool)), this, SLOT(EnableWindowFlags(bool))); + connect(mPreviewToolBar, &QDockWidget::topLevelChanged, this, &lcMainWindow::EnableWindowFlags); } void lcMainWindow::TogglePreviewWidget(bool Visible) @@ -1939,7 +1939,7 @@ void lcMainWindow::TogglePrintPreview() Printer.setFromTo(1, PageCount + 1); QPrintPreviewDialog Preview(&Printer, this); - connect(&Preview, SIGNAL(paintRequested(QPrinter*)), SLOT(Print(QPrinter*))); + connect(&Preview, &QPrintPreviewDialog::paintRequested, this, &lcMainWindow::Print); Preview.exec(); #endif } diff --git a/common/lc_partselectionwidget.cpp b/common/lc_partselectionwidget.cpp index 11e1bd48..13748cd6 100644 --- a/common/lc_partselectionwidget.cpp +++ b/common/lc_partselectionwidget.cpp @@ -865,7 +865,7 @@ lcPartSelectionWidget::lcPartSelectionWidget(QWidget* Parent) mFilterCaseAction->setToolTip(tr("Match Case")); mFilterCaseAction->setCheckable(true); mFilterCaseAction->setChecked(false); - connect(mFilterCaseAction, SIGNAL(triggered()), this, SLOT(FilterCaseTriggered())); + connect(mFilterCaseAction, &QAction::triggered, this, &lcPartSelectionWidget::FilterCaseTriggered); QToolButton* FilterCaseButton = new QToolButton(); FilterCaseButton->setDefaultAction(mFilterCaseAction); @@ -900,7 +900,7 @@ lcPartSelectionWidget::lcPartSelectionWidget(QWidget* Parent) QMenu* OptionsMenu = new QMenu(this); OptionsButton->setMenu(OptionsMenu); - connect(OptionsMenu, SIGNAL(aboutToShow()), this, SLOT(OptionsMenuAboutToShow())); + connect(OptionsMenu, &QMenu::aboutToShow, this, &lcPartSelectionWidget::OptionsMenuAboutToShow); mPartsWidget = new lcPartSelectionListView(PartsGroupWidget, this); PartsLayout->addWidget(mPartsWidget); diff --git a/common/lc_previewwidget.cpp b/common/lc_previewwidget.cpp index 5aa4607c..d2224084 100644 --- a/common/lc_previewwidget.cpp +++ b/common/lc_previewwidget.cpp @@ -20,7 +20,7 @@ lcPreviewDockWidget::lcPreviewDockWidget(QMainWindow* Parent) mLockAction->setCheckable(true); mLockAction->setChecked(false); mLockAction->setShortcut(tr("Ctrl+L")); - connect(mLockAction, SIGNAL(triggered()), this, SLOT(SetPreviewLock())); + connect(mLockAction, &QAction::triggered, this, &lcPreviewDockWidget::SetPreviewLock); SetPreviewLock(); mLabel = new QLabel(); diff --git a/common/lc_timelinewidget.cpp b/common/lc_timelinewidget.cpp index b87d64da..330e11d2 100644 --- a/common/lc_timelinewidget.cpp +++ b/common/lc_timelinewidget.cpp @@ -20,9 +20,9 @@ lcTimelineWidget::lcTimelineWidget(QWidget* Parent) invisibleRootItem()->setFlags(invisibleRootItem()->flags() & ~Qt::ItemIsDropEnabled); - connect(this, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), SLOT(CurrentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*))); - connect(this, SIGNAL(itemSelectionChanged()), SLOT(ItemSelectionChanged())); - connect(this, SIGNAL(customContextMenuRequested(QPoint)), SLOT(CustomMenuRequested(QPoint))); + connect(this, &QTreeWidget::currentItemChanged, this, &lcTimelineWidget::CurrentItemChanged); + connect(this, &QTreeWidget::itemSelectionChanged, this, &lcTimelineWidget::ItemSelectionChanged); + connect(this, &QWidget::customContextMenuRequested, this, &lcTimelineWidget::CustomMenuRequested); } lcTimelineWidget::~lcTimelineWidget() diff --git a/common/lc_updatedialog.cpp b/common/lc_updatedialog.cpp index 5e1b0dd5..c2231834 100644 --- a/common/lc_updatedialog.cpp +++ b/common/lc_updatedialog.cpp @@ -32,7 +32,7 @@ lcUpdateDialog::lcUpdateDialog(QWidget* Parent, bool InitialUpdate) { ui->setupUi(this); - connect(this, SIGNAL(finished(int)), this, SLOT(finished(int))); + connect(this, &QDialog::finished, this, &lcUpdateDialog::finished); ui->status->setText(tr("Connecting to update server...")); diff --git a/qt/lc_renderdialog.cpp b/qt/lc_renderdialog.cpp index 47835910..ffb39dda 100644 --- a/qt/lc_renderdialog.cpp +++ b/qt/lc_renderdialog.cpp @@ -333,7 +333,7 @@ void lcRenderDialog::RenderPOVRay() lcRenderProcess* Process = new lcRenderProcess(this); #ifdef Q_OS_LINUX - connect(Process, SIGNAL(readyReadStandardError()), this, SLOT(ReadStdErr())); + connect(Process, &QProcess::readyReadStandardError, this, &lcRenderDialog::ReadStdErr); #endif QStringList POVEnv = QProcess::systemEnvironment(); POVEnv.prepend("POV_IGNORE_SYSCONF_MSG=1"); @@ -469,7 +469,7 @@ void lcRenderDialog::RenderBlender() mProcess = new lcRenderProcess(this); - connect(mProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(ReadStdOut())); + connect(mProcess, &QProcess::readyReadStandardOutput, this, &lcRenderDialog::ReadStdOut); const QString LDrawLibPath = QFileInfo(lcGetProfileString(LC_PROFILE_PARTS_LIBRARY)).absolutePath(); QStringList SystemEnvironment = QProcess::systemEnvironment();