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

禁用窗口大小调整依旧可以通过拖动标题栏到桌面顶部的方式最大化窗口 #177

Open
xceyds opened this issue Jan 20, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@xceyds
Copy link

xceyds commented Jan 20, 2025

Describe the bug

禁用窗口大小调整依旧可以通过拖动标题栏到桌面顶部最大化窗口 如何禁用拖动贴边调整窗口大小的功能

Environment

  • OS: Windows10
  • DPI scaling: 100%
  • Python: [3.12 64-bit]
  • PySide6: [6.8.1]

To Reproduce

设置禁止调制窗口大小
拖动窗口到桌面顶部 窗口最大化
设置.setFixedSize属性后 窗口不会最大化 但是显示异常
Image
设置.setWindowFlags(Qt.FramelessWindowHint)窗口也不会最大化 但是会失去阴影
Image

Code

from PySide6 import QtWidgets
from PySide6.QtCore import Qt
from qframelesswindow import FramelessWindow

class MainWindow(FramelessWindow):
    def __init__(self):
        super().__init__()
        self._isResizeEnabled = False
        self.setResizeEnabled(False)
        self.titleBar.maxBtn.hide() 
        self.titleBar._isDoubleClickEnabled = False 
        self.setFixedSize(200, 100)
        self.setWindowFlags(Qt.FramelessWindowHint)

if __name__ == "__main__":
    app = QtWidgets.QApplication([])
    window = MainWindow()
    window.show()
    app.exec()

Expected behavior

禁用调整窗口大小时,禁用拖动窗口到桌面顶部时窗口自动最大化

@xceyds xceyds added the bug Something isn't working label Jan 20, 2025
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