def toggle_input(self):
        """Change behaviour of radio button based on input."""
        current_index = self.input.currentIndex()
        # If current input is not a radio button enabler, disable radio button.
        if self.input.itemData(current_index, Qt.UserRole) != (
                self.radio_button_enabler):
            self.disable_radio_button()
        # Otherwise, enable radio button.
        else:
            self.enable_radio_button()
def toggle_input ( self ) : current_index = self . input . currentIndex ( ) if self . input . itemData ( current_index , Qt . UserRole ) != ( self . radio_button_enabler ) : self . disable_radio_button ( ) else : self . enable_radio_button ( )
Change behaviour of radio button based on input.