Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14126

AttributeError: type object 'Qt' has no attribute 'QFrame'

$
0
0

main.py

from LoginUi import *from PyQt5.QtWidgets import QApplication, QMainWindowimport sysclass LoginWindow(QMainWindow):    def __init__(self):        super().__init__()        self.ui = Ui_LoginWindow()        self.ui.setupUi(self)        self.show()if __name__ == '__main__':    app= QApplication(sys.argv)    win = LoginWindow()    sys.exit(app.exec_())

LoginUi.py

from PyQt5 import QtCore, QtGui, QtWidgetsclass Ui_LoginWindow(object):    def setupUi(self, LoginWindow):        LoginWindow.setObjectName("LoginWindow")        LoginWindow.resize(800, 600)        self.centralwidget = QtWidgets.QWidget(LoginWindow)        self.centralwidget.setObjectName("centralwidget")        self.frame = QtWidgets.QFrame(self.centralwidget)        self.frame.setGeometry(QtCore.QRect(70, 60, 291, 481))        self.frame.setStyleSheet("#frame {\n""    background-color: qlineargradient(spread:pad, x1:0.412935, y1:0.653409, x2:1, y2:0, stop:0.208955 rgba(64, 180, 210, 255), stop:1 rgba(255, 255, 255, 255));\n""border-radius: 20px;\n""}")

If run main.py, the error is AttributeError: type object 'Qt' has no attribute 'QFrame'

I want to show the window. But when I run the main.py, it is always get the same error.


Viewing all articles
Browse latest Browse all 14126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>