按下另一个按钮时,如何更改按钮的颜色(pyqt5,qt)
您好的应用程序,我正在尝试在按下不同按钮时更改一个按钮的颜色。
我正在通过创建一个名为Changeymbol的全局布尔变量来做到这一点,当更改符号返回true时,其中一个按钮将更改。
Hello for my application, I am trying to change the color of one button when different button is pressed.
I am doing this by creating a global boolean variable called changeSymbol, and one of the buttons will change when the changeSymbol returns true.
Here is my code:
[EDIT Due to difficulties in copy and pasting (also I am new to stack overflow) I will post screenshots instead]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道我是否理解问题,因为我看不到完整的代码。
也许您应该在一个函数中完成所有操作
I don't know if I understand problem because I can't see full code.
Maybe you should do all in one function
And if you have to keep code in separated functions then you could use
self.changeMode
instead of global variable. And also runClear_changed()
in `Change_pressed()