Я не заметил где вы используете Lay Out in a Grid
.
minimumSize : QSize
Это свойство содержит минимальный размер виджета.
Размер виджета нельзя изменить до меньшего размера, чем минимальный размер виджета.
Размер виджета устанавливается на минимальный размер, если текущий размер меньше.
Минимальный размер, установленный этой функцией, переопределит минимальный размер,
определенный QLayout.
Чтобы сбросить минимальный размер, используйте значение QSize(0, 0).
maximumSize : QSize
Это свойство содержит максимальный размер виджета в пикселях
Размер виджета нельзя изменить до размера, превышающего максимальный размер виджета.
По умолчанию это свойство содержит размер, в котором ширина и высота имеют значения 16777215.
Класс QSizePolicy - это атрибут макета, описывающий политику горизонтального
и вертикального изменения размера.
Каждый виджет возвращает QSizePolicy,
который описывает политику горизонтального и вертикального изменения размера,
которую он предпочитает при разметке.
Вы можете изменить это для определенного виджета, изменив его свойство QWidget::sizePolicy.
main.py
import sys
from PyQt5 import QtCore, QtGui, QtWidgets, uic
baseUIClass, baseUIWidget = uic.loadUiType("proba_1.ui")
class Example(baseUIWidget, baseUIClass):
def __init__(self):
super().__init__()
self.setupUi(self)
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
ex = Example()
ex.show()
sys.exit(app.exec_())
proba_1.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>456</width>
<height>499</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QFrame" name="frame">
<property name="styleSheet">
<string notr="true">background-color: rgb(166, 171, 255);</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QPushButton" name="pushButton">
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(200, 200, 200);</string>
</property>
<property name="text">
<string>Предпросмотр</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="pushButton_2">
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(200, 200, 200);</string>
</property>
<property name="text">
<string>Добавить</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="pushButton_3">
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(200, 200, 200);</string>
</property>
<property name="text">
<string>Удалить</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QPushButton" name="pushButton_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>40</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>100</height>
</size>
</property>
<property name="font">
<font>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(200, 200, 200);</string>
</property>
<property name="text">
<string>Увеличить</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QFrame" name="frame_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(164, 255, 213);</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>456</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>
</ui>

.ui
файла – S. Nick 21 фев '20 в 17:35.ui
файл можете скачать по ссылке: drive.google.com/open?id=17hfBIIcFjP3uu8o0ElbjzgQucUn3N17N – DGDays 22 фев '20 в 3:52