擅长:python、mysql、java
<p><a href="https://doc.qt.io/qt-5/qbuttongroup.html#details" rel="nofollow noreferrer">https://doc.qt.io/qt-5/qbuttongroup.html#details</a></p>
<blockquote>
<p>QButtonGroup provides an abstract container into which button widgets can be placed.. It does not provide a visual representation of this container (see QGroupBox for a container widget), but instead <strong>manages the states of each of the buttons in the group</strong>.</p>
</blockquote>
<p><code>setValue()</code>在每个复选框上可以切换另一个复选框。你知道吗</p>
<p>但真正的问题是<code>isCheckable()</code>(方法可以检查或不检查)。可能需要使用<code>isChecked()</code>(值设置为true)。你知道吗</p>
<p>编辑。您可以尝试通过<code>setChecked()</code>设置状态。你知道吗</p>
<p>或者如果您想支持部分选中的,使用<code>setCheckState()</code>(如您所用)和<code>checkState()</code>来获取信息。你知道吗</p>