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.65k stars 544 forks source link

关于TitleBar #287

Closed Changgeng-Wei closed 1 year ago

Changgeng-Wei commented 1 year ago

大佬,我要自定义标题栏,加个按钮,然后在测试用官方的StandardTitleBar时,出现奔溃,调试原因,提醒WindowsFramelessWindow的resizeEvent()方法中,有widget已经被删除,但是仍然被使用 class TestStickButton(FramelessWindow): def init(self): super(TestStickButton, self).init() self.titleBar = StandardTitleBar(parent=self) self.setTitleBar(self.titleBar)

zhiyiYo commented 1 year ago

代码写的有问题:不需要再次赋值self.titleBar = StandardTitleBar(parent=self),把这一行去掉就行,换成 self.setTitleBar(StandardTitleBar(self))