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]: 无边框对话框打开的一瞬间会显示最大,最小,关闭按钮 #154

Open
runningsnai1 opened this issue Apr 19, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@runningsnai1
Copy link

What happened?

无边框对话框打开的一瞬间会显示最大,最小,关闭按钮,然后再消失

Operation System

windows10

Python Version

3.10.7-64bit

PyQt/PySide Version

pyside6.6.2

PyQt/PySide-Fluent-Widgets Version

1.5.3

How to Reproduce?

点击按钮,弹出无边框对话框
image

Minimum code

# coding:utf-8
import sys
from PySide6.QtWidgets import QApplication, QWidget

from qfluentwidgets import Dialog, PrimaryPushButton


class Demo(QWidget):

    def __init__(self, parent=None):
        super().__init__(parent=parent)
        self.resize(950, 500)
        self.btn = PrimaryPushButton('Click Me', parent=self)
        self.btn.move(425, 225)
        self.btn.clicked.connect(self.showDialog)
        self.setStyleSheet('Demo{background:white}')

    def showDialog(self):
        title = 'Are you sure you want to delete the folder?'
        content = """If you delete the "Music" folder from the list, the folder will no longer appear in the list, but will not be deleted."""
        w = Dialog(title, content, self)
        if w.exec():
            print('Yes button is pressed')
        else:
            print('Cancel button is pressed')


if __name__ == '__main__':
    app = QApplication(sys.argv)
    w = Demo()
    w.show()
    app.exec()
@runningsnai1 runningsnai1 added the bug Something isn't working label Apr 19, 2024
@AlexZhu2001
Copy link
Contributor

无法复现,相同代码运行正常

@runningsnai1
Copy link
Author

runningsnai1 commented Apr 19, 2024

bandicam.2024-04-19.21-39-15-348.mp4

我这里看很明显。。

@AlexZhu2001
Copy link
Contributor

确实有,但是FramelessDialog也会有,建议转移该问题到PyQt-Frameless-Window仓库

@AlexZhu2001
Copy link
Contributor

但是这个问题应该不影响使用。目前只发现在Windows上能复现,并且在我的环境下必须快速使用Esc关闭对话框才能看到。
应该是和Windows上无边框窗口的实现方式有关的。Windows上无边框窗口是使用FramelessWindowHint + Windows native的flag + WM_NCCALCSIZE 实现的,可能和这些有关,如果不实现WM_NCCALCSIZE就会显示原生的标题栏,也许是Python太慢了?

@zhiyiYo zhiyiYo transferred this issue from zhiyiYo/PyQt-Fluent-Widgets May 4, 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

2 participants