Qt设置按钮单选 使用QButtonGroup类 m_pButtonGroup = new QButtonGroup(this); m_pButtonGroup->addButton(ui.m_pShortcutKeyBtn); m_pButtonGroup->addButton(ui.m_pLabelConfigBtn); m_pButtonGroup->addButton(ui.m_pLogInfoBtn); m_pButtonGroup->setExclusive(true);