Path: blob/master/PyQt5 - Arayüz Geliştirme/Videolarda Kullanılan Kodlar/radiobutton olusturma.py
765 views
import sys12from PyQt5.QtWidgets import QWidget,QApplication,QRadioButton,QLabel,QPushButton,QVBoxLayout345class Pencere(QWidget):6def __init__(self):78super().__init__()910self.init_ui()1112def init_ui(self):1314self.radio_yazisi = QLabel("Hangi dili daha çok seviyorsun ?")1516self.java = QRadioButton("Java")17self.python = QRadioButton("Python")18self.php = QRadioButton("Php")1920self.yazi_alani = QLabel("")2122self.buton = QPushButton("Gönder")2324v_box = QVBoxLayout()2526v_box.addWidget(self.radio_yazisi)27v_box.addWidget(self.java)28v_box.addWidget(self.python)29v_box.addWidget(self.php)30v_box.addStretch()31v_box.addWidget(self.yazi_alani)32v_box.addWidget(self.buton)3334self.setLayout(v_box)3536self.buton.clicked.connect(lambda : self.click(self.python.isChecked(),self.java.isChecked(),self.php.isChecked(),self.yazi_alani))3738self.setWindowTitle("Radio Button")3940self.show()4142def click(self,python,java,php,yazi_alani):43if python:44yazi_alani.setText("Python")45if php:46yazi_alani.setText("Php")47if java:48yazi_alani.setText("Java")495051app = QApplication(sys.argv)5253pencere = Pencere()5455sys.exit(app.exec_())565758