Skip to content

Commit

Permalink
QT6.8: ColumnSettingDialog - signal from stateChanged to checkStateCh…
Browse files Browse the repository at this point in the history
…anged
  • Loading branch information
foldynl committed Dec 12, 2024
1 parent 035cf1d commit 75d54e8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ui/ColumnSettingDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 75d54e8

Please sign in to comment.