Package schrodinger :: Package application :: Package bioluminate :: Module bwidgets :: Class LoadingIcon
[hide private]
[frames] | no frames]

Class LoadingIcon

PyQt4.QtGui.QMovie --+
                     |
                    LoadingIcon


Animates a "loading" icon that can be used by any Qt object that
has the C{setIcon} method.

Example:

def startTask(self):

    self.button = QtGui.QPushButton('Button')

    self.loading_icon = bwidgets.LoadingIcon(self)
    self.loading_icon.startLoading(self.button)

    self.launchTask()
    
def taskCallback(self):

    self.loading_icon.stopLoading()

Instance Methods [hide private]
 
__init__(self, parent=None)
 
startLoading(self, qt_obj)
Set the qt_obj's icon to a loading icon.
 
cycle(self)
The callback for the frameChanged signal.
 
stopLoading(self)
Removes the loading icon and sets the object's icon back to the original icon
Method Details [hide private]

startLoading(self, qt_obj)

 

Set the qt_obj's icon to a loading icon.

Parameters:
  • qt_obj - Object to set icon for. Must have setIcon method.

cycle(self)

 

The callback for the frameChanged signal. This will grab the pixmap of the current frame and create an icon from it. It then sets the self.qt_obj's icon to this icon.