diff --git a/src/widgets/dprintpreviewdialog.cpp b/src/widgets/dprintpreviewdialog.cpp index 840bc60c4..813f99c12 100644 --- a/src/widgets/dprintpreviewdialog.cpp +++ b/src/widgets/dprintpreviewdialog.cpp @@ -1155,11 +1155,11 @@ void DPrintPreviewDialogPrivate::initconnections() } }); #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - QObject::connect(sidebysideCheckBox, &DCheckBox::checkStateChanged, q, [this](int status) { + QObject::connect(sidebysideCheckBox, &DCheckBox::checkStateChanged, q, [this](Qt::CheckState status) { #else QObject::connect(sidebysideCheckBox, &DCheckBox::stateChanged, q, [this](int status) { #endif - if (status == 0) { + if (status == Qt::Unchecked) { if (isActualPrinter(printDeviceCombo->currentText())) settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_PageOrder_SequentialPrint, true); setPageLayoutEnable(false); @@ -1268,7 +1268,8 @@ void DPrintPreviewDialogPrivate::initconnections() QObject::connect(marginLeftSpin, SIGNAL(valueChanged(double)), q, SLOT(_q_marginspinChanged(double))); QObject::connect(marginBottomSpin, SIGNAL(valueChanged(double)), q, SLOT(_q_marginspinChanged(double))); #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - QObject::connect(duplexCheckBox, SIGNAL(checkStateChanged(int)), q, SLOT(_q_checkStateChanged(int))); + QObject::connect(duplexCheckBox, &DCheckBox::checkStateChanged, q, + [this](Qt::CheckState state) { _q_checkStateChanged(int(state)); }); #else QObject::connect(duplexCheckBox, SIGNAL(stateChanged(int)), q, SLOT(_q_checkStateChanged(int))); #endif diff --git a/src/widgets/dsettingswidgetfactory.cpp b/src/widgets/dsettingswidgetfactory.cpp index 9f30fec01..4ea13de06 100644 --- a/src/widgets/dsettingswidgetfactory.cpp +++ b/src/widgets/dsettingswidgetfactory.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2016 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -275,8 +275,8 @@ QPair createCheckboxOptionHandle(QObject *opt) #else option->connect(rightWidget, &QCheckBox::stateChanged, #endif - option, [ = ](int status) { - option->setValue(status == Qt::Checked); + option, [ = ] { + option->setValue(rightWidget->isChecked()); }); option->connect(option, &DTK_CORE_NAMESPACE::DSettingsOption::valueChanged, rightWidget, [ = ](const QVariant & value) {