# -*- 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. Leetcode——Third Maximum Number

    Question Given a non-empty array of integers, return the third maximum number in this array. If it d ...

  2. webservice用cxf发布SOAP

    cxf的安装,就是把文件解压,然后配置环境变量 http://cxf.apache.org/download.html这是官网下载 解压到这里 环境变量 wsdl2java命令测试 1.新建java项 ...

  3. Pandas 高级应用 数据分析

    深入pandas 数据处理 三个阶段 数据准备 数据转化 数据聚合 数据准备 加载 组装 合并 - pandas.merge() 拼接 - pandas.concat() 组合 - pandas.Da ...

  4. C#之多线程

    多线程在C#中使用得非常频繁,线程之间的充分利用显得尤为重要,一般的写法都是得不到充分利用资源,本人针对多线程写了一种方法,可以充分利用资源,保证每次同时启动10条线程,现在执行完马上再启动一条,总之 ...

  5. vue-router的一个小实例

    非2.0的 vue2.0还有vue-router2.0的改变还是挺大的 vue-router是Vue.js官方的路由插件,它和vue.js是深度集成的,适合用于构建单页面应用.vue的单页面应用是基于 ...

  6. 又是新动作!微信小程序专属二维码出炉

    又到了晚上,微信又给我们带来了惊喜,并这次不是新的能力,而是把大家再熟悉不过的二维码换了新的造型. 正式揭晓:微信特制的小程序码.扫一扫新二维码 只要你的微信升级到了 6.5.7 版本,就可以扫码或者 ...

  7. MVVM中轻松实现Command绑定任意事件的Command

    下面是“银光中国”(不错的WPF或SL网站)WPF学习教程中的一个连接, http://www.silverlightchina.net/html/study/WPF/2011/0715/9034.h ...

  8. c# 计算中文字节数与JAVA不符的解决方法

    c# 中方法 string str = "中华人民共和国"; int strLen = System.Text.Encoding.Default.GetByteCount(str) ...

  9. vue-awesome-swiper 第一张自动跳过

    昨天在上班中要做一个商品页面,需求是从后台接口获得轮播图的路径,然后传到封装好的组件中,本来以为很简单啊,没什么毛病,开始动手~ 东西很简单,新建一个banner组件 如下: <template ...

  10. mysql中一个字段根据另一字段的值分割为不同列

    1.数据结构如下: vehicleId mileage_type mileage 11AM6897           0 120 11AM6897           1 60 13AY9180 0 ...