J
https://doc.qt.io/qt-5/layout.html All divisions QWidget use layout for management
Your daughters.
Function QWidget::setLayout() Applicable layout to see.Composite system Qt provides a simple and powerful means of automatic
the organization of daughters inside the view to guarantee,
That they're using space effectively.
...reading on.You have a central view, it's good to read--
https://doc.qt.io/qt-5/qmainwindow.html#qt-main-window-framework self.centralwidget = QtWidgets.QWidget(MainWindow)
self.horizontalLayout_7 = QtWidgets.QHBoxLayout(self.centralwidget)
We chose. QHBoxLayout for the location of daughters,
Because we want to put two viewers in it. Conditional left left_frame rights right_frame♪
You have this. frame and verticalLayout_4I mean, for the right side, you're not.
creates a view, and you better do it, that's what you do.Give the right names to variables/objects.
Look at that. frame - what can you say? ♪
And if you look at it, left_frameI understand that it's a left fream.And also:Examples should not be provided.
You're using an image resource file.
I hope you're aware of this subject, so use it when all the issues have been resolved.It is also desirable to publish your images that you use.Don't try to paint everything you want to see in the window,
And then figure out what's wrong, do the rascal.
They added a make-up and looked it up.
They added the next view and the make-up, see if you're okay again.
Then you start creating the sights you're going to put in the first sight.
and add these created viewpoints to the appropriate first view.
We've seen everything like this. E.T.Anyway, I've changed yours. .ui Total .py and made some changes to his rose.
You can easily see what I've changed and where, and think about why I did it.To learn how to use company managers, we need practice.from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1253, 801)
MainWindow.resize(900, 601)
MainWindow.setStyleSheet("")
MainWindow.setAnimated(True)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setStyleSheet("background-color: rgb(34, 31, 46);")
self.centralwidget.setObjectName("centralwidget")
??? self.horizontalLayout_6 = QtWidgets.QHBoxLayout(self.centralwidget)
??? self.horizontalLayout_6.setObjectName("horizontalLayout_6")
self.horizontalLayout_7 = QtWidgets.QHBoxLayout(self.centralwidget) #+ centralwidget
self.horizontalLayout_7.setContentsMargins(3, 0, 24, 31)
self.horizontalLayout_7.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout_7.setSpacing(17)
self.horizontalLayout_7.setSpacing(0)
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
self.frame = QtWidgets.QFrame(self.centralwidget)
self.left_frame = QtWidgets.QFrame(self.centralwidget)
self.left_frame.setMinimumSize(QtCore.QSize(50, 751))
self.left_frame.setMaximumSize(QtCore.QSize(161, 751))
self.left_frame.setMinimumWidth(80)
self.left_frame.setStyleSheet("background-color: rgb(146, 43, 63);\n"
"border: 5px solid rgba(255, 255, 255, 0);\n"
"border-radius: 20px;\n"
"\n"
"")
self.left_frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.left_frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.left_frame.setObjectName("left_frame")
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.left_frame) # self.left_frame
self.verticalLayout_5.setObjectName("verticalLayout_5")
self.menu = QtWidgets.QPushButton() # - self.frame
self.menu.setMinimumSize(QtCore.QSize(31, 31))
self.menu.setMaximumSize(QtCore.QSize(151, 151))
self.menu.setMinimumHeight(50) # +++
self.menu.setStyleSheet("background-image: url(:/menu/Изображения/3030.png);\n"
vvvvvvvvvvvv vvvvvvvvvvvvvvvvvvvvvvv
self.menu.setStyleSheet("border-image: url(boy.jpg) 0 0 0 0 stretch stretch;\n"
"border: 1px solid #a112fe;\n"
"border-radius: 25;\n"
"")
self.menu.setText("")
self.menu.setObjectName("menu")
self.verticalLayout_5.addWidget(self.menu)
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
self.horizontalLayout_4.setSpacing(6)
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.label_9 = QtWidgets.QLabel(self.left_frame)
self.label_9.setStyleSheet("background-color: rgb(34, 31, 46);\n"
"border: 2px solid rgba(34, 31, 46, 0); ;\n"
"\n"
"border-radius: 10")
self.label_9.setText("")
self.label_9.setPixmap(QtGui.QPixmap("../apexx/Nikita_Pfeyfer2.png"))
+++ vvvvvvvvvvvvvv
self.label_9.setPixmap(QtGui.QPixmap("Ok.png").scaled(50, 50)) # +++
self.label_9.setObjectName("label_9")
self.label_9.setMinimumWidth(50) # +++
self.horizontalLayout_4.addWidget(self.label_9, 0)
self.weapon = QtWidgets.QPushButton(self.left_frame)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.weapon.sizePolicy().hasHeightForWidth())
self.weapon.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setFamily("Copperplate Gothic Bold")
font.setPointSize(14)
font.setBold(False)
font.setWeight(50)
self.weapon.setFont(font)
self.weapon.setStyleSheet("QPushButton {\n"
" ;\n"
" color: rgb(78, 175, 94); \n"
" background-color: rgba(255, 255, 255, 0);\n"
" padding: 5px;\n"
" }\n"
"\n"
"QPushButton:hover {\n"
" \n"
" \n"
" \n"
" color: rgb(168, 168, 168);\n"
" }\n"
"\n"
"QPushButton:pressed {\n"
" border-style: inset;\n"
" \n"
" \n"
" color: rgb(214, 214, 214);\n"
" }")
self.weapon.setInputMethodHints(QtCore.Qt.ImhNone)
self.weapon.setAutoExclusive(False)
self.weapon.setObjectName("weapon")
self.horizontalLayout_4.addWidget(self.weapon, 1)
self.verticalLayout_5.addLayout(self.horizontalLayout_4)
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_5.addItem(spacerItem)
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
self.label_10 = QtWidgets.QLabel(self.left_frame)
self.label_10.setStyleSheet("background-color: rgb(146, 31, 46);")
self.label_10.setText("")
self.label_10.setPixmap(QtGui.QPixmap("head3.png").scaled(45, 45))
self.label_10.setObjectName("label_10")
self.label_10.setMinimumWidth(55)
self.horizontalLayout_5.addWidget(self.label_10, 0)
self.spravka = QtWidgets.QPushButton(self.left_frame)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.spravka.sizePolicy().hasHeightForWidth())
self.spravka.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setFamily("Copperplate Gothic Bold")
font.setPointSize(12)
font.setBold(False)
font.setWeight(50)
self.spravka.setFont(font)
self.spravka.setStyleSheet("QPushButton {\n"
" ;\n"
" \n"
" color: rgb(78, 175, 94);\n"
" background-color: rgba(255, 255, 255, 0);\n"
" padding: 5px;\n"
"\n"
" }\n"
"QPushButton:hover {\n"
" \n"
" \n"
" color: rgb(168, 168, 168);\n"
" }\n"
"\n"
"QPushButton:pressed {\n"
" border-style: inset;\n"
" \n"
" color: rgb(214, 214, 214);\n"
" }")
self.spravka.setInputMethodHints(QtCore.Qt.ImhNone)
self.spravka.setAutoExclusive(False)
self.spravka.setObjectName("spravka")
self.horizontalLayout_5.addWidget(self.spravka, 1)
self.verticalLayout_5.addLayout(self.horizontalLayout_5)
self.horizontalLayout_7.addWidget(self.left_frame, stretch=1) # + stretch
??? spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
??? self.horizontalLayout_7.addItem(spacerItem1)
==============================================================================
#right_frame
self.right_frame = QtWidgets.QFrame(self.centralwidget)
self.right_frame.setStyleSheet("background-color: rgb(146, 43, 63);\n"
"border: 5px solid rgba(255, 255, 255, 0);\n"
"border-radius: 20px;\n"
"\n"
"")
self.right_frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.right_frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.right_frame.setObjectName("right_frame")
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.right_frame)
self.verticalLayout_4.setContentsMargins(-1, 0, 0, 191)
self.verticalLayout_4.setContentsMargins(10, 10, 10, 10)
self.verticalLayout_4.setSpacing(0)
self.verticalLayout_4.setObjectName("verticalLayout_4")
??? vvvvvvvvvvvvvvvv
self.verticalLayout_3 = QtWidgets.QVBoxLayout()
??? self.verticalLayout_3.setContentsMargins(0, 0, -1, 0)
??? self.verticalLayout_3.setSpacing(62)
self.verticalLayout_3.setSpacing(5) # +++
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.label = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setFamily("Copperplate Gothic Bold")
font.setPointSize(28)
self.label.setFont(font)
self.label.setStyleSheet("color: rgb(253, 253, 253); background-color: #105652;")
self.label.setAlignment(QtCore.Qt.AlignCenter)
self.label.setObjectName("label")
self.verticalLayout_3.addWidget(self.label)
spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_3.addItem(spacerItem2)
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalLayout_3.setContentsMargins(114, -1, -1, -1)
self.horizontalLayout_3.setSpacing(18)
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
self.verticalLayout_2.setSpacing(5)
self.verticalLayout_2.setObjectName("verticalLayout_2")
# версия
self.frame_3 = QtWidgets.QFrame(self.centralwidget)
self.frame_3.setStyleSheet("background-color: rgb(46, 43, 63);\n"
"border: 2px solid #2e2b3f;\n"
"border-radius: 10")
self.frame_3.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_3.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_3.setObjectName("frame_3")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.frame_3)
self.horizontalLayout.setSpacing(6)
self.horizontalLayout.setObjectName("horizontalLayout")
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.label_3 = QtWidgets.QLabel(self.frame_3)
font = QtGui.QFont()
font.setFamily("Bahnschrift SemiBold")
font.setPointSize(22)
font.setBold(True)
font.setWeight(75)
self.label_3.setFont(font)
self.label_3.setStyleSheet("color: rgb(194, 194, 194);")
self.label_3.setAlignment(QtCore.Qt.AlignCenter)
self.label_3.setObjectName("label_3")
self.verticalLayout.addWidget(self.label_3)
self.label_4 = QtWidgets.QLabel(self.frame_3)
font = QtGui.QFont()
font.setFamily("Bahnschrift SemiBold")
font.setPointSize(22)
font.setBold(True)
font.setWeight(75)
self.label_4.setFont(font)
self.label_4.setStyleSheet("")
self.label_4.setAlignment(QtCore.Qt.AlignCenter)
self.label_4.setObjectName("label_4")
self.verticalLayout.addWidget(self.label_4)
self.horizontalLayout.addLayout(self.verticalLayout)
self.verticalLayout_2.addWidget(self.frame_3)
spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_2.addItem(spacerItem3)
self.textBrowser_2 = QtWidgets.QTextBrowser(self.centralwidget)
self.textBrowser_2.setStyleSheet("background-color: rgb(46, 43, 63);\n"
"border: 2px solid #2e2b3f;\n"
"border-radius: 10")
self.textBrowser_2.setObjectName("textBrowser_2")
self.verticalLayout_2.addWidget(self.textBrowser_2)
self.horizontalLayout_3.addLayout(self.verticalLayout_2)
spacerItem4 = QtWidgets.QSpacerItem(29, 17, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_3.addItem(spacerItem4)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setSpacing(15)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.textBrowser = QtWidgets.QTextBrowser(self.centralwidget)
self.textBrowser.setStyleSheet("background-color: rgb(46, 43, 63);\n"
"border: 2px solid #2e2b3f;\n"
"border-radius: 10")
self.textBrowser.setObjectName("textBrowser")
self.horizontalLayout_2.addWidget(self.textBrowser)
spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem5)
self.textBrowser_3 = QtWidgets.QTextBrowser(self.centralwidget)
self.textBrowser_3.setStyleSheet("background-color: rgb(46, 43, 63);\n"
"border: 2px solid #6c6c00;\n"
"border-radius: 10")
self.textBrowser_3.setObjectName("textBrowser_3")
self.horizontalLayout_2.addWidget(self.textBrowser_3)
self.horizontalLayout_3.addLayout(self.horizontalLayout_2)
self.verticalLayout_3.addLayout(self.horizontalLayout_3)
++ vvv две строки
spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_3.addItem(spacerItem2)
self.verticalLayout_4.addLayout(self.verticalLayout_3)
self.horizontalLayout_7.addLayout(self.verticalLayout_4)
self.horizontalLayout_7.addWidget(self.right_frame, stretch=4) # + stretch
self.horizontalLayout_6.addLayout(self.horizontalLayout_7)
self.label.raise_()
self.left_frame.raise_()
self.frame_3.raise_()
self.textBrowser.raise_()
self.textBrowser_3.raise_()
MainWindow.setCentralWidget(self.centralwidget)
self.action = QtWidgets.QAction(MainWindow)
self.action.setObjectName("action")
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.weapon.setText(_translate("MainWindow", "Weapons"))
self.spravka.setText(_translate("MainWindow", "Reference"))
self.label.setText(_translate("MainWindow", "Main Menu"))
self.label_3.setText(_translate("MainWindow", "Версия"))
self.label_4.setText(_translate("MainWindow", "1.0 BETA"))
self.textBrowser_2.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name="qrichtext" content="1" /><style type="text/css">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">\n"
"<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:16pt; font-weight:600; color:#c2c2c2;">Информация</span></p>\n"
"<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:16pt; font-weight:600;"><br /></p>\n"
"<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">Программа находится в разработке, поэтому, пока что присудствует не вся информация </span></p></body></html>"))
self.textBrowser.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">\n"
"<html><head><meta name="qrichtext" content="1" /><style type="text/css">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">\n"
"<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; color:#c2c2c2;">ApexHelper</span></p>\n"
"<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt; font-weight:600;"><br /></p>\n"
"<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">Эта программа предназначена для того, чтобы помочь новичкам или опытным игрокам более лучше освоить игру</span></p>\n"
"<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;"><br /></p>\n"
"<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; color:#c2c2c2;">Apex Legends</span></p>\n"
"<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt; font-weight:600; color:#c2c2c2;"><br /></p>\n"
"<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt;">Тут ты найдёшь подробное описание каждого оружия,</span><span style=" font-size:12pt; text-decoration: underline;"> </span><span style=" font-size:12pt;">обвеса и прочих вещей.</span></p>\n"
"<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;"><br /></p>\n"
"<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;"><br /></p>\n"
"<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-style:italic; color:#c2c2c2;">С уважением, Разработчик </span><span style=" font-size:12pt; font-weight:600; font-style:italic; color:#c2c2c2;">ApexHelper</span><span style=" font-size:12pt; color:#c2c2c2;">.</span></p>\n"
"<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;"><br /></p></body></html>"))
self.textBrowser_3.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">\n"
"<html><head><meta name="qrichtext" content="1" /><style type="text/css">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">\n"
"<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:16pt; color:#c2c2c2;">Кому принадлежит</span></p>\n"
"<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:16pt;"><br /></p>\n"
"<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:16pt;">Все данные, изображения и прочее из программы, принадлежат компании</span></p>\n"
"<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:16pt;"> </span></p>\n"
"<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; font-weight:600; color:#6f6f0a;">Respawn Entertainment</span></p>\n"
"<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:14pt; font-weight:600;"><br /></p>\n"
"<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt;">Никому более.</span></p>\n"
"<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:14pt;"><br /></p>\n"
"<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt;">Их материал был повзаимствован для помощи игрокам.</span></p></body></html>"))
self.action.setText(_translate("MainWindow", "справка"))
??? import ApexFone_rc
??? import menu_rc
if name == "main":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())