class Ui_Form (object) :
Def setupUi (self, Form) :
Form. SetObjectName (" Form ")
Form. Resize (500, 600)
Form. SetMinimumSize (QtCore. QSize (500, 600))
Form. SetMaximumSize (QtCore. QSize (500, 600))
· · · · · ·
Self. RetranslateUi (Form)
QtCore. QMetaObject. ConnectSlotsByName (Form)
Def retranslateUi (self, Form) :
_translate=QtCore. QCoreApplication. Translate
Form. SetWindowTitle (_translate (" Form ", "Title"))
· · · · · ·
Class UI (Ui_Form, QtWidgets. QMainWindow) :
Def __init__ (self, parent=None) :
The self, super (UI) __init__ ()
Self. SetupUi (self)
The self. The cap=cv2. VideoCapture (0, cv2. CAP_DSHOW) # initialize camera
· · · · · ·
If __name__=="__main__ ':
App=QtWidgets. QApplication (sys. Argv)
The main=UI ()
The main show ()
Sys. Exit (app. Exec_ ())
Run error:
Traceback (the most recent call last) :
The File "pydevd_xml. Py", line 282, in frame_vars_to_xml
XML +=var_to_xml (v, STR (k), evaluate_full_value=https://bbs.csdn.net/topics/eval_full_val)
The File "pydevd_xml. Py", line 369, in var_to_xml
Elif hasattr (v, "__len__") and not is_string (v) :
RuntimeError: super - class __init__ () of the type UI was never called
Unexpected error, recovered safely.
CodePudding user response:
Want to ask, this problem solved?