zhiyiYo / PyQt-Fluent-Widgets

A fluent design widgets library based on C++ Qt/PyQt/PySide. Make Qt Great Again.
https://qfluentwidgets.com
GNU General Public License v3.0
5.39k stars 520 forks source link

传统艺能:更新版本后gallery必出问题 #602

Closed LimeBow-Studios closed 10 months ago

LimeBow-Studios commented 10 months ago

报错信息

Ver

Python: 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] on win32 PyQt-Fluent-Widgets: 1.3.5 PyQt5: 5.15.10

执行:

1.更新

G:\Git\>pip install -U pyqt-fluent-widgets

结果:

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: pyqt-fluent-widgets in c:\users\limebow\appdata\local\programs\python\python310\lib\site-packages (1.3.5)
Requirement already satisfied: PyQt5>=5.15.0 in c:\users\limebow\appdata\local\programs\python\python310\lib\site-packages (from pyqt-fluent-widgets) (5.15.10)
Requirement already satisfied: PyQt5-Frameless-Window>=0.3.3 in c:\users\limebow\appdata\local\programs\python\python310\lib\site-packages (from pyqt-fluent-widgets) (0.3.6)
Requirement already satisfied: darkdetect in c:\users\limebow\appdata\local\programs\python\python310\lib\site-packages (from pyqt-fluent-widgets) (0.8.0)
Requirement already satisfied: PyQt5-sip<13,>=12.13 in c:\users\limebow\appdata\local\programs\python\python310\lib\site-packages (from PyQt5>=5.15.0->pyqt-fluent-widgets) (12.13.0)
Requirement already satisfied: PyQt5-Qt5>=5.15.2 in c:\users\limebow\appdata\local\programs\python\python310\lib\site-packages (from PyQt5>=5.15.0->pyqt-fluent-widgets) (5.15.2)
Requirement already satisfied: pywin32 in c:\users\limebow\appdata\local\programs\python\python310\lib\site-packages (from PyQt5-Frameless-Window>=0.3.3->pyqt-fluent-widgets) (306)

2.Clone

G:\Git>git clone https://github.com/zhiyiYo/PyQt-Fluent-Widgets.git

结果:

Cloning into 'PyQt-Fluent-Widgets'...
remote: Enumerating objects: 14039, done.
remote: Counting objects: 100% (677/677), done.
remote: Compressing objects: 100% (261/261), done.
remote: Total 14039 (delta 372), reused 655 (delta 369), pack-reused 13362
Receiving objects: 100% (14039/14039), 118.07 MiB | 943.00 KiB/s, done.

Resolving deltas: 100% (8971/8971), done.
Updating files: 100% (1220/1220), done.

3.验证

G:\Git>dir
 驱动器 G 中的卷是 办公
 卷的序列号是 1435-8A86

 G:\Git 的目录

2023/11/04  12:48    <DIR>          .
2023/11/04  12:48    <DIR>          ..
2023/11/04  13:10    <DIR>          PyQt-Fluent-Widgets
               0 个文件              0 字节
               3 个目录 12,774,277,120 可用字节

G:\Git>cd PyQt-Fluent-Widgets

G:\Git\PyQt-Fluent-Widgets>dir
 驱动器 G 中的卷是 办公
 卷的序列号是 1435-8A86

 G:\Git\PyQt-Fluent-Widgets 的目录

2023/11/04  13:10    <DIR>          .
2023/11/04  13:10    <DIR>          ..
2023/11/04  13:12    <DIR>          .github
2023/11/04  13:12               495 .gitignore
2023/11/04  13:12            35,825 LICENSE
2023/11/04  13:12             5,001 README.md
2023/11/04  13:12    <DIR>          docs
2023/11/04  13:12    <DIR>          examples
2023/11/04  13:12    <DIR>          plugins
2023/11/04  13:12    <DIR>          qfluentwidgets
2023/11/04  13:12                90 requirements.txt
2023/11/04  13:12             1,220 setup.py
2023/11/04  13:12    <DIR>          tools
               5 个文件         42,631 字节
               8 个目录 12,774,277,120 可用字节

4.Fluent,启动!

G:\Git\PyQt-Fluent-Widgets>cd examples\gallery

G:\Git\PyQt-Fluent-Widgets\examples\gallery>dir
 驱动器 G 中的卷是 办公
 卷的序列号是 1435-8A86

 G:\Git\PyQt-Fluent-Widgets\examples\gallery 的目录

2023/11/04  13:12    <DIR>          .
2023/11/04  13:12    <DIR>          ..
2023/11/04  13:12    <DIR>          app
2023/11/04  13:12             1,150 demo.py
2023/11/04  13:12               752 gallery.pro
               2 个文件          1,902 字节
               3 个目录 12,774,277,120 可用字节

G:\Git\PyQt-Fluent-Widgets\examples\gallery>python
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ^Z

G:\Git\PyQt-Fluent-Widgets\examples\gallery>python demo.py
Traceback (most recent call last):
  File "G:\Git\PyQt-Fluent-Widgets\examples\gallery\app\view\main_window.py", line 130, in resizeEvent
    self.splashScreen.resize(self.size())
AttributeError: 'MainWindow' object has no attribute 'splashScreen'

一步到位

报错:属性错误:“MainWindow”对象没有属性“splashScreen” (AttributeError: 'MainWindow' object has no attribute 'splashScreen')

Traceback (most recent call last):
  File "G:\Git\PyQt-Fluent-Widgets\examples\gallery\app\view\main_window.py", line 130, in resizeEvent
    self.splashScreen.resize(self.size())
AttributeError: 'MainWindow' object has no attribute 'splashScreen'

About

主要是代码只能看懂自己写的,否则也不用问了 :(

Ljzd-PRO commented 10 months ago

同样遇到了

zhiyiYo commented 10 months ago

加个 hasattr() 判断一下应该就行了