当您尝试安装布局管理器时,整个图像会更改其位置,这是合乎逻辑的。
但我不明白如何安装Spacer's,如何更改它们,以使我的程序看起来与布局管理器之前完全一样。
例如,在这里,左边是我的菜单,它是椭圆形的,只是变平了,我不知道如何返回它的大小。
能不能展示一下。
你能告诉我如何使我的窗口动态化,但仍将对象留在原处以及如何将图片保留在Frame窗口内,同时保持窗口扩展。
我附上.ui文件:
Apex.ui
<?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>1209</width>
<height>747</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>
<widget class="QFrame" name="frame">
<property name="geometry">
<rect>
<x>40</x>
<y>110</y>
<width>41</width>
<height>581</height>
</rect>
</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>
<widget class="QLabel" name="label_10">
<property name="geometry">
<rect>
<x>-24</x>
<y>530</y>
<width>71</width>
<height>41</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(34, 31, 46);</string>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>../Nikita_Pfeyfer4.png</pixmap>
</property>
</widget>
<widget class="QPushButton" name="menu">
<property name="geometry">
<rect>
<x>5</x>
<y>4</y>
<width>31</width>
<height>31</height>
</rect>
</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>
<widget class="QPushButton" name="spravka">
<property name="geometry">
<rect>
<x>30</x>
<y>530</y>
<width>141</width>
<height>41</height>
</rect>
</property>
<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>
<widget class="QLabel" name="label_9">
<property name="geometry">
<rect>
<x>-30</x>
<y>80</y>
<width>81</width>
<height>31</height>
</rect>
</property>
<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>../Nikita_Pfeyfer2.png</pixmap>
</property>
</widget>
<widget class="QPushButton" name="weapon">
<property name="geometry">
<rect>
<x>50</x>
<y>70</y>
<width>121</width>
<height>41</height>
</rect>
</property>
<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>
</widget>
<widget class="QFrame" name="frame_2">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1211</width>
<height>21</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(46, 43, 63);</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>590</x>
<y>90</y>
<width>231</width>
<height>41</height>
</rect>
</property>
<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>
<widget class="Line" name="line">
<property name="geometry">
<rect>
<x>600</x>
<y>130</y>
<width>241</width>
<height>2</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QFrame" name="frame_3">
<property name="geometry">
<rect>
<x>260</x>
<y>180</y>
<width>261</width>
<height>161</height>
</rect>
</property>
<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>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>70</x>
<y>0</y>
<width>121</width>
<height>41</height>
</rect>
</property>
<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>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>70</x>
<y>60</y>
<width>121</width>
<height>61</height>
</rect>
</property>
<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>
</widget>
<widget class="QTextBrowser" name="textBrowser">
<property name="geometry">
<rect>
<x>570</x>
<y>170</y>
<width>256</width>
<height>351</height>
</rect>
</property>
<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>
<widget class="QFrame" name="frame_4">
<property name="geometry">
<rect>
<x>560</x>
<y>720</y>
<width>201</width>
<height>20</height>
</rect>
</property>
<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>
<widget class="QLabel" name="label_5">
<property name="geometry">
<rect>
<x>50</x>
<y>-2</y>
<width>101</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<family>Bahnschrift SemiBold SemiConden</family>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Всё для вас!</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</widget>
<widget class="QTextBrowser" name="textBrowser_2">
<property name="geometry">
<rect>
<x>260</x>
<y>360</y>
<width>261</width>
<height>161</height>
</rect>
</property>
<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>
<widget class="Line" name="line_2">
<property name="geometry">
<rect>
<x>309</x>
<y>391</y>
<width>161</width>
<height>2</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="Line" name="line_3">
<property name="geometry">
<rect>
<x>331</x>
<y>219</y>
<width>121</width>
<height>2</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QTextBrowser" name="textBrowser_3">
<property name="geometry">
<rect>
<x>870</x>
<y>170</y>
<width>256</width>
<height>351</height>
</rect>
</property>
<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>
<widget class="Line" name="line_4">
<property name="geometry">
<rect>
<x>897</x>
<y>200</y>
<width>201</width>
<height>2</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QPushButton" name="mainmenu">
<property name="geometry">
<rect>
<x>50</x>
<y>20</y>
<width>81</width>
<height>81</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-image: url(:/Fone/Изображения/_Logotip_Proz5.png);
border: 1px solid rgba(255, 255, 255, 0);
</string>
</property>
<property name="text">
<string/>
</property>
</widget>
<zorder>label</zorder>
<zorder>frame_2</zorder>
<zorder>frame</zorder>
<zorder>line</zorder>
<zorder>frame_3</zorder>
<zorder>textBrowser</zorder>
<zorder>frame_4</zorder>
<zorder>textBrowser_2</zorder>
<zorder>line_2</zorder>
<zorder>line_3</zorder>
<zorder>textBrowser_3</zorder>
<zorder>line_4</zorder>
<zorder>mainmenu</zorder>
</widget>
<action name="action">
<property name="text">
<string>справка</string>
</property>
</action>
</widget>
<resources>
<include location="../our/ApexFone.qrc"/>
<include location="../our/menu.qrc"/>
</resources>
<connections/>
</ui>


像这样试试