Ich hoffe auf bladige Antworten!!!
Code: Alles auswählen
import os
import sys
from PyQt4 import QtGui, QtCore
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(122, 141)
self.radioButton = QtGui.QRadioButton(Dialog)
self.radioButton.setGeometry(QtCore.QRect(20, 20, 84, 18))
self.radioButton.setObjectName("radioButton")
self.radioButton_2 = QtGui.QRadioButton(Dialog)
self.radioButton_2.setGeometry(QtCore.QRect(20, 40, 84, 18))
self.radioButton_2.setObjectName("radioButton_2")
self.radioButton_3 = QtGui.QRadioButton(Dialog)
self.radioButton_3.setGeometry(QtCore.QRect(20, 60, 84, 18))
self.radioButton_3.setObjectName("radioButton_3")
self.radioButton_4 = QtGui.QRadioButton(Dialog)
self.radioButton_4.setGeometry(QtCore.QRect(20, 80, 84, 18))
self.radioButton_4.setObjectName("radioButton_4")
self.groupBox = QtGui.QGroupBox(Dialog)
self.groupBox.setGeometry(QtCore.QRect(10, 10, 101, 91))
self.groupBox.setObjectName("groupBox")
self.pushButton = QtGui.QPushButton(Dialog)
self.pushButton.setGeometry(QtCore.QRect(10, 110, 101, 23))
self.pushButton.setObjectName("pushButton")
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Dialog", None, QtGui.QApplication.UnicodeUTF8))
self.radioButton.setText(QtGui.QApplication.translate("Dialog", "4-5", None, QtGui.QApplication.UnicodeUTF8))
self.radioButton_2.setText(QtGui.QApplication.translate("Dialog", "2-3", None, QtGui.QApplication.UnicodeUTF8))
self.radioButton_3.setText(QtGui.QApplication.translate("Dialog", "1-2", None, QtGui.QApplication.UnicodeUTF8))
self.radioButton_4.setText(QtGui.QApplication.translate("Dialog", "0.5-1", None, QtGui.QApplication.UnicodeUTF8))
self.groupBox.setTitle(QtGui.QApplication.translate("Dialog", "Sec. zu warten", None, QtGui.QApplication.UnicodeUTF8))
self.pushButton.setText(QtGui.QApplication.translate("Dialog", "Los!", None, QtGui.QApplication.UnicodeUTF8))
class MyDialog(QtGui.QDialog, Ui_Dialog):
def __init__(self):
QtGui.QDialog.__init__(self)
self.setupUi(self)
self.connect(self.pushButton,
QtCore.SIGNAL("clicked()"), self.onOK)
self.connect(self.radioButton,
QtCore.SIGNAL("toggled()"), self.onOK) #was ist toggled und wo muss ich es hinschreiben
self.connect(self.radioButton_2,
QtCore.SIGNAL("toggled()"), self.onOK) #was ist toggled und wo muss ich es hinschreiben
self.connect(self.radioButton_3,
QtCore.SIGNAL("toggled()"), self.onOK) #was ist toggled und wo muss ich es hinschreiben
self.connect(self.radioButton_4,
QtCore.SIGNAL("toggled()"), self.onOK) #was ist toggled und wo muss ich es hinschreiben
def onOK(self):
if self.radioButton is toggled(): #was ist toggled und wo muss ich es hinschreiben
print "HI"
app=QtGui.QApplication(sys.argv)
Dialog=MyDialog()
Dialog.show()
sys.exit(app.exec_())
-->Python neuling<--