Wrong room
-
I think it's a good idea, but there's a problem with the left menu. When I do the whole screen
There is no clear expansion and remoteness of view. ♪ ♪
How can this be corrected to ensure that the central part is moved proportionately to the left menu and to remove this gap between the viewpoints.
<?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>MainWindow</class> <widget class="QMainWindow" name="MainWindow"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>1253</width> <height>801</height> </rect> </property> <property name="windowTitle"> <string>MainWindow</string> </property> <property name="styleSheet"> <string notr="true"/> </property> <property name="animated"> <bool>true</bool> </property> <widget class="QWidget" name="centralwidget"> <property name="styleSheet"> <string notr="true">background-color: rgb(34, 31, 46);</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_6"> <item> <layout class="QHBoxLayout" name="horizontalLayout_7"> <property name="spacing"> <number>17</number> </property> <property name="leftMargin"> <number>3</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>24</number> </property> <property name="bottomMargin"> <number>31</number> </property> <item> <widget class="QFrame" name="frame"> <property name="minimumSize"> <size> <width>50</width> <height>751</height> </size> </property> <property name="maximumSize"> <size> <width>161</width> <height>751</height> </size> </property> <property name="styleSheet"> <string notr="true">background-color: rgb(46, 43, 63); border: 5px solid rgba(255, 255, 255, 0); border-radius: 20px;
</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QPushButton" name="menu">
<property name="minimumSize">
<size>
<width>31</width>
<height>31</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>31</width>
<height>31</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-image: url(:/menu/Изображения/3030.png);
border: 1px solid #a112fe;
border-radius: 10;
</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="spacing">
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label_9">
<property name="styleSheet">
<string notr="true">background-color: rgb(34, 31, 46);
border: 2px solid rgba(34, 31, 46, 0); ;border-radius: 10</string>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>../apexx/Nikita_Pfeyfer2.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="weapon">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Copperplate Gothic Bold</family>
<pointsize>14</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">QPushButton {
;
color: rgb(78, 75, 94);
background-color: rgba(255, 255, 255, 0);
padding: 5px;
}QPushButton:hover {
color: rgb(168, 168, 168); }
QPushButton:pressed {
border-style: inset;color: rgb(214, 214, 214); }</string> </property> <property name="inputMethodHints"> <set>Qt::ImhNone</set> </property> <property name="text"> <string>Weapons</string> </property> <property name="autoExclusive"> <bool>false</bool> </property> </widget> </item> </layout> </item> <item> <spacer name="verticalSpacer_2"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>20</width> <height>40</height> </size> </property> </spacer> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_5"> <item> <widget class="QLabel" name="label_10"> <property name="styleSheet"> <string notr="true">background-color: rgb(34, 31, 46);</string> </property> <property name="text"> <string/> </property> <property name="pixmap"> <pixmap>../apexx/Nikita_Pfeyfer4.png</pixmap> </property> </widget> </item> <item> <widget class="QPushButton" name="spravka"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="font"> <font> <family>Copperplate Gothic Bold</family> <pointsize>12</pointsize> <weight>50</weight> <bold>false</bold> </font> </property> <property name="styleSheet"> <string notr="true">QPushButton { ; color: rgb(78, 75, 94); background-color: rgba(255, 255, 255, 0); padding: 5px; }
QPushButton:hover {
color: rgb(168, 168, 168); }
QPushButton:pressed {
border-style: inset;color: rgb(214, 214, 214); }</string> </property> <property name="inputMethodHints"> <set>Qt::ImhNone</set> </property> <property name="text"> <string>Reference</string> </property> <property name="autoExclusive"> <bool>false</bool> </property> </widget> </item> </layout> </item> </layout> </widget> </item> <item> <spacer name="horizontalSpacer_3"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> </size> </property> </spacer> </item> <item> <layout class="QVBoxLayout" name="verticalLayout_4"> <property name="spacing"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>191</number> </property> <item> <layout class="QVBoxLayout" name="verticalLayout_3"> <property name="spacing"> <number>62</number> </property> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property> <item> <widget class="QLabel" name="label"> <property name="font"> <font> <family>Copperplate Gothic Bold</family> <pointsize>28</pointsize> </font> </property> <property name="styleSheet"> <string notr="true">color: rgb(253, 253, 253);</string> </property> <property name="text"> <string>Main Menu</string> </property> <property name="alignment"> <set>Qt::AlignCenter</set> </property> </widget> </item> <item> <spacer name="verticalSpacer_3"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>20</width> <height>40</height> </size> </property> </spacer> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_3"> <property name="spacing"> <number>18</number> </property> <property name="leftMargin"> <number>114</number> </property> <item> <layout class="QVBoxLayout" name="verticalLayout_2"> <property name="spacing"> <number>5</number> </property> <item> <widget class="QFrame" name="frame_3"> <property name="styleSheet"> <string notr="true">background-color: rgb(46, 43, 63);
border: 2px solid #2e2b3f;
border-radius: 10</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>6</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<family>Bahnschrift SemiBold</family>
<pointsize>22</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(194, 194, 194);</string>
</property>
<property name="text">
<string>Версия</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<family>Bahnschrift SemiBold</family>
<pointsize>22</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>1.0 BETA</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QTextBrowser" name="textBrowser_2">
<property name="styleSheet">
<string notr="true">background-color: rgb(46, 43, 63);
border: 2px solid #2e2b3f;
border-radius: 10</string>
</property>
<property name="html">
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
<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>
<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>
<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></string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>29</width>
<height>17</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>15</number>
</property>
<item>
<widget class="QTextBrowser" name="textBrowser">
<property name="styleSheet">
<string notr="true">background-color: rgb(46, 43, 63);
border: 2px solid #2e2b3f;
border-radius: 10</string>
</property>
<property name="html">
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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></string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QTextBrowser" name="textBrowser_3">
<property name="styleSheet">
<string notr="true">background-color: rgb(46, 43, 63);
border: 2px solid #6c6c00;
border-radius: 10</string>
</property>
<property name="html">
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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></string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item>
</layout>
<zorder>label</zorder>
<zorder>frame</zorder>
<zorder>frame_3</zorder>
<zorder>textBrowser</zorder>
<zorder>frame_4</zorder>
<zorder>textBrowser_3</zorder>
<zorder></zorder>
</widget>
<action name="action">
<property name="text">
<string>справка</string>
</property>
</action>
</widget>
<resources>
<include location="../apexx/our/ApexFone.qrc"/>
<include location="../apexx/our/menu.qrc"/>
</resources>
<connections/>
</ui>
-
https://doc.qt.io/qt-5/layout.html
All divisions
QWidget
uselayout
for management Your daughters. FunctionQWidget::setLayout()
Applicablelayout
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 leftleft_frame
rightsright_frame
♪ You have this.frame
andverticalLayout_4
I 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_frame
I 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_())