Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
plt.close( num ) # close figure with known number num
...
plt.close('all') # close all figures

Emit your own signal in PyQt4

Code Block

from PyQt4 import QtGui, QtCore
class Drag ( QtCore.QObject ):
    def __init__(self) :
        QtCore.QObject.__init__(self, None) # need it for signal exchange...
    ...

        self.emit( QtCore.SIGNAL('new_xy_center(int,int)'), x, y)

Receive your own signal in PyQt4

Code Block

from PyQt4 import QtGui, QtCore 
class BatchJobCorAna( QtCore.QObject ) : 
    def __init__(self) :
        QtCore.QObject.__init__(self, None) # need it for signal exchange...
    ...

    def connectToThread1(self):
        #try : self.connect( thread1, QtCore.SIGNAL('update(QString)'), self.updateStatus )
        try : self.connect( thread1, QtCore.SIGNAL('new_xy_center(int,int)'), self.updateStatus )
        except : logger.warning('connectToThread1 IS FAILED !!!', __name__)

    def updateStatus(self, x, y):
        print 'BatchJobCorAna: Signal is recieved, x,y=', x, y 

where thread1 is an object emiting the signal.