PyQt5 - Change state of Radio Button Last Updated : 28 Apr, 2025 Comments Improve Suggest changes Like Article Like Report In this article we will see how to change the state of radio button. Although with the help of setChecked method we can make the radio button checked but when we use this method on the checked radio button there will be no change in the state of radio button. In order to change the state of radio button when push button is pressed we have to do the following - 1. Create a radio button 2. Create a push button 3. Connect a method to push button such that when push button get pressed method get called 4. In the calling method with the help of nextCheckState method change the state of radio button. Below is the implement. Python3 # importing libraries from PyQt5.QtWidgets import * from PyQt5 import QtCore, QtGui from PyQt5.QtGui import * from PyQt5.QtCore import * import sys class Window(QMainWindow): def __init__(self): super().__init__() # setting title self.setWindowTitle("Python ") # setting geometry self.setGeometry(100, 100, 600, 400) # calling method self.UiComponents() # showing all the widgets self.show() # method for widgets def UiComponents(self): # creating a radio button self.radio_button = QRadioButton(self) # setting geometry of radio button self.radio_button.setGeometry(200, 150, 120, 40) # setting text to radio button self.radio_button.setText("Radio Button") # creating push button push = QPushButton("Press", self) # setting geometry of push button push.setGeometry(200, 200, 100, 40) # connect method to push button push.clicked.connect(self.method) def method(self): # changing the state of radio button self.radio_button.nextCheckState() # create pyqt5 app App = QApplication(sys.argv) # create the instance of our Window window = Window() # start the app sys.exit(App.exec()) output : Comment More infoAdvertise with us Next Article PyQt5 - Change state of Radio Button R rakshitarora Follow Improve Article Tags : Python Python-PyQt Python-gui Practice Tags : python Similar Reads PyQt5 - Change the size of radio button In this article we will see how we can change the size of pre-existing radio button when we pressed the push button, we can change the size of radio button with the help of setGeometry method. In order to change the size of radio button when push button is pressed we have to do the following: 1. Cre 2 min read PyQt5 â Change text in Radio Button on click In this article we will see how to change the text in the radio button. When we create a radio button we set some text or even we can leave it blank, radio button is created with the help of QRadioButton class. We will create a radio button and a push button such that when push button is pressed, ra 2 min read PyQt5 â Change color of Radio button for checked state In this article we will see how to change the color of radio button when it is in checked state, by default there is no color set to any state of radio button. In order to set color to radio button for checked state we have to change the style sheet for the checked state of radio button. Below is th 2 min read PyQt5 - Change text of pre-existing Radio button In this article we will see how we can change the text of pre-existing radio button when we pressed the push button, radio button text can be changed with the help of setText method. In order to do this we have to do the following - 1. Create a radio button 2. Create a push button 3. Add action to t 2 min read PyQt5 - Change color of Radio button for unchecked state In this article we will see how to change the color of radio button when it is in unchecked state, by default there is no color set to any state of radio. In order to set color to radio button for unchecked state we have to change the style sheet for the checked state of radio button. Below is the s 2 min read PyQt5 - Program to check radio button In this article we will see how to set the radio button to checked state. Radio button has two states by default checked and unchecked, in checked state indicator is filled whereas in unchecked state indicator is empty. In order to check the program we will use setChecked method. Syntax : radio_butt 1 min read PyQt5 - Tube shaped indicator of Radio Button In this article we will see how to make tube shaped indicator of radio button. By default radio button indicator is circular in shape. Below is the representation of normal radio button and a radio button whose indicator is in tube shaped.   In order to do this we have to do the following :1. Crea 2 min read PyQt5 - How change size of indicator in Radio Button In this article we will see how we can change the size of indicator in radio button, indicator is a part of radio button which is round in shape and tells about the radio button is checked or not. When we change the size of the radio button only text part size get changed, indicator size remained sa 2 min read PyQt5 - Program to get caption of Radio Button In this article we will see how to get the text (caption) of the radio button. When we create radio button we set some text to it, with the help of setText method we can update the text in it. Overview of the implementation: 1. We will create a radio button. 2. Set some text to the radio button with 2 min read PyQt5 â Background image of Radio button for checked state In this article we will see how we can set background image of radio button when it is in checked state, by default there is no image set to any state of radio button. In order to set background image to radio button for checked state we have to change the style sheet for the checked state of radio 2 min read Like