我在 PyQt creator(Qt Designer 部分)中设计了一个 UI,并使用“pyuic”方法将其转换为 .py 文件。但是当我运行它时(例如在 PyCharm IDE 上),什么也没有出现,并且该过程完成而没有任何结果。(对不起,我的英语不好 :) )
你认为我该如何解决它?
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mainwindow.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1920, 1080)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.label_2 = QtWidgets.QLabel(self.centralwidget)
self.label_2.setGeometry(QtCore.QRect(0, -20, 1920, 1080))
self.label_2.setText("")
self.label_2.setPixmap(QtGui.QPixmap("UI edited/Slide2EDITED.png"))
self.label_2.setObjectName("label_2")
self.label_id = QtWidgets.QLabel(self.centralwidget)
self.label_id.setGeometry(QtCore.QRect(1528, 259, 191, 41))
font = QtGui.QFont()
font.setFamily("B Yekan")
font.setBold(True)
font.setWeight(75)
self.label_id.setFont(font)
self.label_id.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_id.setObjectName("label_id")
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.label_id.setText(_translate("MainWindow", "<html><head/><body><p><span style=\" font-size:14pt; font-weight:600; color:#ffffff;\">شماره پرسنلي</span></p></body></html>"))