PySide / PyQt中的QtConcurrent(QtConcurrent in PySide/PyQt)

编程入门 行业动态 更新时间:2024-10-25 08:21:59
PySide / PyQt中的QtConcurrent(QtConcurrent in PySide/PyQt)

我试图找出是否子类化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.

更多推荐

本文发布于:2023-08-05 19:57:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1438366.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:PySide   PyQt   QtConcurrent

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!