我试图找出是否子类化QtConcurrent并在其中编写运行方法将工作:
class Task(QtCore.QtConcurrent): def run(self, function): function()还是完全没用?
I'm trying to figure out if subclassing QtConcurrent and writing a run method inside it will work:
class Task(QtCore.QtConcurrent): def run(self, function): function()Or is it completely useless?
最满意答案
这完全没用,因为QtConcurrent是一个命名空间,而不是一个类。
另外,PyQt和PySide都不提供QtConcurrent提供的任何功能,因为它都是基于模板的,因此无法打包。
PS:您链接到的PySide文档是针对ReduceOption枚举的。 由于该枚举是否在QtConcurrent命名空间之外有任何用处,这是一个疑问,PySide可能包含它。
It's completely useless, because QtConcurrent is a namespace, not a class.
Also, neither PyQt nor PySide provide any of the functionality provided by QtConcurrent, because it's all template-based and therefore impossible to wrap.
PS: the PySide documentation you linked to is for the ReduceOption enum. Since it's doubtful whether that enum has any use outside the QtConcurrent namespace, it's probably a bug that PySide includes it.
更多推荐
发布评论