Home > Mobile >  Why qt designer to design the python running interface and the different?
Why qt designer to design the python running interface and the different?

Time:09-20

I use the qt designer to design an interface, as shown in figure 1, and then use the pyuic5 -o command received. Py files, through the py in python running interface as shown in figure 2, all crowded to the upper left corner, set in the designer layout what doesn't work, is this why? Bosses have this problem?

figure 1
2

CodePudding user response:

The code on inheritance has been resolved, it is out of the question

CodePudding 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 wrong



 the 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 code
The from PyQt5 import QtCore
QtCore. QCoreApplication. SetAttribute (QtCore. Qt. AA_EnableHighDpiScaling)

CodePudding user response:

reference 5 floor xiaotuwai8 reply:
try in app=QApplication (sys. Argv) add the following code before
The from PyQt5 import QtCore
QtCore. QCoreApplication. SetAttribute (QtCore. Qt. AA_EnableHighDpiScaling)


Could you tell me what is causing this problem?

CodePudding user response:

refer to 7th floor hruffhfn1 response:
Quote: refer to fifth floor xiaotuwai8 response:

Try the app=QApplication (sys. Argv) with the following code
The from PyQt5 import QtCore
QtCore. QCoreApplication. SetAttribute (QtCore. Qt. AA_EnableHighDpiScaling)


Could you tell me what is causing this problem?

I am also we are, this statement should be high resolution support
  •  Tags:  
  • Qt
  • Related