A Dimarts 03 Febrer 2009, Frédéric va escriure:
> PS: does it already exist a simple solution to adapt this code:
>
>     thread = threading.Thread(target=func)
>     thread.start()
>
> using QThread?

Not that I know of, but it's trivial to implement. Something like this should 
do:

class FunctionThread(QThread):
        def __init__(self, function, parent=None):
                QThread.__init__(self, parent)
                self.function = function

        def run(self):
                self.function()

>
> --
>    Frédéric
>
> _______________________________________________
> PyQt mailing list    PyQt@riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt



-- 
Albert Cervera i Areny
http://www.NaN-tic.com
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to