Ich weiß, dass Ihr solche primitiven Fragen nicht mögt, bitte deshalb um Nachsicht.
Ich habe mit dem Qt-Designer eine Test-Formular erstellt, die .ui in .py umgewandelt und in Idle geladen.
Code: Alles auswählen
....
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName(_fromUtf8("Dialog"))
Dialog.resize(400, 598)
self.buttonBox = QtGui.QDialogButtonBox(Dialog)
self.buttonBox.setGeometry(QtCore.QRect(20, 530, 341, 32))
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.listView = QtGui.QListView(Dialog)
self.listView.setGeometry(QtCore.QRect(50, 20, 256, 192))
self.listView.setAutoFillBackground(False)
self.listView.setObjectName(_fromUtf8("listView"))
self.retranslateUi(Dialog)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), Dialog.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Dialog.reject)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
Dialog.setWindowTitle(_translate("Dialog", "Dialog", None))
fenster=Ui_Dialog()
show und ähnliches ist nicht richtig.
Kann jemand mir die eine Zeile aufschreiben?