Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: MessageBoxBase 无法在缺少父组件的情况下运行 #894

Open
Zhikun0201 opened this issue Jun 14, 2024 · 0 comments
Open

[Bug]: MessageBoxBase 无法在缺少父组件的情况下运行 #894

Zhikun0201 opened this issue Jun 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Zhikun0201
Copy link

What happened?

Traceback (most recent call last):
File "D:\Projects\NarratinPySide\scripts\widgets\dialog_dialog.py", line 22, in
dialog = Dialog()
^^^^^^^^
File "D:\Projects\NarratinPySide\scripts\widgets\dialog_dialog.py", line 6, in init
super(Dialog, self).init(parent)
File "D:\Projects\NarratinPySide\venv\Lib\site-packages\qfluentwidgets\components\dialog_box\message_box_base.py", line 19, in init
super().init(parent=parent)
File "D:\Projects\NarratinPySide\venv\Lib\site-packages\qfluentwidgets\components\dialog_box\mask_dialog_base.py", line 22, in init
self.setGeometry(0, 0, parent.width(), parent.height())
^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'width'

Operation System

Windows 11 23H2

Python Version

3.12

PyQt/PySide Version

PySide6 6.7.1

PyQt/PySide-Fluent-Widgets Version

v1.5.7

How to Reproduce?

运行Code

Minimum code

if __name__ == '__main__':
    from PySide6.QtWidgets import QApplication
    import sys

    app = QApplication(sys.argv)
    dialog = MessageBoxBase()
    dialog.show()
    sys.exit(app.exec_())
@Zhikun0201 Zhikun0201 added the bug Something isn't working label Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant