Package moul :: Package qt :: Module utils
[hide private]
[frames] | no frames]

Module utils



Misc utilities

It also contains several functions to create message boxes.

Classes [hide private]
  QNamespaceContainer
Base class to assemble methods and logic in its own class.

Functions [hide private]
  connectSlotsByName(container, callobj)
A version of connectSlotsByName() that uses a potentially different object to search for widget instances and to search for callbacks.
  _mkMessageBox(context, icon='Information')
Create a message box
  criticalMB(context, title, text)
Critical message box
  warningMB(context, title, text)
warning message box
  infoMB(context, title, text)
Info message box

Variables [hide private]
  __author__ = 'Christian Heimes'
  __version__ = '$Id'
  __revision__ = '$Revision: 131 $'
  _marker = <object object at 0x4003d4b8>
  SLOT_RE = <_sre.SRE_Pattern object at 0x40385660>

Function Details [hide private]

connectSlotsByName(container, callobj)

 

A version of connectSlotsByName() that uses a potentially different object to search for widget instances and to search for callbacks. This is more flexible than the version that is provided with Qt because it allows you to bind to callbacks on any object, not just on the widget container class itself. You can also call this with a number of combinations of container and callback objects.

See QtCore.QMetaObject.connectSlotsByName() for some background info.

Based on http://www.diotavelli.net/PyQtWiki/AutoConnectingSlots
Parameters:
  • container (instance of a QObject subclass) - an instance whose attributes will be inspected to find Qt widgets.
  • callobj (instance of a QObject subclass) - an object which will be inspect for appropriately named methods to be used as callbacks for widgets on 'container'.

Note: You *must* use @pyqtSignature() if the method takes an argument!

_mkMessageBox(context, icon='Information')

 
Create a message box

criticalMB(context, title, text)

 
Critical message box

warningMB(context, title, text)

 
warning message box

infoMB(context, title, text)

 
Info message box

Variables Details [hide private]

__author__

None
Value:
'Christian Heimes'                                                     
      

__version__

None
Value:
'$Id'                                                                  
      

__revision__

None
Value:
'$Revision: 131 $'                                                     
      

_marker

None
Value:
<object object at 0x4003d4b8>                                          
      

SLOT_RE

None
Value:
^on_(.+)_([^_]+)$