Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QtConcurrent in PySide/PyQt

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?

like image 980
Elteroooo Avatar asked Sep 03 '15 14:09

Elteroooo


1 Answers

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.

like image 99
ekhumoro Avatar answered Sep 20 '22 12:09

ekhumoro