PyQt5 – 查找单选按钮是否被选中
在本文中,我们将看看如何找到单选按钮是否被选中。默认情况下,单选按钮未选中,但在setChecked
方法的帮助下,我们可以将其设置为选中。
In order check if the radio button is checked or not we will do the following :
1. Create a push button
2. Create a label to tell if radio button is checked or not.
3. Connect a method to it such that if its state gets changed method should be called.
4. In method check if radio button is checked or not with the help of isChecked
method.
5. Change the text of label according to the state.
下面是实现。
输出 :