Package vqt :: Module basics
[hide private]
[frames] | no frames]

Source Code for Module vqt.basics

 1  ''' 
 2  A place for some no-brainer basics :) 
 3  ''' 
 4   
 5  from PyQt4 import QtCore, QtGui 
 6   
7 -class VBox( QtGui.QVBoxLayout ):
8
9 - def __init__(self, *widgets):
10 QtGui.QVBoxLayout.__init__(self) 11 self.setMargin(2) 12 self.setSpacing(4) 13 for w in widgets: 14 if w == None: 15 self.addStretch() 16 continue 17 self.addWidget( w )
18
19 -class HBox( QtGui.QHBoxLayout ):
20
21 - def __init__(self, *widgets):
22 QtGui.QHBoxLayout.__init__(self) 23 self.setMargin(2) 24 self.setSpacing(4) 25 for w in widgets: 26 if w == None: 27 self.addStretch() 28 continue 29 self.addWidget( w )
30
31 -class ACT:
32 - def __init__(self, meth, *args, **kwargs):
33 self.meth = meth 34 self.args = args 35 self.kwargs = kwargs
36
37 - def __call__(self):
38 return self.meth( *self.args, **self.kwargs )
39