# -*- coding: utf-8 -*-

import sys
from PyQt5.QtWidgets import QApplication , QMainWindow
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from Ui_splashView import *
from LoginMain import LoginMain class SplashMain(QMainWindow, Ui_Form):
def __init__(self, parent=None):
super(SplashMain, self).__init__(parent)
self.setWindowFlags(Qt.SplashScreen|Qt.FramelessWindowHint)
self.setupUi(self) self.time=5
self.timer=QTimer(self)
self.timer.timeout.connect(self.countTime)
self.timer.start(1000) def countTime(self):
self.time-=1
self.label_2.setText("还有"+str(self.time)+"秒跳转登入界面")
if(self.time==0):
self.close()
self.myWin2 = LoginMain()
self.myWin2.show() if __name__=="__main__":
app = QApplication(sys.argv)
myWin = SplashMain()
myWin.show()
sys.exit(app.exec_())

以上代码是 splash窗口负责欢迎提示的,然后关闭自身窗口打开一个新的窗口。

以上红色部分的代码是修正以后的,之前的代码为:

            myWin2 = LoginMain()
myWin2.show()
myWin2.exec_()

如果这么写的话就会报错,如下:

PyQt: “AttributeError: 'Form' object has no attribute 'exec_'” when opening second window

在  网址:

https://blog.csdn.net/qq_32856147/article/details/79646163

找到了一些解答。

照此修正,不再报错。

PyQt: “AttributeError: 'Form' object has no attribute 'exec_'” when opening second window的更多相关文章

  1. PyQt程序执行时报错:AttributeError: 'winTest' object has no attribute 'setCentralWidget'的解决方法

    用QtDesigner设计了一个UI界面,保存在文件Ui_wintest.ui中,界面中使用了MainWindow窗口,窗口名字也叫MainWindow,用PyUIC将其转换成了 Ui_wintest ...

  2. 关于flask登录视图报错AttributeError: '_AppCtxGlobals' object has no attribute 'user'

    在一个小程序中写了一个登录视图函数,代码如下: @app.route('/login',methods = ['GET','POST']) @oid.loginhandler def login(): ...

  3. AttributeError: 'WebElement' object has no attribute 'send_keys'

    这个是没问题的代码:用来打开谷歌搜索cheese并退出 from selenium import webdriver from selenium.common.exceptions import Ti ...

  4. 解决AttributeError: 'Ui_MainWindow' object has no attribute 'show'报错

    1.首先使用pyqt designer来设计ui界面,将其保存为"***.ui"文件, 然后进入到pyqt所在的文件目录中,执行cmd中命令,即在当前目录中可以生成相应的**.py ...

  5. Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法

    最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...

  6. AttributeError: 'list' object has no attribute 'write_pdf'

    我在可视化决策树,运行以下代码时报错:AttributeError: 'list' object has no attribute 'write_pdf' 我使用的是python3.4 from sk ...

  7. attributeError:'module' object has no attribute ** 解决办法

    写了一个小脚本,执行的时候报错: Traceback (most recent call last): File "F:/test/qrcode.py", line 109, in ...

  8. AttributeError: 'module' object has no attribute 'TornadoAsyncNotifier'

    /*************************************************************************** * AttributeError: 'modu ...

  9. AttributeError: 'dict_values' object has no attribute 'translate'

    /***************************************************************************************** * Attribu ...

随机推荐

  1. 微信JS-SDK接口,分享到朋友圈”按钮点击状态及自定义分享内容接口

    jssdk.php 接口文件class JSSDK { private $appId; private $appSecret; public function __construct($appId, ...

  2. c++之单例模式

    1 本篇主要讨论下多线程下的单例模式实现: 首先是 double check 实现方式: 这种模式可以满足多线程环境下,只产生一个实例. template<typename T> clas ...

  3. 机器学习 delay learning

    计蒜之道总决赛考了机器学习,大多数人都不会所以现场学,然后我看了一些之后放弃了..采取了人力分析的办法,最后果然被学习能力碾压.. 不过机器学习看起来是很有趣的,也听别人说了很多,和别人聊了一些,如果 ...

  4. SQL Server----解决SQL Server 配置管理器不见了

    错误重现: 之前安装好的SQL Server 2012打开都没有问题,好多天没有打开了,今天打开我的SQL Server 2012 连接时出现错误: 在与SQL Server 建立连接时出现与网络相关 ...

  5. java开发设计六大基本原则

    1.遵循单一职责原则 定义:不要存在多于一个导致类变更的原因.通俗的说,即一个类只负责一项职责.一个类只专注于做一件事: 高内聚,低耦合: 实例: 普通的手表如果有一个指针坏了,那么手表将不再转动,而 ...

  6. target 标签

    <!DOCTYPE html><html><head><style>:target{border: 2px solid #D4D4D4;backgrou ...

  7. ubuntu install git vim Plug manage

    在UBUNTU采用163或是阿里云来更新源,最新的更新源地址可以在网上查阅, 阿里源 deb http://mirrors.aliyun.com/ubuntu/ bionic main restric ...

  8. nRF5 SDK软件架构及softdevice工作原理

    本文将介绍Nordic nRF5 SDK软件架构以及softdevice工作原理,以加深大家对Nordic产品开发的理解,这样开发过程中碰到问题时,大家也知道如何去调试. 如果你刚开始接触nRF5 S ...

  9. Dubbo 和 Spring Cloud微服务架构 比较及相关差异

    你真的了解微服务架构吗?听听八年阿里架构师怎样讲述Dubbo和Spring Cloud微服务架构. 微服务架构是互联网很热门的话题,是互联网技术发展的必然结果.它提倡将单一应用程序划分成一组小的服务, ...

  10. ubuntu16.04 安装以及要做的事情

    1.安装ubuntu 选择安装时更新,以及MP3.图形等:然后选择分区(ext4)(安装时需先进入虚拟系统连上网,输入清华net账号),分区情况按照下图来,swap为临时用的内存分区,可以不要: 选择 ...