We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug pyside6下直接以最大化窗口运行代码,不能正常缩小放大窗口。(pyqt5正常)
Environment 环境信息
To Reproduce window.showMaximized()
window.showMaximized()
Code 最小复现代码
# coding:utf-8 import sys from PySide6.QtCore import Qt from PySide6.QtWidgets import QApplication, QLabel, QMenuBar, QMenu, QStatusBar, QTextEdit, QHBoxLayout from qframelesswindow import FramelessMainWindow, FramelessDialog class MainWindow(FramelessMainWindow): def __init__(self): super().__init__() self.setWindowTitle("Frameless Main Window") # add menu bar menuBar = QMenuBar(self.titleBar) menu = QMenu('File(&F)', self) menu.addAction('open') menu.addAction('save') menuBar.addMenu(menu) menuBar.addAction('Edit(&E)') menuBar.addAction('Select(&S)') menuBar.addAction('Help(&H)', self.showHelpDialog) self.titleBar.layout().insertWidget(0, menuBar, 0, Qt.AlignLeft) self.titleBar.layout().insertStretch(1, 1) self.setMenuWidget(self.titleBar) # add status bar statusBar = QStatusBar(self) statusBar.addWidget(QLabel('row 1')) statusBar.addWidget(QLabel('column 1')) self.setStatusBar(statusBar) # set central widget self.textEdit = QTextEdit() self.setCentralWidget(self.textEdit) self.setStyleSheet(""" QMenuBar{background: #F0F0F0; padding: 5px 0} QTextEdit{border: none; font-size: 15px} QDialog > QLabel{font-size: 15px} """) def showHelpDialog(self): w = FramelessDialog(self) # add a label to dialog w.setLayout(QHBoxLayout()) w.layout().addWidget(QLabel('Frameless Dialog'), 0, Qt.AlignCenter) # raise title bar w.titleBar.raise_() w.resize(300, 300) # disable resizing dialog w.setResizeEnabled(False) w.exec() if __name__ == '__main__': # enable dpi scale QApplication.setHighDpiScaleFactorRoundingPolicy( Qt.HighDpiScaleFactorRoundingPolicy.PassThrough) QApplication.setAttribute(Qt.AA_EnableHighDpiScaling) QApplication.setAttribute(Qt.AA_UseHighDpiPixmaps) app = QApplication(sys.argv) # fix issue #50 app.setAttribute(Qt.AA_DontCreateNativeWidgetSiblings) window = MainWindow() window.showMaximized() app.exec()
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
pyside6下直接以最大化窗口运行代码,不能正常缩小放大窗口。(pyqt5正常)
Environment
环境信息
To Reproduce
window.showMaximized()
2025-02-10.092310.mp4
Code
最小复现代码
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
The text was updated successfully, but these errors were encountered: