PYQT5更改按钮颜色经常会导致冻结'直到我刷新屏幕
我有一个网格(22x16)的qpushbuttons,您可以选择路径算法的源和目标位置。运行时,我为按钮上色以显示从源到目的地的路径。这涉及在通往颜色的路径中转动下一个垫子,然后将先前的垫子更改为默认颜色。因此,这看起来像是一款蛇游戏,其中一个块在网格上移动。
在我进行大约30-40个颜色变化后发生的事情,颜色更改停止,几乎就像屏幕被冷冻一样。如果我单击Qwidget或最小化/最大化屏幕,则可以再次工作。该代码仍在背景中运行,事物正在“移动”,但它不再显示。
知道我可能做错了什么?这是pyqt5中的错误吗?
I have a grid (22x16) of QPushButtons that you select source and destination locations for a pathing algorithm. When it runs, I color the push buttons to show a path from the source to the destination. This involves turning next pad in the path to a color and changing the previous pad to the default color. So this would look like you a game of snake where a block is moving across the grid.
What happens after I do about 30-40 color changes, the color changing stops, almost like the screen is frozen. If I click on a QWidget or minimize/maximize the screen, it works again. The code is still running in the background and things are 'moving' but its just not displaying anymore.
Any idea what I might be doing wrong? is this a bug in pyqt5?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论