Closed Changgeng-Wei closed 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)
代码写的有问题:不需要再次赋值self.titleBar = StandardTitleBar(parent=self),把这一行去掉就行,换成 self.setTitleBar(StandardTitleBar(self))
self.titleBar = StandardTitleBar(parent=self)
self.setTitleBar(StandardTitleBar(self))
大佬,我要自定义标题栏,加个按钮,然后在测试用官方的StandardTitleBar时,出现奔溃,调试原因,提醒WindowsFramelessWindow的resizeEvent()方法中,有widget已经被删除,但是仍然被使用 class TestStickButton(FramelessWindow): def init(self): super(TestStickButton, self).init() self.titleBar = StandardTitleBar(parent=self) self.setTitleBar(self.titleBar)