鱼C论坛

 找回密码
 立即注册
查看: 828|回复: 5

gui问题求助pyqt

[复制链接]
发表于 2021-8-5 17:56:24 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
本帖最后由 1062195630 于 2021-8-5 18:05 编辑

设计的界面长这样
designer_49TWrcwCdw.png

为啥实际python跑出来长这样
python_c2xJ2YbpcH.png

代码如下
主程序
import sign_in_window
import sys
from PyQt5.QtWidgets import QApplication,QMainWindow
if __name__ == '__main__':
    app=QApplication(sys.argv)
    singin_window=QMainWindow()
    ui=sign_in_window.Ui_sign_in_window()
    ui.setupUi(singin_window)
    singin_window.show()
    sys.exit(app.exec_())

sign_in_window程序如下
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'sign_in_window.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# 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_sign_in_window(object):
    def setupUi(self, sign_in_window):
        sign_in_window.setObjectName("sign_in_window")
        sign_in_window.resize(624, 265)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(sign_in_window)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.graphicsView_2 = QtWidgets.QGraphicsView(sign_in_window)
        self.graphicsView_2.setStyleSheet("border-image: url(:/sign_in/fasheaixin.gif);")
        self.graphicsView_2.setObjectName("graphicsView_2")
        self.horizontalLayout_2.addWidget(self.graphicsView_2)
        self.line = QtWidgets.QFrame(sign_in_window)
        self.line.setFrameShape(QtWidgets.QFrame.VLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line.setObjectName("line")
        self.horizontalLayout_2.addWidget(self.line)
        self.verticalLayout_3 = QtWidgets.QVBoxLayout()
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout_3.addItem(spacerItem)
        self.label_3 = QtWidgets.QLabel(sign_in_window)
        self.label_3.setObjectName("label_3")
        self.verticalLayout_3.addWidget(self.label_3)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setContentsMargins(-1, -1, 0, 10)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout()
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.label = QtWidgets.QLabel(sign_in_window)
        self.label.setObjectName("label")
        self.verticalLayout_2.addWidget(self.label)
        self.label_2 = QtWidgets.QLabel(sign_in_window)
        self.label_2.setObjectName("label_2")
        self.verticalLayout_2.addWidget(self.label_2)
        self.horizontalLayout.addLayout(self.verticalLayout_2)
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.account = QtWidgets.QLineEdit(sign_in_window)
        self.account.setObjectName("account")
        self.verticalLayout.addWidget(self.account)
        self.secret = QtWidgets.QLineEdit(sign_in_window)
        self.secret.setObjectName("secret")
        self.verticalLayout.addWidget(self.secret)
        self.horizontalLayout.addLayout(self.verticalLayout)
        self.horizontalLayout.setStretch(0, 1)
        self.horizontalLayout.setStretch(1, 3)
        self.verticalLayout_3.addLayout(self.horizontalLayout)
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_3.setContentsMargins(-1, 12, 0, 0)
        self.horizontalLayout_3.setSpacing(11)
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_3.addItem(spacerItem1)
        self.sign_in_button = QtWidgets.QPushButton(sign_in_window)
        self.sign_in_button.setObjectName("sign_in_button")
        self.horizontalLayout_3.addWidget(self.sign_in_button)
        spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_3.addItem(spacerItem2)
        self.verticalLayout_3.addLayout(self.horizontalLayout_3)
        spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout_3.addItem(spacerItem3)
        self.verticalLayout_3.setStretch(1, 2)
        self.verticalLayout_3.setStretch(2, 1)
        self.verticalLayout_3.setStretch(3, 1)
        self.verticalLayout_3.setStretch(4, 2)
        self.horizontalLayout_2.addLayout(self.verticalLayout_3)

        self.retranslateUi(sign_in_window)
        QtCore.QMetaObject.connectSlotsByName(sign_in_window)

    def retranslateUi(self, sign_in_window):
        _translate = QtCore.QCoreApplication.translate
        sign_in_window.setWindowTitle(_translate("sign_in_window", "mylover"))
        self.label_3.setText(_translate("sign_in_window", "亲爱滴臭宝!请输入账号密码呦....."))
        self.label.setText(_translate("sign_in_window", "账号"))
        self.label_2.setText(_translate("sign_in_window", "密码"))
        self.sign_in_button.setText(_translate("sign_in_window", "登录"))
import sign_in_rc
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2021-8-5 17:58:14 | 显示全部楼层
那么你的问题是什么呢?
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2021-8-5 18:05:52 | 显示全部楼层
nahongyan1997 发表于 2021-8-5 17:58
那么你的问题是什么呢?

不好意思发错图了
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2021-8-5 18:09:47 | 显示全部楼层
看着真头痛
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2021-8-5 18:11:16 | 显示全部楼层
不会用布局
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2021-8-11 09:09:16 | 显示全部楼层
是不是不同的文件夹下有重复的文件啊
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-10-8 08:22

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表