figure 1
2
CodePudding user response:
The code on inheritance has been resolved, it is out of the questionCodePudding user response:
Hello, I also appear the same problem, what code inheritance should be how to? I don't feel like there's checked the wrongthe from PyQt5. QtWidgets import *
The from PyQt5. QtMultimedia import *
The from PyQt5. QtMultimediaWidgets import QVideoWidget
The from PyQt5. QtCore import QUrl
The from tt import Ui_MainWindow
The import sys
the from PyQt5 import QtCore QtGui, QtWidgets
The class Ui_MainWindow (object) :
Def setupUi (self, the MainWindow) :
MainWindow. SetObjectName (" MainWindow ")
MainWindow. Resize (800, 600)
Self. Centralwidget=QtWidgets. QWidget (MainWindow)
Self. Centralwidget. SetObjectName (" centralwidget ")
Self. Widget_video=QtWidgets. QWidget (self centralwidget)
Self. Widget_video. SetGeometry (QtCore QRect (140, 100, 511, 311))
Self. Widget_video. SetObjectName (" widget_video ")
MainWindow. SetCentralWidget (self. Centralwidget)
The self. The menubar=QtWidgets. QMenuBar (MainWindow)
The self. The menubar. SetGeometry (QtCore QRect (0, 0, 800, 26))
The self. The menubar. SetObjectName (" menubar ")
MainWindow. SetMenuBar (self. Menubar)
The self. The statusbar=QtWidgets. QStatusBar (MainWindow)
The self. The statusbar. SetObjectName (" statusbar ")
MainWindow. SetStatusBar (self. The statusbar)
Self. RetranslateUi (MainWindow)
QtCore. QMetaObject. ConnectSlotsByName (MainWindow)
Def retranslateUi (self, the MainWindow) :
_translate=QtCore. QCoreApplication. Translate
MainWindow. SetWindowTitle (_translate (" MainWindow ", "MainWindow"))
CodePudding user response:
Try the app=QApplication (sys. Argv) with the following codeThe from PyQt5 import QtCore
QtCore. QCoreApplication. SetAttribute (QtCore. Qt. AA_EnableHighDpiScaling)
CodePudding user response: