def __init__(self, meth, loops): super(Win, self).__init__() layout = QtGui.QVBoxLayout() self.setLayout(layout) root = QtGui.QWidget() root.setLayout(layout) self.setCentralWidget(root) log.debug('Starting {0} {1} creations ...', loops, meth) start = datetime.now() widgets = list() old_pgr = 0 loop = 0 pgr_step = min(50, loops) while loop < loops: loop += 1 if meth == "dyn": w = UiFactory.instance(self._tstui, parent=root) else: w = UiFactory.load(self._tstui, cache=False) if loop == 1: print "_" * 2 * pgr_step pgr = int(loop * pgr_step / loops) if pgr != old_pgr: print "#", old_pgr = pgr widgets.append(w) # time.sleep(1) print '' print datetime.now() - start # os._exit(42) start = datetime.now() log.debug('add to layout ...') for w in widgets: layout.addWidget(w) print datetime.now() - start log.debug('DONE')
import sys import scramble from PySide import QtCore, QtGui from cgev.ui.window import UiFactory files = [ "c:/work/cgev/cgevproductiontools/sbra/src/ui/AEWindow.ui", "c:/work/cgev/cgevproductiontools/sbra/src/ui/OutlinerWindow.ui", "c:/work/cgev/cgevproductiontools/sbra/src/ui/SbraWindow.ui", "C:/work/T00N3Kit/nodal/wip/nodes/defaultNode.ui" ] app = QtGui.QApplication(sys.argv) for path in files: print path widget = UiFactory.widget(path)