connect(ui.m_ckbScatter, &QCheckBox::stateChanged, [this](int nState) {
if (nState == Qt::CheckState::Checked)
{
ui.m_ckbHot->blockSignals(true);
ui.m_ckbHot->setChecked(false);
ui.m_ckbHot->blockSignals(false);
}
onStateChanged(nState, false);
});
connect(ui.m_ckbHot, &QCheckBox::stateChanged, [this](int nState) {
if (nState == Qt::CheckState::Checked)
{
ui.m_ckbScatter->blockSignals(true);
ui.m_ckbScatter->setChecked(false);
ui.m_ckbScatter->blockSignals(false);
}
onStateChanged(nState, true);
});
QT设置两个CheckBox达到互斥效果
最新推荐文章于 2023-10-06 19:13:55 发布