I am working with python.When i try to run my DlgDbError.py file,it gives me error saying:
File "C:\rt_sql_layer\ui\DlgDbError_ui.py", line 47, in setupUi
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), DlgDbError.accept)
AttributeError: 'DlgDbError' object has no attribute 'accept'
but buttonbox has accept method..what can be the problem??
The error isn’t in your
DlgDbError.pyfile, it’s in theDlgDbError_ui.pymodule that you created withpyuic4.This module will contain a
Ui_DlgDbErrorclass with asetupUimethod. This method has a single argument (namedDlgDbError), which takes an instance of the main form class that you created in Qt Designer (i.e. the one also namedDlgDbError).The
setupUimethod is expecting theDlgDbErrorobject to have anaccept()slot, which probably means it should be a subclass ofQDialog.Obviously, you are not passing a subclass of
QDialogtosetupUi, and so you are getting anAttributeError.You probably need to do something like this: