当前位置: 首页 > news >正文

网站空间免费央视新闻最新消息今天

网站空间免费,央视新闻最新消息今天,东莞微信网站建设推荐,wordpress多站点内容聚合将登录框中的取消按钮使用信号和槽的机制,关闭界面。 将登录按钮使用信号和槽连接到自定义的槽函数中,在槽函数中判断ui界面上输入的账号是否为"admin",密码是否为"123456",如果账号密码匹配成功,当前界面关…

将登录框中的取消按钮使用信号和槽的机制,关闭界面。

将登录按钮使用信号和槽连接到自定义的槽函数中,在槽函数中判断ui界面上输入的账号是否为"admin",密码是否为"123456",如果账号密码匹配成功,当前界面关闭,另一个界面展开。如果匹配失败,则输出登录失败,并将密码框和账号框中的内容清空

 pyside转换前

 

Pyside将ui转换为py文件,将项目资源导入后 

 

代码如下:(主执行代码)

import sys
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QWidget,QApplicationfrom login_sea import Ui_Form
from login_succes import Ui_Form2#界面1(按钮)
class MyWidget(Ui_Form,QWidget):def __init__(self):super().__init__()self.setupUi(self)self.pushButton.clicked.connect(btn_def)#界面2
class SecMyWidget(Ui_Form2,QWidget):def __init__(self):super().__init__()self.setupUi(self)def btn_def():name = myWidget.lineEdit_1.text()password = myWidget.lineEdit_2.text()if name=='admin'and password=='123456':myWidget.close()second.show()else:print('输入错误')if __name__ =='__main__':app = QApplication(sys.argv)myWidget=MyWidget()myWidget.setWindowFlag(Qt.WindowType.FramelessWindowHint)myWidget.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)myWidget.show()second=SecMyWidget()second.setWindowFlag(Qt.WindowType.FramelessWindowHint)second.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)#阻塞sys.exit(app.exec())

 剩下两个页面的ui转py代码:

# -*- coding: utf-8 -*-################################################################################
## Form generated from reading UI file 'login_sea.ui'
##
## Created by: Qt User Interface Compiler version 6.8.1
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,QMetaObject, QObject, QPoint, QRect,QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,QFont, QFontDatabase, QGradient, QIcon,QImage, QKeySequence, QLinearGradient, QPainter,QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QFrame, QLabel, QLineEdit,QPushButton, QSizePolicy, QWidget)
import res_rc
import sysclass Ui_Form(object):def setupUi(self, Form):if not Form.objectName():Form.setObjectName(u"Form")Form.resize(698, 623)Form.setStyleSheet(u"*{\n"
"	background-color: rgb(255, 255, 255);\n"
"}\n"
"\n"
"QFrame#frameback{		\n"
"	border-image: url(:/Logo/shangHai.jpg);\n"
"	border-radius:5px\n"
"}\n"
"\n"
"\n"
"QLabel#labelback{\n"
"	background-color: rgba(120, 120, 125, 50);\n"
"	border-radius:5px;\n"
"}\n"
"#labelback2{\n"
"	background-color: rgba(70, 70, 75, 120);\n"
"	border-radius:5px;\n"
"}\n"
"#loginlab{\n"
"	background:transparent;\n"
"	\n"
"	color: rgba(255, 255, 255, 200);\n"
"	font: 26pt \"Segoe Print\";\n"
"}\n"
"QLineEdit{\n"
"	background:transparent;\n"
"	border:none;\n"
"	border-bottom:3px solid rgba(255, 255, 255, 200);\n"
"	color: rgba(255, 255, 255, 200);\n"
"	font: 26pt \"Segoe Print\";\n"
"}\n"
"QPushButton{\n"
"	color: rgba(5, 2, 5, 200);\n"
"	font: 26pt \"Segoe Print\";\n"
"	border-radius:5px;\n"
"	background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(244, 191, 0, 255), stop:1 rgba(255, 255, 255, 255));\n"
"}\n"
"QPushButton:hover{\n"
"	color: rgba(5, 2, 5, 200);\n"
"	font: 26pt \"Segoe Print\";\n"
"	b""order-radius:5px;\n"
"	background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(190, 191, 0, 255), stop:1 rgba(190, 255, 255, 255));\n"
"}\n"
"QPushButton:pressed{\n"
"	color: rgba(5, 2, 5, 200);\n"
"	font: 26pt \"Segoe Print\";\n"
"	border-radius:5px;\n"
"	background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(244, 191, 0, 255), stop:1 rgba(255, 255, 255, 255));\n"
"	padding-top:5px;\n"
"	padding-left:5px;\n"
"}\n"
"\n"
"\n"
"\n"
"")self.frameback = QFrame(Form)self.frameback.setObjectName(u"frameback")self.frameback.setGeometry(QRect(90, 100, 531, 401))self.frameback.setFrameShape(QFrame.StyledPanel)self.frameback.setFrameShadow(QFrame.Raised)self.labelback = QLabel(self.frameback)self.labelback.setObjectName(u"labelback")self.labelback.setGeometry(QRect(0, 0, 531, 401))self.labelback2 = QLabel(self.frameback)self.labelback2.setObjectName(u"labelback2")self.labelback2.setGeometry(QRect(50, 80, 431, 281))self.loginlab = QLabel(self.frameback)self.loginlab.setObjectName(u"loginlab")self.loginlab.setGeometry(QRect(190, 100, 211, 71))self.lineEdit_1 = QLineEdit(self.frameback)self.lineEdit_1.setObjectName(u"lineEdit_1")self.lineEdit_1.setGeometry(QRect(150, 190, 231, 31))self.lineEdit_1.setMaxLength(32769)self.lineEdit_2 = QLineEdit(self.frameback)self.lineEdit_2.setObjectName(u"lineEdit_2")self.lineEdit_2.setGeometry(QRect(150, 240, 231, 31))self.lineEdit_2.setEchoMode(QLineEdit.Password)self.pushButton = QPushButton(self.frameback)self.pushButton.setObjectName(u"pushButton")self.pushButton.setGeometry(QRect(150, 300, 241, 41))self.retranslateUi(Form)QMetaObject.connectSlotsByName(Form)# setupUidef retranslateUi(self, Form):Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None))self.labelback.setText("")self.labelback2.setText("")self.loginlab.setText(QCoreApplication.translate("Form", u"welcome", None))self.lineEdit_1.setPlaceholderText(QCoreApplication.translate("Form", u"e-mail", None))self.lineEdit_2.setPlaceholderText(QCoreApplication.translate("Form", u"passwd", None))self.pushButton.setText(QCoreApplication.translate("Form", u"log in", None))# retranslateUiif __name__ == '__main__':#实例化程序,有且仅有一个应用程序对象app = QApplication(sys.argv)w=QWidget()Ui_Form().setupUi(w)w.setWindowFlag(Qt.WindowType.FramelessWindowHint)w.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)w.show()#阻塞sys.exit(app.exec())# -*- coding: utf-8 -*-################################################################################
## Form generated from reading UI file 'login_succes.ui'
##
## Created by: Qt User Interface Compiler version 6.8.1
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,QMetaObject, QObject, QPoint, QRect,QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,QFont, QFontDatabase, QGradient, QIcon,QImage, QKeySequence, QLinearGradient, QPainter,QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QLabel, QSizePolicy, QWidget)
import res_rc
import sysclass Ui_Form2(object):def setupUi(self, Form):if not Form.objectName():Form.setObjectName(u"Form")Form.resize(709, 695)Form.setStyleSheet(u"QLabel#label1{\n"
"	border-radius:3px;\n"
"	border-image: url(:/Logo/wanXia.jpg);\n"
"}\n"
"#label2{\n"
"	\n"
"	font: 48pt \"\u5fae\u8f6f\u96c5\u9ed1\";\n"
"	\n"
"	color: rgb(85, 0, 255);\n"
"}")self.label1 = QLabel(Form)self.label1.setObjectName(u"label1")self.label1.setGeometry(QRect(70, 100, 551, 431))self.label2 = QLabel(Form)self.label2.setObjectName(u"label2")self.label2.setGeometry(QRect(100, 230, 341, 71))self.retranslateUi(Form)QMetaObject.connectSlotsByName(Form)# setupUidef retranslateUi(self, Form):Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None))self.label1.setText("")self.label2.setText(QCoreApplication.translate("Form", u"\u767b\u9646\u6210\u529f\uff01", None))# retranslateUiif __name__ == '__main__':#实例化程序,有且仅有一个应用程序对象app = QApplication(sys.argv)w=QWidget()Ui_Form2().setupUi(w)w.setWindowFlag(Qt.WindowType.FramelessWindowHint)w.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)w.show()#阻塞sys.exit(app.exec())

本期思维导图: 

 

http://www.zhongyajixie.com/news/8903.html

相关文章:

  • 秦皇岛做网站制作网站建设入门
  • 党建网站建设可行性分析网络软文怎么写
  • 品牌型网站页面设计漂亮的网站
  • 有没有可以做游戏的网站2021年网络营销案例
  • 兰州网站订制百度热词搜索指数
  • 静态网站分页神童预言新冠2023结束
  • 网站建设管理的规章制度苏州首页排名关键词优化
  • 网站制作的销售对象泉州seo报价
  • 知乎 做网站的公司 中企动力外贸网站平台有哪些
  • 啪啪男女禁做视频网站温州seo招聘
  • 属于我的网页制作平台的是巩义网站优化公司
  • 莱州教育网站抖音权重查询
  • 深圳网站设计公司哪个厦门人才网个人登录
  • 为加强政府网站建设营销广告
  • 给客户做网站建设方案网站优化排名提升
  • 游戏交易网站怎么做天津网站排名提升多少钱
  • 丰田车营销网站建设的纲要计划书新东方留学机构官网
  • 宝安网站建设深圳信科拓客最有效方案
  • 新手学做网站pdf手如何制作一个简单的网页
  • dw做网站导航条百度发布平台官网
  • 浏览器收录网站灰色行业seo
  • wordpress开cdn好吗沈阳百度seo
  • 公司建网站的详细步骤全网整合营销平台
  • 淘宝返利网站怎么做免费的推广平台
  • 爱玖货源站电脑培训中心
  • 织梦网站文章内容模板怎样创建网页
  • html布局模板苏州百度快速排名优化
  • 湖州住房和城乡建设厅网站怎么建立自己的网站平台
  • 网站建设越来越难做泉州seo代理计费
  • 万网云虚拟主机上传网站免费入驻的电商平台