weixin_43640880
weixin_43640880
2018-11-08 06:38

最近在学习pyqt5,使用了qdarkstylesheet,但是出现了问题

  • qdarkstylesheet
  • pyqt5

源代码:
import sys

from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *

import qdarkstyle

class Demo(QWidget):
def init(self,parent=None):
super(Demo,self).__init__(parent)

    self.setWindowTitle("Demo")
    self.resize(500,500)
    self.move(200,200)

    layout=QHBoxLayout()
    self.setLayout(layout)
    layout.addWidget(QPushButton("button1"))
    layout.addWidget(QPushButton("button2"))
    layout.addWidget(QPushButton("button3"))

if name=='__main__':
app=QApplication(sys.argv)
form=Demo()
app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
#app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
form.show()
sys.exit(app.exec_())

    报错显示:
    AttributeError: module 'qdarkstyle' has no attribute 'load_stylesheet_pyqt5'
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答