Я пытаюсь отобразить некоторые элементы в Qt Designer, но я не могу это сделать, потому что, несмотря на то, что я правильно размещаю их в .ui, когда я компилирую и запускаю код, пункты неуместны:Qt Designer неправильно сориентированные элементы правильно настроены
Вы можете заметить вышеупомянутые, что образами, что я хочу, в левой части: четыре детали внутри QStackedWidget идеально выровнена с другими предметами, но то, что я получаю то, что в правая часть: все четыре элемента внутри QStackedWidget смещены.
Я старался как можно больше манипулировать переменными, связанными с полями и т. Д., Но я просто не могу понять, почему приложение показывает что-то отличное от того, что было запрограммировано. Любой совет о том, как решить эту проблему?
UPDATE
Добавление следующее изображение, чтобы помочь в комментариях данного ответа ниже:
UPDATE
.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>306</width>
<height>229</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>306</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>306</width>
<height>229</height>
</size>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QGridLayout" name="gridLayout_4">
<item row="3" column="1">
<widget class="QPushButton" name="pbUpdate">
<property name="text">
<string>Update</string>
</property>
</widget>
</item>
<item row="3" column="0">
<spacer name="horizontalSpacer_2">
<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 row="3" column="2">
<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 row="0" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="pbFullUpdate">
<property name="text">
<string>Full update</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pbSingleFile">
<property name="text">
<string>Single file</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>89</width>
<height>17</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0" colspan="3">
<widget class="QStackedWidget" name="swInfo">
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="page">
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Version ID:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QPushButton" name="pbVersionIDIncrease1">
<property name="maximumSize">
<size>
<width>31</width>
<height>31</height>
</size>
</property>
<property name="text">
<string>^</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="pbVersionIDIncrease2">
<property name="maximumSize">
<size>
<width>31</width>
<height>31</height>
</size>
</property>
<property name="text">
<string>^</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="pbVersionIDIncrease3">
<property name="maximumSize">
<size>
<width>31</width>
<height>31</height>
</size>
</property>
<property name="text">
<string>^</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="leID">
<property name="text">
<string>33.4550.1</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<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>
</layout>
</widget>
<widget class="QWidget" name="page_2">
<layout class="QGridLayout" name="gridLayout_2">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="1">
<widget class="QLineEdit" name="leServerAddress">
<property name="minimumSize">
<size>
<width>186</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>186</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Server path:</string>
</property>
<property name="buddy">
<cstring>leServerAddress</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lePathToSave">
<property name="minimumSize">
<size>
<width>186</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>186</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>/mmcblk0p2/</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Path to save:</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Equipment IP:</string>
</property>
<property name="buddy">
<cstring>leEquipmentIP</cstring>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QLineEdit" name="leEquipmentIP">
<property name="minimumSize">
<size>
<width>186</width>
<height>33</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>186</width>
<height>33</height>
</size>
</property>
<property name="text">
<string>10.1.25.10</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QStatusBar" name="statusBar"/>
<action name="actionExit">
<property name="text">
<string>Exit</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<tabstops>
<tabstop>leEquipmentIP</tabstop>
<tabstop>pbUpdate</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
Хорошо, я решил проблему, поставив горизонтальную прокладку между метками и QLineEdits (странно, что я помню, как это решение было принято до этого без успеха). В любом случае, это не отвечает на мой вопрос о том, почему это происходит. – Momergil
Я забыл спросить - какие макеты вы используете внутри сложного виджета для страниц? В моем ответе его макет формы (в картинке для элемента «страница») – nayana