# -*- 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. 分布式系列 - dubbo服务发布

    单元测试OK,封装为Dubbo服务.   添加依赖 pom.xml   <properties>       <dubbo.version>2.5.3</dubbo.ve ...

  2. ASP.NET Web API Claims Authorization with ASP.NET Identity 2.1 Part 5 (by TAISEER)

    https://www.cnblogs.com/KimmyLee/p/6430474.html https://www.cnblogs.com/rocketRobin/p/9077523.html h ...

  3. 整数分解为若干项之和 - PAT

    深度搜索,一开始没有想到,说明基本功还是不够啊,加油 //======================================================================= ...

  4. codeforces291E Tree-String Problem

    本文版权归ljh2000和博客园共有,欢迎转载,但须保留此声明,并给出原文链接,谢谢合作. 本文作者:ljh2000 作者博客:http://www.cnblogs.com/ljh2000-jump/ ...

  5. Mac OSX 如何在命令行中生成 md5、sha1、sha256 校验和

    计算 MD5 校验和 md5 /tmp/hello.txt 计算 SHA-1 校验和 shasum -a 1 /tmp/hello.txt 计算 SHA-256 校验和 shasum -a 256 / ...

  6. Pycharm-professional-2017.2.3破解安装

    初次接触Python,大神推荐使用PyCharm IDE工具,作为小白初生牛犊不怕虎,上手就来最新版的,这也许不是最好的选择,但在以后慢慢琢磨深入之后,会选择适合自己的版本,现参考把安装过程分享出来. ...

  7. iOS JavaScriptCore使用

    iOS JavaScriptCore使用 JavaScriptCore是iOS7引入的新功能,JavaScriptCore可以理解为一个浏览器的运行内核,使用JavaScriptCore可以使用nat ...

  8. Symmetrical Network Acceleration with EBS 12

    Andy Tremayne, my esteemed colleague and fellow blogger, has published a new whitepaper that discuss ...

  9. date.timezone not set in php.ini. Please contact ...解决方案

    无论是在LAMP还是在LNMP系统环境下, 只要PHP的版本在5.3及其以上的版本时, 无论是在安装oscommerce, 还是在安装zen cart, 以及其他的CMS时, 都会遇到如下所示的错误信 ...

  10. 关于js中的原型链的理解

    我们知道无论什么时候只要创建了一个函数,就会为该函数创建一个prototype属性,这个属性指向函数的原型对象,默认情况下所有原型对象都会自动获得一个constructor(构造函数)属性,这个属性包 ...