import sys
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Parser for id")
Dialog.resize(240, 101)
Dialog.setMaximumSize(QtCore.QSize(240, 16777215))
self.pushButton = QtWidgets.QPushButton(Dialog)
self.pushButton.setGeometry(QtCore.QRect(160, 30, 81, 21))
button = self.pushButton.setObjectName("pushButton")
self.radioButton = QtWidgets.QRadioButton(Dialog)
self.radioButton.setGeometry(QtCore.QRect(40, 60, 61, 21))
self.radioButton.setObjectName("radioButton")
self.radioButton_2 = QtWidgets.QRadioButton(Dialog)
self.radioButton_2.setGeometry(QtCore.QRect(80, 60, 61, 21))
self.radioButton_2.setObjectName("radioButton_2")
self.lineEdit = QtWidgets.QLineEdit(Dialog)
self.lineEdit.setGeometry(QtCore.QRect(50, 30, 111, 21))
self.lineEdit.setObjectName("lineEdit")
self.label = QtWidgets.QLabel(Dialog)
self.label.setGeometry(QtCore.QRect(0, 26, 61, 31))
self.label.setObjectName("label")
self.label_2 = QtWidgets.QLabel(Dialog)
self.label_2.setGeometry(QtCore.QRect(0, 0, 241, 31))
self.label_2.setObjectName("label_2")
self.button.clicked.connect(self.clicked)
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def clicked(self):
# надо сделать чек radibutton(если можно пример с if) и получить то, что написано в input
def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Parser For id"))
self.pushButton.setText(_translate("Dialog", "Поиск"))
self.radioButton.setText(_translate("Dialog", "VK"))
self.radioButton_2.setText(_translate("Dialog", "OK"))
self.label.setText(_translate("Dialog", "<html><head/><body><p align=\"center\"><span style=\" font-size:10pt;\">ID:</span></p></body></html>"))
self.label_2.setText(_translate("Dialog", "<html><head/><body><p align=\"center\">Введите screenname или ID</p></body></html>"))
class MainWindow(QtWidgets.QMainWindow, Ui_Dialog):
def __init__(self, *args, obj=None, **kwargs):
super(MainWindow, self).__init__(*args, **kwargs)
self.setupUi(self)
app = QtWidgets.QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()
Не понял документацию, прошу помощи на своем примере кода, как получить radiobutton и то, что написано в input ?