最近写了个界面,接收server
端推过来的数据,不断的实时更新显示。现在产品提出了这么个要求,就是表格里不是每个数据都在变化的,要求内容变化的单元格能够使其背景颜色变化一小段时间,这样user
就可以更直观的看到哪里在变化。就是类似于炒股软件,很多只股票,只要有字段一变化,会高亮一下,然后恢复正常颜色。
我查了一下,pyqt
好像没有相应的解决方法,不知道各位有何思路,而且pyqt
的界面刷新机制,是等到函数走完才会去刷新一次界面,如果想在函数里sleep
的话,是无效的,它会等sleep
完才刷新,才变化颜色。
I have never encountered this situation, but you can try to use qss to achieve it. However, there is relatively little information on QSS. You can look for information on CSS. Searching for the keyword "css delay color change" will yield results. The main reason is the transition attribute, which has a delay effect.
Give me two examples to see if it is useful
http://www.w3school.com.cn/cs...
http://www.111cn. net/cssp/c...