From 75d54e8d5a20771108d2bd251a5ad8f39794fd3a Mon Sep 17 00:00:00 2001 From: Ladislav Foldyna Date: Thu, 12 Dec 2024 16:31:44 +0100 Subject: [PATCH] QT6.8: ColumnSettingDialog - signal from stateChanged to checkStateChanged --- ui/ColumnSettingDialog.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ui/ColumnSettingDialog.cpp b/ui/ColumnSettingDialog.cpp index 592a63df..1debc023 100644 --- a/ui/ColumnSettingDialog.cpp +++ b/ui/ColumnSettingDialog.cpp @@ -71,7 +71,11 @@ void ColumnSettingDialog::setupDialog() : !table->isColumnHidden(columnIndex))); columnCheckbox->setText(columnNameString); +#if (QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)) + connect(columnCheckbox, &QCheckBox::checkStateChanged, this, [columnIndex, this](Qt::CheckState state) +#else connect(columnCheckbox, &QCheckBox::stateChanged, this, [columnIndex, this](int state) +#endif { emit columnChanged(columnIndex, state); if ( table ) table->setColumnHidden(columnIndex, !table->isColumnHidden(columnIndex)); @@ -351,10 +355,14 @@ ColumnSettingSimpleDialog::ColumnSettingSimpleDialog(QTableView *table, QWidget columnCheckbox->setChecked(!table->isColumnHidden(columnIndex)); columnCheckbox->setText(columnNameString); +#if (QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)) + connect(columnCheckbox, &QCheckBox::checkStateChanged, this, [columnIndex, table, this](Qt::CheckState state) +#else connect(columnCheckbox, &QCheckBox::stateChanged, this, [columnIndex, table, this](int state) +#endif { emit columnChanged(columnIndex, state); - table->setColumnHidden(columnIndex, !table->isColumnHidden(columnIndex)); + if ( table) table->setColumnHidden(columnIndex, !table->isColumnHidden(columnIndex)); }); checkboxList.append(columnCheckbox);