""" qtgui/UtilityThread.py: CCP4MG Molecular Graphics Program Copyright (C) 2001-2008 University of York, CCLRC Copyright (C) 2009-2010 University of York This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. """ #!/usr/bin/env python """PyQt4 port of the opengl/hellogl example from Qt v4.x""" from PyQt4 import QtCore class SocketThread(QtCore.QThread): def __init__(self,socket): QtCore.QThread.__init__(self) self.socket = socket class UtilityThread(QtCore.QThread): def dummy(self): pass def run(self): self.retval = self.fun() def __init__(self,fun=None): QtCore.QThread.__init__(self) self.retval = None if fun: self.fun = fun else: self.fun = self.dummy