建议:首先观察结果展示,判断是否可以满足你的需求。
目录
1. 问题分析
2. 解决方案
2.1 界面设计
2.2 生成代码
2.3 源码实现
3. 结果展示
1. 问题分析
项目需要显示的窗口数量颇多,主界面中,如果一次性显示全部窗口,那么窗口的大小就会受到限制,满足不了用户需求。显示不同窗口数量时,单个窗口的大小对比,如下所示:
2. 解决方案
为了解决上述问题,设计一个滚动条控制窗口的方案。此方案可以通过垂直滚动条和水平滚动条,控制显示哪几个窗口。实现步骤如下:
2.1 界面设计
使用 Qt Designer 设计界面,注意调整窗口的大小和界面的布局,mainUi.ui 具体如下:
2.2 生成代码
两种代码生成方式:
(1)快捷的生成代码方式,操作如下:
(2)打开CMD >>> 激活环境 >>> 打开指定路径,并切换到指定路径的磁盘 >>> 生成ui的py代码
activate 你的环境
cd D:\YD_project\CSDN\滑动条控制窗口
D:
pyuic5 -o mainUi.py mainUi.ui
生成的 mainUi.py 代码如下:
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mainUi.ui'
#
# Created by: PyQt5 UI code generator 5.15.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1138, 845)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setMinimumSize(QtCore.QSize(0, 0))
self.centralwidget.setMaximumSize(QtCore.QSize(1920, 1080))
self.centralwidget.setObjectName("centralwidget")
self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
self.verticalLayout.setObjectName("verticalLayout")
self.gridLayout_52 = QtWidgets.QGridLayout()
self.gridLayout_52.setObjectName("gridLayout_52")
self.gridLayout_51 = QtWidgets.QGridLayout()
self.gridLayout_51.setObjectName("gridLayout_51")
self.frame_24 = QtWidgets.QFrame(self.centralwidget)
self.frame_24.setMinimumSize(QtCore.QSize(60, 90))
self.frame_24.setMaximumSize(QtCore.QSize(400, 600))
self.frame_24.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_24.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_24.setObjectName("frame_24")
self.gridLayout_24 = QtWidgets.QGridLayout(self.frame_24)
self.gridLayout_24.setContentsMargins(0, 0, 0, 0)
self.gridLayout_24.setObjectName("gridLayout_24")
self.label_24 = QtWidgets.QLabel(self.frame_24)
self.label_24.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_24.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_24.setAlignment(QtCore.Qt.AlignCenter)
self.label_24.setObjectName("label_24")
self.gridLayout_24.addWidget(self.label_24, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_24, 2, 3, 1, 1)
self.frame_36 = QtWidgets.QFrame(self.centralwidget)
self.frame_36.setMinimumSize(QtCore.QSize(60, 90))
self.frame_36.setMaximumSize(QtCore.QSize(400, 600))
self.frame_36.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_36.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_36.setObjectName("frame_36")
self.gridLayout_36 = QtWidgets.QGridLayout(self.frame_36)
self.gridLayout_36.setContentsMargins(0, 0, 0, 0)
self.gridLayout_36.setObjectName("gridLayout_36")
self.label_36 = QtWidgets.QLabel(self.frame_36)
self.label_36.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_36.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_36.setAlignment(QtCore.Qt.AlignCenter)
self.label_36.setObjectName("label_36")
self.gridLayout_36.addWidget(self.label_36, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_36, 3, 5, 1, 1)
self.frame_14 = QtWidgets.QFrame(self.centralwidget)
self.frame_14.setMinimumSize(QtCore.QSize(60, 90))
self.frame_14.setMaximumSize(QtCore.QSize(400, 600))
self.frame_14.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_14.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_14.setObjectName("frame_14")
self.gridLayout_14 = QtWidgets.QGridLayout(self.frame_14)
self.gridLayout_14.setContentsMargins(0, 0, 0, 0)
self.gridLayout_14.setObjectName("gridLayout_14")
self.label_14 = QtWidgets.QLabel(self.frame_14)
self.label_14.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_14.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_14.setAlignment(QtCore.Qt.AlignCenter)
self.label_14.setObjectName("label_14")
self.gridLayout_14.addWidget(self.label_14, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_14, 1, 3, 1, 1)
self.frame_2 = QtWidgets.QFrame(self.centralwidget)
self.frame_2.setMinimumSize(QtCore.QSize(60, 90))
self.frame_2.setMaximumSize(QtCore.QSize(400, 600))
self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_2.setObjectName("frame_2")
self.gridLayout_2 = QtWidgets.QGridLayout(self.frame_2)
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
self.gridLayout_2.setObjectName("gridLayout_2")
self.label_2 = QtWidgets.QLabel(self.frame_2)
self.label_2.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_2.setSizeIncrement(QtCore.QSize(500, 500))
self.label_2.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_2.setAlignment(QtCore.Qt.AlignCenter)
self.label_2.setObjectName("label_2")
self.gridLayout_2.addWidget(self.label_2, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_2, 0, 1, 1, 1)
self.frame_11 = QtWidgets.QFrame(self.centralwidget)
self.frame_11.setMinimumSize(QtCore.QSize(60, 90))
self.frame_11.setMaximumSize(QtCore.QSize(400, 600))
self.frame_11.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_11.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_11.setObjectName("frame_11")
self.gridLayout_11 = QtWidgets.QGridLayout(self.frame_11)
self.gridLayout_11.setContentsMargins(0, 0, 0, 0)
self.gridLayout_11.setObjectName("gridLayout_11")
self.label_11 = QtWidgets.QLabel(self.frame_11)
self.label_11.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_11.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_11.setAlignment(QtCore.Qt.AlignCenter)
self.label_11.setObjectName("label_11")
self.gridLayout_11.addWidget(self.label_11, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_11, 1, 0, 1, 1)
self.frame_9 = QtWidgets.QFrame(self.centralwidget)
self.frame_9.setMinimumSize(QtCore.QSize(60, 90))
self.frame_9.setMaximumSize(QtCore.QSize(400, 600))
self.frame_9.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_9.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_9.setObjectName("frame_9")
self.gridLayout_9 = QtWidgets.QGridLayout(self.frame_9)
self.gridLayout_9.setContentsMargins(0, 0, 0, 0)
self.gridLayout_9.setObjectName("gridLayout_9")
self.label_9 = QtWidgets.QLabel(self.frame_9)
self.label_9.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_9.setSizeIncrement(QtCore.QSize(500, 500))
self.label_9.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_9.setAlignment(QtCore.Qt.AlignCenter)
self.label_9.setObjectName("label_9")
self.gridLayout_9.addWidget(self.label_9, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_9, 0, 8, 1, 1)
self.frame_4 = QtWidgets.QFrame(self.centralwidget)
self.frame_4.setMinimumSize(QtCore.QSize(60, 90))
self.frame_4.setMaximumSize(QtCore.QSize(400, 600))
self.frame_4.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_4.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_4.setObjectName("frame_4")
self.gridLayout_4 = QtWidgets.QGridLayout(self.frame_4)
self.gridLayout_4.setContentsMargins(0, 0, 0, 0)
self.gridLayout_4.setObjectName("gridLayout_4")
self.label_4 = QtWidgets.QLabel(self.frame_4)
self.label_4.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_4.setSizeIncrement(QtCore.QSize(500, 500))
self.label_4.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_4.setAlignment(QtCore.Qt.AlignCenter)
self.label_4.setObjectName("label_4")
self.gridLayout_4.addWidget(self.label_4, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_4, 0, 3, 1, 1)
self.frame_17 = QtWidgets.QFrame(self.centralwidget)
self.frame_17.setMinimumSize(QtCore.QSize(60, 90))
self.frame_17.setMaximumSize(QtCore.QSize(400, 600))
self.frame_17.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_17.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_17.setObjectName("frame_17")
self.gridLayout_17 = QtWidgets.QGridLayout(self.frame_17)
self.gridLayout_17.setContentsMargins(0, 0, 0, 0)
self.gridLayout_17.setObjectName("gridLayout_17")
self.label_17 = QtWidgets.QLabel(self.frame_17)
self.label_17.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_17.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_17.setAlignment(QtCore.Qt.AlignCenter)
self.label_17.setObjectName("label_17")
self.gridLayout_17.addWidget(self.label_17, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_17, 1, 6, 1, 1)
self.frame_29 = QtWidgets.QFrame(self.centralwidget)
self.frame_29.setMinimumSize(QtCore.QSize(60, 90))
self.frame_29.setMaximumSize(QtCore.QSize(400, 600))
self.frame_29.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_29.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_29.setObjectName("frame_29")
self.gridLayout_29 = QtWidgets.QGridLayout(self.frame_29)
self.gridLayout_29.setContentsMargins(0, 0, 0, 0)
self.gridLayout_29.setObjectName("gridLayout_29")
self.label_29 = QtWidgets.QLabel(self.frame_29)
self.label_29.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_29.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_29.setAlignment(QtCore.Qt.AlignCenter)
self.label_29.setObjectName("label_29")
self.gridLayout_29.addWidget(self.label_29, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_29, 2, 8, 1, 1)
self.frame_26 = QtWidgets.QFrame(self.centralwidget)
self.frame_26.setMinimumSize(QtCore.QSize(60, 90))
self.frame_26.setMaximumSize(QtCore.QSize(400, 600))
self.frame_26.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_26.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_26.setObjectName("frame_26")
self.gridLayout_26 = QtWidgets.QGridLayout(self.frame_26)
self.gridLayout_26.setContentsMargins(0, 0, 0, 0)
self.gridLayout_26.setObjectName("gridLayout_26")
self.label_26 = QtWidgets.QLabel(self.frame_26)
self.label_26.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_26.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_26.setAlignment(QtCore.Qt.AlignCenter)
self.label_26.setObjectName("label_26")
self.gridLayout_26.addWidget(self.label_26, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_26, 2, 5, 1, 1)
self.frame_21 = QtWidgets.QFrame(self.centralwidget)
self.frame_21.setMinimumSize(QtCore.QSize(60, 90))
self.frame_21.setMaximumSize(QtCore.QSize(400, 600))
self.frame_21.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_21.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_21.setObjectName("frame_21")
self.gridLayout_21 = QtWidgets.QGridLayout(self.frame_21)
self.gridLayout_21.setContentsMargins(0, 0, 0, 0)
self.gridLayout_21.setObjectName("gridLayout_21")
self.label_21 = QtWidgets.QLabel(self.frame_21)
self.label_21.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_21.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_21.setAlignment(QtCore.Qt.AlignCenter)
self.label_21.setObjectName("label_21")
self.gridLayout_21.addWidget(self.label_21, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_21, 2, 0, 1, 1)
self.frame_32 = QtWidgets.QFrame(self.centralwidget)
self.frame_32.setMinimumSize(QtCore.QSize(60, 90))
self.frame_32.setMaximumSize(QtCore.QSize(400, 600))
self.frame_32.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_32.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_32.setObjectName("frame_32")
self.gridLayout_32 = QtWidgets.QGridLayout(self.frame_32)
self.gridLayout_32.setContentsMargins(0, 0, 0, 0)
self.gridLayout_32.setObjectName("gridLayout_32")
self.label_32 = QtWidgets.QLabel(self.frame_32)
self.label_32.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_32.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_32.setAlignment(QtCore.Qt.AlignCenter)
self.label_32.setObjectName("label_32")
self.gridLayout_32.addWidget(self.label_32, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_32, 3, 1, 1, 1)
self.frame_48 = QtWidgets.QFrame(self.centralwidget)
self.frame_48.setMinimumSize(QtCore.QSize(60, 90))
self.frame_48.setMaximumSize(QtCore.QSize(400, 600))
self.frame_48.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_48.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_48.setObjectName("frame_48")
self.gridLayout_48 = QtWidgets.QGridLayout(self.frame_48)
self.gridLayout_48.setContentsMargins(0, 0, 0, 0)
self.gridLayout_48.setObjectName("gridLayout_48")
self.label_48 = QtWidgets.QLabel(self.frame_48)
self.label_48.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_48.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_48.setAlignment(QtCore.Qt.AlignCenter)
self.label_48.setObjectName("label_48")
self.gridLayout_48.addWidget(self.label_48, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_48, 4, 7, 1, 1)
self.frame_43 = QtWidgets.QFrame(self.centralwidget)
self.frame_43.setMinimumSize(QtCore.QSize(60, 90))
self.frame_43.setMaximumSize(QtCore.QSize(400, 600))
self.frame_43.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_43.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_43.setObjectName("frame_43")
self.gridLayout_43 = QtWidgets.QGridLayout(self.frame_43)
self.gridLayout_43.setContentsMargins(0, 0, 0, 0)
self.gridLayout_43.setObjectName("gridLayout_43")
self.label_43 = QtWidgets.QLabel(self.frame_43)
self.label_43.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_43.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_43.setAlignment(QtCore.Qt.AlignCenter)
self.label_43.setObjectName("label_43")
self.gridLayout_43.addWidget(self.label_43, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_43, 4, 2, 1, 1)
self.frame_35 = QtWidgets.QFrame(self.centralwidget)
self.frame_35.setMinimumSize(QtCore.QSize(60, 90))
self.frame_35.setMaximumSize(QtCore.QSize(400, 600))
self.frame_35.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_35.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_35.setObjectName("frame_35")
self.gridLayout_35 = QtWidgets.QGridLayout(self.frame_35)
self.gridLayout_35.setContentsMargins(0, 0, 0, 0)
self.gridLayout_35.setObjectName("gridLayout_35")
self.label_35 = QtWidgets.QLabel(self.frame_35)
self.label_35.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_35.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_35.setAlignment(QtCore.Qt.AlignCenter)
self.label_35.setObjectName("label_35")
self.gridLayout_35.addWidget(self.label_35, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_35, 3, 4, 1, 1)
self.frame_7 = QtWidgets.QFrame(self.centralwidget)
self.frame_7.setMinimumSize(QtCore.QSize(60, 90))
self.frame_7.setMaximumSize(QtCore.QSize(400, 600))
self.frame_7.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_7.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_7.setObjectName("frame_7")
self.gridLayout_7 = QtWidgets.QGridLayout(self.frame_7)
self.gridLayout_7.setContentsMargins(0, 0, 0, 0)
self.gridLayout_7.setObjectName("gridLayout_7")
self.label_7 = QtWidgets.QLabel(self.frame_7)
self.label_7.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_7.setSizeIncrement(QtCore.QSize(500, 500))
self.label_7.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_7.setAlignment(QtCore.Qt.AlignCenter)
self.label_7.setObjectName("label_7")
self.gridLayout_7.addWidget(self.label_7, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_7, 0, 6, 1, 1)
self.frame_12 = QtWidgets.QFrame(self.centralwidget)
self.frame_12.setMinimumSize(QtCore.QSize(60, 90))
self.frame_12.setMaximumSize(QtCore.QSize(400, 600))
self.frame_12.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_12.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_12.setObjectName("frame_12")
self.gridLayout_12 = QtWidgets.QGridLayout(self.frame_12)
self.gridLayout_12.setContentsMargins(0, 0, 0, 0)
self.gridLayout_12.setObjectName("gridLayout_12")
self.label_12 = QtWidgets.QLabel(self.frame_12)
self.label_12.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_12.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_12.setAlignment(QtCore.Qt.AlignCenter)
self.label_12.setObjectName("label_12")
self.gridLayout_12.addWidget(self.label_12, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_12, 1, 1, 1, 1)
self.frame_30 = QtWidgets.QFrame(self.centralwidget)
self.frame_30.setMinimumSize(QtCore.QSize(60, 90))
self.frame_30.setMaximumSize(QtCore.QSize(400, 600))
self.frame_30.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_30.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_30.setObjectName("frame_30")
self.gridLayout_30 = QtWidgets.QGridLayout(self.frame_30)
self.gridLayout_30.setContentsMargins(0, 0, 0, 0)
self.gridLayout_30.setObjectName("gridLayout_30")
self.label_30 = QtWidgets.QLabel(self.frame_30)
self.label_30.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_30.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_30.setAlignment(QtCore.Qt.AlignCenter)
self.label_30.setObjectName("label_30")
self.gridLayout_30.addWidget(self.label_30, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_30, 2, 9, 1, 1)
self.frame = QtWidgets.QFrame(self.centralwidget)
self.frame.setMinimumSize(QtCore.QSize(60, 90))
self.frame.setMaximumSize(QtCore.QSize(400, 600))
self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame.setObjectName("frame")
self.gridLayout = QtWidgets.QGridLayout(self.frame)
self.gridLayout.setContentsMargins(0, 0, 0, 0)
self.gridLayout.setHorizontalSpacing(6)
self.gridLayout.setObjectName("gridLayout")
self.label_1 = QtWidgets.QLabel(self.frame)
self.label_1.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_1.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_1.setAlignment(QtCore.Qt.AlignCenter)
self.label_1.setObjectName("label_1")
self.gridLayout.addWidget(self.label_1, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame, 0, 0, 1, 1)
self.frame_25 = QtWidgets.QFrame(self.centralwidget)
self.frame_25.setMinimumSize(QtCore.QSize(60, 90))
self.frame_25.setMaximumSize(QtCore.QSize(400, 600))
self.frame_25.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_25.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_25.setObjectName("frame_25")
self.gridLayout_25 = QtWidgets.QGridLayout(self.frame_25)
self.gridLayout_25.setContentsMargins(0, 0, 0, 0)
self.gridLayout_25.setObjectName("gridLayout_25")
self.label_25 = QtWidgets.QLabel(self.frame_25)
self.label_25.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_25.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_25.setAlignment(QtCore.Qt.AlignCenter)
self.label_25.setObjectName("label_25")
self.gridLayout_25.addWidget(self.label_25, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_25, 2, 4, 1, 1)
self.frame_19 = QtWidgets.QFrame(self.centralwidget)
self.frame_19.setMinimumSize(QtCore.QSize(60, 90))
self.frame_19.setMaximumSize(QtCore.QSize(400, 600))
self.frame_19.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_19.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_19.setObjectName("frame_19")
self.gridLayout_19 = QtWidgets.QGridLayout(self.frame_19)
self.gridLayout_19.setContentsMargins(0, 0, 0, 0)
self.gridLayout_19.setObjectName("gridLayout_19")
self.label_19 = QtWidgets.QLabel(self.frame_19)
self.label_19.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_19.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_19.setAlignment(QtCore.Qt.AlignCenter)
self.label_19.setObjectName("label_19")
self.gridLayout_19.addWidget(self.label_19, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_19, 1, 8, 1, 1)
self.frame_3 = QtWidgets.QFrame(self.centralwidget)
self.frame_3.setMinimumSize(QtCore.QSize(60, 90))
self.frame_3.setMaximumSize(QtCore.QSize(400, 600))
self.frame_3.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_3.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_3.setObjectName("frame_3")
self.gridLayout_3 = QtWidgets.QGridLayout(self.frame_3)
self.gridLayout_3.setContentsMargins(0, 0, 0, 0)
self.gridLayout_3.setObjectName("gridLayout_3")
self.label_3 = QtWidgets.QLabel(self.frame_3)
self.label_3.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_3.setSizeIncrement(QtCore.QSize(500, 500))
self.label_3.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_3.setAlignment(QtCore.Qt.AlignCenter)
self.label_3.setObjectName("label_3")
self.gridLayout_3.addWidget(self.label_3, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_3, 0, 2, 1, 1)
self.frame_5 = QtWidgets.QFrame(self.centralwidget)
self.frame_5.setMinimumSize(QtCore.QSize(60, 90))
self.frame_5.setMaximumSize(QtCore.QSize(400, 600))
self.frame_5.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_5.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_5.setObjectName("frame_5")
self.gridLayout_5 = QtWidgets.QGridLayout(self.frame_5)
self.gridLayout_5.setContentsMargins(0, 0, 0, 0)
self.gridLayout_5.setObjectName("gridLayout_5")
self.label_5 = QtWidgets.QLabel(self.frame_5)
self.label_5.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_5.setSizeIncrement(QtCore.QSize(500, 500))
self.label_5.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_5.setAlignment(QtCore.Qt.AlignCenter)
self.label_5.setObjectName("label_5")
self.gridLayout_5.addWidget(self.label_5, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_5, 0, 4, 1, 1)
self.frame_40 = QtWidgets.QFrame(self.centralwidget)
self.frame_40.setMinimumSize(QtCore.QSize(60, 90))
self.frame_40.setMaximumSize(QtCore.QSize(400, 600))
self.frame_40.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_40.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_40.setObjectName("frame_40")
self.gridLayout_40 = QtWidgets.QGridLayout(self.frame_40)
self.gridLayout_40.setContentsMargins(0, 0, 0, 0)
self.gridLayout_40.setObjectName("gridLayout_40")
self.label_40 = QtWidgets.QLabel(self.frame_40)
self.label_40.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_40.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_40.setAlignment(QtCore.Qt.AlignCenter)
self.label_40.setObjectName("label_40")
self.gridLayout_40.addWidget(self.label_40, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_40, 3, 9, 1, 1)
self.frame_34 = QtWidgets.QFrame(self.centralwidget)
self.frame_34.setMinimumSize(QtCore.QSize(60, 90))
self.frame_34.setMaximumSize(QtCore.QSize(400, 600))
self.frame_34.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_34.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_34.setObjectName("frame_34")
self.gridLayout_34 = QtWidgets.QGridLayout(self.frame_34)
self.gridLayout_34.setContentsMargins(0, 0, 0, 0)
self.gridLayout_34.setObjectName("gridLayout_34")
self.label_34 = QtWidgets.QLabel(self.frame_34)
self.label_34.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_34.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_34.setAlignment(QtCore.Qt.AlignCenter)
self.label_34.setObjectName("label_34")
self.gridLayout_34.addWidget(self.label_34, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_34, 3, 3, 1, 1)
self.frame_38 = QtWidgets.QFrame(self.centralwidget)
self.frame_38.setMinimumSize(QtCore.QSize(60, 90))
self.frame_38.setMaximumSize(QtCore.QSize(400, 600))
self.frame_38.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_38.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_38.setObjectName("frame_38")
self.gridLayout_38 = QtWidgets.QGridLayout(self.frame_38)
self.gridLayout_38.setContentsMargins(0, 0, 0, 0)
self.gridLayout_38.setObjectName("gridLayout_38")
self.label_38 = QtWidgets.QLabel(self.frame_38)
self.label_38.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_38.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_38.setAlignment(QtCore.Qt.AlignCenter)
self.label_38.setObjectName("label_38")
self.gridLayout_38.addWidget(self.label_38, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_38, 3, 7, 1, 1)
self.frame_27 = QtWidgets.QFrame(self.centralwidget)
self.frame_27.setMinimumSize(QtCore.QSize(60, 90))
self.frame_27.setMaximumSize(QtCore.QSize(400, 600))
self.frame_27.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_27.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_27.setObjectName("frame_27")
self.gridLayout_27 = QtWidgets.QGridLayout(self.frame_27)
self.gridLayout_27.setContentsMargins(0, 0, 0, 0)
self.gridLayout_27.setObjectName("gridLayout_27")
self.label_27 = QtWidgets.QLabel(self.frame_27)
self.label_27.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_27.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_27.setAlignment(QtCore.Qt.AlignCenter)
self.label_27.setObjectName("label_27")
self.gridLayout_27.addWidget(self.label_27, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_27, 2, 6, 1, 1)
self.frame_33 = QtWidgets.QFrame(self.centralwidget)
self.frame_33.setMinimumSize(QtCore.QSize(60, 90))
self.frame_33.setMaximumSize(QtCore.QSize(400, 600))
self.frame_33.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_33.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_33.setObjectName("frame_33")
self.gridLayout_33 = QtWidgets.QGridLayout(self.frame_33)
self.gridLayout_33.setContentsMargins(0, 0, 0, 0)
self.gridLayout_33.setObjectName("gridLayout_33")
self.label_33 = QtWidgets.QLabel(self.frame_33)
self.label_33.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_33.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_33.setAlignment(QtCore.Qt.AlignCenter)
self.label_33.setObjectName("label_33")
self.gridLayout_33.addWidget(self.label_33, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_33, 3, 2, 1, 1)
self.frame_50 = QtWidgets.QFrame(self.centralwidget)
self.frame_50.setMinimumSize(QtCore.QSize(60, 90))
self.frame_50.setMaximumSize(QtCore.QSize(400, 600))
self.frame_50.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_50.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_50.setObjectName("frame_50")
self.gridLayout_50 = QtWidgets.QGridLayout(self.frame_50)
self.gridLayout_50.setContentsMargins(0, 0, 0, 0)
self.gridLayout_50.setObjectName("gridLayout_50")
self.label_50 = QtWidgets.QLabel(self.frame_50)
self.label_50.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_50.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_50.setAlignment(QtCore.Qt.AlignCenter)
self.label_50.setObjectName("label_50")
self.gridLayout_50.addWidget(self.label_50, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_50, 4, 9, 1, 1)
self.frame_13 = QtWidgets.QFrame(self.centralwidget)
self.frame_13.setMinimumSize(QtCore.QSize(60, 90))
self.frame_13.setMaximumSize(QtCore.QSize(400, 600))
self.frame_13.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_13.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_13.setObjectName("frame_13")
self.gridLayout_13 = QtWidgets.QGridLayout(self.frame_13)
self.gridLayout_13.setContentsMargins(0, 0, 0, 0)
self.gridLayout_13.setObjectName("gridLayout_13")
self.label_13 = QtWidgets.QLabel(self.frame_13)
self.label_13.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_13.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_13.setAlignment(QtCore.Qt.AlignCenter)
self.label_13.setObjectName("label_13")
self.gridLayout_13.addWidget(self.label_13, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_13, 1, 2, 1, 1)
self.frame_44 = QtWidgets.QFrame(self.centralwidget)
self.frame_44.setMinimumSize(QtCore.QSize(60, 90))
self.frame_44.setMaximumSize(QtCore.QSize(400, 600))
self.frame_44.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_44.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_44.setObjectName("frame_44")
self.gridLayout_44 = QtWidgets.QGridLayout(self.frame_44)
self.gridLayout_44.setContentsMargins(0, 0, 0, 0)
self.gridLayout_44.setObjectName("gridLayout_44")
self.label_44 = QtWidgets.QLabel(self.frame_44)
self.label_44.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_44.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_44.setAlignment(QtCore.Qt.AlignCenter)
self.label_44.setObjectName("label_44")
self.gridLayout_44.addWidget(self.label_44, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_44, 4, 3, 1, 1)
self.frame_45 = QtWidgets.QFrame(self.centralwidget)
self.frame_45.setMinimumSize(QtCore.QSize(60, 90))
self.frame_45.setMaximumSize(QtCore.QSize(400, 600))
self.frame_45.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_45.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_45.setObjectName("frame_45")
self.gridLayout_45 = QtWidgets.QGridLayout(self.frame_45)
self.gridLayout_45.setContentsMargins(0, 0, 0, 0)
self.gridLayout_45.setObjectName("gridLayout_45")
self.label_45 = QtWidgets.QLabel(self.frame_45)
self.label_45.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_45.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_45.setAlignment(QtCore.Qt.AlignCenter)
self.label_45.setObjectName("label_45")
self.gridLayout_45.addWidget(self.label_45, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_45, 4, 4, 1, 1)
self.frame_37 = QtWidgets.QFrame(self.centralwidget)
self.frame_37.setMinimumSize(QtCore.QSize(60, 90))
self.frame_37.setMaximumSize(QtCore.QSize(400, 600))
self.frame_37.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_37.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_37.setObjectName("frame_37")
self.gridLayout_37 = QtWidgets.QGridLayout(self.frame_37)
self.gridLayout_37.setContentsMargins(0, 0, 0, 0)
self.gridLayout_37.setObjectName("gridLayout_37")
self.label_37 = QtWidgets.QLabel(self.frame_37)
self.label_37.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_37.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_37.setAlignment(QtCore.Qt.AlignCenter)
self.label_37.setObjectName("label_37")
self.gridLayout_37.addWidget(self.label_37, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_37, 3, 6, 1, 1)
self.frame_42 = QtWidgets.QFrame(self.centralwidget)
self.frame_42.setMinimumSize(QtCore.QSize(60, 90))
self.frame_42.setMaximumSize(QtCore.QSize(400, 600))
self.frame_42.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_42.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_42.setObjectName("frame_42")
self.gridLayout_42 = QtWidgets.QGridLayout(self.frame_42)
self.gridLayout_42.setContentsMargins(0, 0, 0, 0)
self.gridLayout_42.setObjectName("gridLayout_42")
self.label_42 = QtWidgets.QLabel(self.frame_42)
self.label_42.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_42.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_42.setAlignment(QtCore.Qt.AlignCenter)
self.label_42.setObjectName("label_42")
self.gridLayout_42.addWidget(self.label_42, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_42, 4, 1, 1, 1)
self.frame_47 = QtWidgets.QFrame(self.centralwidget)
self.frame_47.setMinimumSize(QtCore.QSize(60, 90))
self.frame_47.setMaximumSize(QtCore.QSize(400, 600))
self.frame_47.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_47.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_47.setObjectName("frame_47")
self.gridLayout_47 = QtWidgets.QGridLayout(self.frame_47)
self.gridLayout_47.setContentsMargins(0, 0, 0, 0)
self.gridLayout_47.setObjectName("gridLayout_47")
self.label_47 = QtWidgets.QLabel(self.frame_47)
self.label_47.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_47.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_47.setAlignment(QtCore.Qt.AlignCenter)
self.label_47.setObjectName("label_47")
self.gridLayout_47.addWidget(self.label_47, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_47, 4, 6, 1, 1)
self.frame_31 = QtWidgets.QFrame(self.centralwidget)
self.frame_31.setMinimumSize(QtCore.QSize(60, 90))
self.frame_31.setMaximumSize(QtCore.QSize(400, 600))
self.frame_31.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_31.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_31.setObjectName("frame_31")
self.gridLayout_31 = QtWidgets.QGridLayout(self.frame_31)
self.gridLayout_31.setContentsMargins(0, 0, 0, 0)
self.gridLayout_31.setObjectName("gridLayout_31")
self.label_31 = QtWidgets.QLabel(self.frame_31)
self.label_31.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_31.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_31.setAlignment(QtCore.Qt.AlignCenter)
self.label_31.setObjectName("label_31")
self.gridLayout_31.addWidget(self.label_31, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_31, 3, 0, 1, 1)
self.frame_28 = QtWidgets.QFrame(self.centralwidget)
self.frame_28.setMinimumSize(QtCore.QSize(60, 90))
self.frame_28.setMaximumSize(QtCore.QSize(400, 600))
self.frame_28.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_28.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_28.setObjectName("frame_28")
self.gridLayout_28 = QtWidgets.QGridLayout(self.frame_28)
self.gridLayout_28.setContentsMargins(0, 0, 0, 0)
self.gridLayout_28.setObjectName("gridLayout_28")
self.label_28 = QtWidgets.QLabel(self.frame_28)
self.label_28.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_28.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_28.setAlignment(QtCore.Qt.AlignCenter)
self.label_28.setObjectName("label_28")
self.gridLayout_28.addWidget(self.label_28, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_28, 2, 7, 1, 1)
self.frame_20 = QtWidgets.QFrame(self.centralwidget)
self.frame_20.setMinimumSize(QtCore.QSize(60, 90))
self.frame_20.setMaximumSize(QtCore.QSize(400, 600))
self.frame_20.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_20.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_20.setObjectName("frame_20")
self.gridLayout_20 = QtWidgets.QGridLayout(self.frame_20)
self.gridLayout_20.setContentsMargins(0, 0, 0, 0)
self.gridLayout_20.setObjectName("gridLayout_20")
self.label_20 = QtWidgets.QLabel(self.frame_20)
self.label_20.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_20.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_20.setAlignment(QtCore.Qt.AlignCenter)
self.label_20.setObjectName("label_20")
self.gridLayout_20.addWidget(self.label_20, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_20, 1, 9, 1, 1)
self.frame_39 = QtWidgets.QFrame(self.centralwidget)
self.frame_39.setMinimumSize(QtCore.QSize(60, 90))
self.frame_39.setMaximumSize(QtCore.QSize(400, 600))
self.frame_39.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_39.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_39.setObjectName("frame_39")
self.gridLayout_39 = QtWidgets.QGridLayout(self.frame_39)
self.gridLayout_39.setContentsMargins(0, 0, 0, 0)
self.gridLayout_39.setObjectName("gridLayout_39")
self.label_39 = QtWidgets.QLabel(self.frame_39)
self.label_39.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_39.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_39.setAlignment(QtCore.Qt.AlignCenter)
self.label_39.setObjectName("label_39")
self.gridLayout_39.addWidget(self.label_39, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_39, 3, 8, 1, 1)
self.frame_15 = QtWidgets.QFrame(self.centralwidget)
self.frame_15.setMinimumSize(QtCore.QSize(60, 90))
self.frame_15.setMaximumSize(QtCore.QSize(400, 600))
self.frame_15.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_15.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_15.setObjectName("frame_15")
self.gridLayout_15 = QtWidgets.QGridLayout(self.frame_15)
self.gridLayout_15.setContentsMargins(0, 0, 0, 0)
self.gridLayout_15.setObjectName("gridLayout_15")
self.label_15 = QtWidgets.QLabel(self.frame_15)
self.label_15.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_15.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_15.setAlignment(QtCore.Qt.AlignCenter)
self.label_15.setObjectName("label_15")
self.gridLayout_15.addWidget(self.label_15, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_15, 1, 4, 1, 1)
self.frame_6 = QtWidgets.QFrame(self.centralwidget)
self.frame_6.setMinimumSize(QtCore.QSize(60, 90))
self.frame_6.setMaximumSize(QtCore.QSize(400, 600))
self.frame_6.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_6.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_6.setObjectName("frame_6")
self.gridLayout_6 = QtWidgets.QGridLayout(self.frame_6)
self.gridLayout_6.setContentsMargins(0, 0, 0, 0)
self.gridLayout_6.setObjectName("gridLayout_6")
self.label_6 = QtWidgets.QLabel(self.frame_6)
self.label_6.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_6.setSizeIncrement(QtCore.QSize(500, 500))
self.label_6.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_6.setAlignment(QtCore.Qt.AlignCenter)
self.label_6.setObjectName("label_6")
self.gridLayout_6.addWidget(self.label_6, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_6, 0, 5, 1, 1)
self.frame_10 = QtWidgets.QFrame(self.centralwidget)
self.frame_10.setMinimumSize(QtCore.QSize(60, 90))
self.frame_10.setMaximumSize(QtCore.QSize(400, 600))
self.frame_10.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_10.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_10.setObjectName("frame_10")
self.gridLayout_10 = QtWidgets.QGridLayout(self.frame_10)
self.gridLayout_10.setContentsMargins(0, 0, 0, 0)
self.gridLayout_10.setObjectName("gridLayout_10")
self.label_10 = QtWidgets.QLabel(self.frame_10)
self.label_10.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_10.setSizeIncrement(QtCore.QSize(500, 500))
self.label_10.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_10.setAlignment(QtCore.Qt.AlignCenter)
self.label_10.setObjectName("label_10")
self.gridLayout_10.addWidget(self.label_10, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_10, 0, 9, 1, 1)
self.frame_41 = QtWidgets.QFrame(self.centralwidget)
self.frame_41.setMinimumSize(QtCore.QSize(60, 90))
self.frame_41.setMaximumSize(QtCore.QSize(400, 600))
self.frame_41.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_41.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_41.setObjectName("frame_41")
self.gridLayout_41 = QtWidgets.QGridLayout(self.frame_41)
self.gridLayout_41.setContentsMargins(0, 0, 0, 0)
self.gridLayout_41.setObjectName("gridLayout_41")
self.label_41 = QtWidgets.QLabel(self.frame_41)
self.label_41.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_41.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_41.setAlignment(QtCore.Qt.AlignCenter)
self.label_41.setObjectName("label_41")
self.gridLayout_41.addWidget(self.label_41, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_41, 4, 0, 1, 1)
self.frame_16 = QtWidgets.QFrame(self.centralwidget)
self.frame_16.setMinimumSize(QtCore.QSize(60, 90))
self.frame_16.setMaximumSize(QtCore.QSize(400, 600))
self.frame_16.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_16.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_16.setObjectName("frame_16")
self.gridLayout_16 = QtWidgets.QGridLayout(self.frame_16)
self.gridLayout_16.setContentsMargins(0, 0, 0, 0)
self.gridLayout_16.setObjectName("gridLayout_16")
self.label_16 = QtWidgets.QLabel(self.frame_16)
self.label_16.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_16.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_16.setAlignment(QtCore.Qt.AlignCenter)
self.label_16.setObjectName("label_16")
self.gridLayout_16.addWidget(self.label_16, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_16, 1, 5, 1, 1)
self.frame_22 = QtWidgets.QFrame(self.centralwidget)
self.frame_22.setMinimumSize(QtCore.QSize(60, 90))
self.frame_22.setMaximumSize(QtCore.QSize(400, 600))
self.frame_22.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_22.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_22.setObjectName("frame_22")
self.gridLayout_22 = QtWidgets.QGridLayout(self.frame_22)
self.gridLayout_22.setContentsMargins(0, 0, 0, 0)
self.gridLayout_22.setObjectName("gridLayout_22")
self.label_22 = QtWidgets.QLabel(self.frame_22)
self.label_22.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_22.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_22.setAlignment(QtCore.Qt.AlignCenter)
self.label_22.setObjectName("label_22")
self.gridLayout_22.addWidget(self.label_22, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_22, 2, 1, 1, 1)
self.frame_23 = QtWidgets.QFrame(self.centralwidget)
self.frame_23.setMinimumSize(QtCore.QSize(60, 90))
self.frame_23.setMaximumSize(QtCore.QSize(400, 600))
self.frame_23.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_23.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_23.setObjectName("frame_23")
self.gridLayout_23 = QtWidgets.QGridLayout(self.frame_23)
self.gridLayout_23.setContentsMargins(0, 0, 0, 0)
self.gridLayout_23.setObjectName("gridLayout_23")
self.label_23 = QtWidgets.QLabel(self.frame_23)
self.label_23.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_23.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_23.setAlignment(QtCore.Qt.AlignCenter)
self.label_23.setObjectName("label_23")
self.gridLayout_23.addWidget(self.label_23, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_23, 2, 2, 1, 1)
self.frame_8 = QtWidgets.QFrame(self.centralwidget)
self.frame_8.setMinimumSize(QtCore.QSize(60, 90))
self.frame_8.setMaximumSize(QtCore.QSize(400, 600))
self.frame_8.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_8.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_8.setObjectName("frame_8")
self.gridLayout_8 = QtWidgets.QGridLayout(self.frame_8)
self.gridLayout_8.setContentsMargins(0, 0, 0, 0)
self.gridLayout_8.setObjectName("gridLayout_8")
self.label_8 = QtWidgets.QLabel(self.frame_8)
self.label_8.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_8.setSizeIncrement(QtCore.QSize(500, 500))
self.label_8.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_8.setAlignment(QtCore.Qt.AlignCenter)
self.label_8.setObjectName("label_8")
self.gridLayout_8.addWidget(self.label_8, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_8, 0, 7, 1, 1)
self.frame_46 = QtWidgets.QFrame(self.centralwidget)
self.frame_46.setMinimumSize(QtCore.QSize(60, 90))
self.frame_46.setMaximumSize(QtCore.QSize(400, 600))
self.frame_46.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_46.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_46.setObjectName("frame_46")
self.gridLayout_46 = QtWidgets.QGridLayout(self.frame_46)
self.gridLayout_46.setContentsMargins(0, 0, 0, 0)
self.gridLayout_46.setObjectName("gridLayout_46")
self.label_46 = QtWidgets.QLabel(self.frame_46)
self.label_46.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_46.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_46.setAlignment(QtCore.Qt.AlignCenter)
self.label_46.setObjectName("label_46")
self.gridLayout_46.addWidget(self.label_46, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_46, 4, 5, 1, 1)
self.frame_18 = QtWidgets.QFrame(self.centralwidget)
self.frame_18.setMinimumSize(QtCore.QSize(60, 90))
self.frame_18.setMaximumSize(QtCore.QSize(400, 600))
self.frame_18.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_18.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_18.setObjectName("frame_18")
self.gridLayout_18 = QtWidgets.QGridLayout(self.frame_18)
self.gridLayout_18.setContentsMargins(0, 0, 0, 0)
self.gridLayout_18.setObjectName("gridLayout_18")
self.label_18 = QtWidgets.QLabel(self.frame_18)
self.label_18.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_18.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_18.setAlignment(QtCore.Qt.AlignCenter)
self.label_18.setObjectName("label_18")
self.gridLayout_18.addWidget(self.label_18, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_18, 1, 7, 1, 1)
self.frame_49 = QtWidgets.QFrame(self.centralwidget)
self.frame_49.setMinimumSize(QtCore.QSize(60, 90))
self.frame_49.setMaximumSize(QtCore.QSize(400, 600))
self.frame_49.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_49.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_49.setObjectName("frame_49")
self.gridLayout_49 = QtWidgets.QGridLayout(self.frame_49)
self.gridLayout_49.setContentsMargins(0, 0, 0, 0)
self.gridLayout_49.setObjectName("gridLayout_49")
self.label_49 = QtWidgets.QLabel(self.frame_49)
self.label_49.setMaximumSize(QtCore.QSize(1000, 1000))
self.label_49.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"font: 20pt \"Times New Roman\";")
self.label_49.setAlignment(QtCore.Qt.AlignCenter)
self.label_49.setObjectName("label_49")
self.gridLayout_49.addWidget(self.label_49, 0, 0, 1, 1)
self.gridLayout_51.addWidget(self.frame_49, 4, 8, 1, 1)
self.gridLayout_52.addLayout(self.gridLayout_51, 0, 0, 1, 1)
self.verticalScrollBar = QtWidgets.QScrollBar(self.centralwidget)
self.verticalScrollBar.setOrientation(QtCore.Qt.Vertical)
self.verticalScrollBar.setObjectName("verticalScrollBar")
self.gridLayout_52.addWidget(self.verticalScrollBar, 0, 1, 1, 1)
self.horizontalScrollBar = QtWidgets.QScrollBar(self.centralwidget)
self.horizontalScrollBar.setOrientation(QtCore.Qt.Horizontal)
self.horizontalScrollBar.setObjectName("horizontalScrollBar")
self.gridLayout_52.addWidget(self.horizontalScrollBar, 1, 0, 1, 1)
self.gridLayout_52.setColumnStretch(0, 30)
self.gridLayout_52.setRowStretch(0, 30)
self.verticalLayout.addLayout(self.gridLayout_52)
self.verticalLayout.setStretch(0, 30)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 1138, 23))
self.menubar.setObjectName("menubar")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.label_24.setText(_translate("MainWindow", "24"))
self.label_36.setText(_translate("MainWindow", "36"))
self.label_14.setText(_translate("MainWindow", "14"))
self.label_2.setText(_translate("MainWindow", "2"))
self.label_11.setText(_translate("MainWindow", "11"))
self.label_9.setText(_translate("MainWindow", "9"))
self.label_4.setText(_translate("MainWindow", "4"))
self.label_17.setText(_translate("MainWindow", "17"))
self.label_29.setText(_translate("MainWindow", "29"))
self.label_26.setText(_translate("MainWindow", "26"))
self.label_21.setText(_translate("MainWindow", "21"))
self.label_32.setText(_translate("MainWindow", "32"))
self.label_48.setText(_translate("MainWindow", "48"))
self.label_43.setText(_translate("MainWindow", "43"))
self.label_35.setText(_translate("MainWindow", "35"))
self.label_7.setText(_translate("MainWindow", "7"))
self.label_12.setText(_translate("MainWindow", "12"))
self.label_30.setText(_translate("MainWindow", "30"))
self.label_1.setText(_translate("MainWindow", "1"))
self.label_25.setText(_translate("MainWindow", "25"))
self.label_19.setText(_translate("MainWindow", "19"))
self.label_3.setText(_translate("MainWindow", "3"))
self.label_5.setText(_translate("MainWindow", "5"))
self.label_40.setText(_translate("MainWindow", "40"))
self.label_34.setText(_translate("MainWindow", "34"))
self.label_38.setText(_translate("MainWindow", "38"))
self.label_27.setText(_translate("MainWindow", "27"))
self.label_33.setText(_translate("MainWindow", "33"))
self.label_50.setText(_translate("MainWindow", "50"))
self.label_13.setText(_translate("MainWindow", "13"))
self.label_44.setText(_translate("MainWindow", "44"))
self.label_45.setText(_translate("MainWindow", "45"))
self.label_37.setText(_translate("MainWindow", "37"))
self.label_42.setText(_translate("MainWindow", "42"))
self.label_47.setText(_translate("MainWindow", "47"))
self.label_31.setText(_translate("MainWindow", "31"))
self.label_28.setText(_translate("MainWindow", "28"))
self.label_20.setText(_translate("MainWindow", "20"))
self.label_39.setText(_translate("MainWindow", "39"))
self.label_15.setText(_translate("MainWindow", "15"))
self.label_6.setText(_translate("MainWindow", "6"))
self.label_10.setText(_translate("MainWindow", "10"))
self.label_41.setText(_translate("MainWindow", "41"))
self.label_16.setText(_translate("MainWindow", "16"))
self.label_22.setText(_translate("MainWindow", "22"))
self.label_23.setText(_translate("MainWindow", "23"))
self.label_8.setText(_translate("MainWindow", "8"))
self.label_46.setText(_translate("MainWindow", "46"))
self.label_18.setText(_translate("MainWindow", "18"))
self.label_49.setText(_translate("MainWindow", "49"))
2.3 源码实现
具体的代码实现方法如下,核心函数 —— setVisible 。
import os
import sys
# Qt 库
from PyQt5.QtWidgets import QApplication, QMainWindow, QDesktopWidget, QMessageBox
# Ui 界面文件
from mainUi import Ui_MainWindow
class MyApp(QMainWindow, Ui_MainWindow):
def __init__(self, parent=None):
super(MyApp, self).__init__(parent) # 继承父类
self.setupUi(self)
self.setWindowTitle('滚动条控制窗口')
# self.setWindowIcon(QIcon("Icon.png"))
# 获取屏幕坐标系
screen = QDesktopWidget().screenGeometry()
# 获取窗口坐标系
size = self.geometry()
newLeft = abs(screen.width() - size.width()) / 2
newTop = abs(screen.height() - size.height()) / 2
self.move(int(newLeft), int(newTop)) # 位移至屏幕中央
# 进度条最大值和进度条事件出发函数功能
self.horizontalScrollBar.setMaximum(1)
self.horizontalScrollBar.valueChanged.connect(self.updateGridLayout)
self.verticalScrollBar.setMaximum(1)
self.verticalScrollBar.valueChanged.connect(self.updateGridLayout)
# 包含所有窗口的列表
self.frame_list_Qt = [0,
self.frame, self.frame_2, self.frame_3, self.frame_4, self.frame_5,
self.frame_6, self.frame_7, self.frame_8, self.frame_9, self.frame_10,
self.frame_11, self.frame_12, self.frame_13, self.frame_14, self.frame_15,
self.frame_16, self.frame_17, self.frame_18, self.frame_19, self.frame_20,
self.frame_21, self.frame_22, self.frame_23, self.frame_24, self.frame_25,
self.frame_26, self.frame_27, self.frame_28, self.frame_29, self.frame_30,
self.frame_31, self.frame_32, self.frame_33, self.frame_34, self.frame_35,
self.frame_36, self.frame_37, self.frame_38, self.frame_39, self.frame_40,
self.frame_41, self.frame_42, self.frame_43, self.frame_44, self.frame_45,
self.frame_46, self.frame_47, self.frame_48, self.frame_49, self.frame_50
]
self.boxx_dict = {}
values = [1, 2, 3, 4, 5, 6, 11, 12, 13, 14, 15, 16, 21, 22, 23, 24, 25, 26] # 初始化显示的窗口列表
for i in range(5):
for j in range(10):
self.frame_list_Qt[i * 10 + j + 1].setVisible(i * 10 + j + 1 in values) # frame可见性
# 更新布局中的控件可见性
def updateGridLayout(self):
# 垂直滑动条的值
V_value = self.verticalScrollBar.value()
if V_value == 1:
list_num = [2, 3, 4]
else:
list_num = [0, 1, 2]
# 水平滑动条的值
H_value = self.horizontalScrollBar.value()
if H_value == 1:
start, end = 4, 10
else:
start, end = 0, 6
# 根据不同滑动条的值来控制窗口的数量
values = []
for value in list_num:
for i in range((value * 10 + start) + 1, (value * 10 + end) + 1):
values.append(i)
self.showFramesInRange(values) # 设置可见性
def showFramesInRange(self, values):
for i in range(5):
for j in range(10):
self.frame_list_Qt[i * 10 + j + 1].setVisible(i * 10 + j + 1 in values)
# 退出系统窗口功能函数
def closeEvent(self, e):
self.box = QMessageBox(QMessageBox.Warning, "系统提示信息", "是否退出系统?")
qyes = self.box.addButton(self.tr("是"), QMessageBox.YesRole)
qno = self.box.addButton(self.tr("否"), QMessageBox.NoRole)
self.box.exec_()
if self.box.clickedButton() == qyes:
os._exit(0) # 直接将python解释器退出,不再执行余下代码
else:
e.ignore()
if __name__ == '__main__':
app = QApplication(sys.argv)
dw = MyApp() # 对象实例化
dw.show() # 可视化
sys.exit(app.exec_()) # 实时刷新界面
3. 结果展示
滚动条控制窗口
>>> 如有疑问,欢迎评论区一起探讨。
>>> 致力于高质量文章,宁愿多花时间,也不敷衍自己。