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

Class LoadingIcon

       object --+                
                |                
sip.simplewrapper --+            
                    |            
          sip.wrapper --+        
                        |        
     PyQt4.QtCore.QObject --+    
                            |    
           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 = QtWidgets.QPushButton('Button')

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

    self.launchTask()
    
def taskCallback(self):

    self.loading_icon.stopLoading()

Nested Classes [hide private]

Inherited from PyQt4.QtGui.QMovie: CacheMode, MovieState

Instance Methods [hide private]
 
__init__(self, parent=None)
x.__init__(...) initializes x; see help(type(x)) for signature
 
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

Inherited from PyQt4.QtGui.QMovie: backgroundColor, cacheMode, currentFrameNumber, currentImage, currentPixmap, device, error, fileName, finished, format, frameChanged, frameCount, frameRect, isValid, jumpToFrame, jumpToNextFrame, loopCount, nextFrameDelay, resized, scaledSize, setBackgroundColor, setCacheMode, setDevice, setFileName, setFormat, setPaused, setScaledSize, setSpeed, speed, start, started, state, stateChanged, stop, supportedFormats, updated

Inherited from PyQt4.QtCore.QObject: __getattr__, blockSignals, childEvent, children, connect, connectNotify, customEvent, deleteLater, destroyed, disconnect, disconnectNotify, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, emit, event, eventFilter, findChild, findChildren, inherits, installEventFilter, isWidgetType, killTimer, metaObject, moveToThread, objectName, parent, property, pyqtConfigure, receivers, removeEventFilter, sender, senderSignalIndex, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent, tr, trUtf8

Inherited from sip.simplewrapper: __new__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from PyQt4.QtGui.QMovie: CacheAll, CacheNone, NotRunning, Paused, Running

Inherited from PyQt4.QtCore.QObject: staticMetaObject

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, parent=None)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

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.