title: QUiLoader.createWidget equivalent in PyQt
body: <p>I have a PySide application that I'm investigating making compatible with PyQt4. Obviously this shouldn't be too difficult, but I'd like to minimise the number of code changes necessary. The biggest difference I've come across (which affects my program) is the fact that PyQt does not wrap the <code>QUiLoader</code> class.</p>
  
  <p>Now I realise that I can still load ui files with the uic module in PyQt, however I'm currently using a subclass of <code>QUiLoader</code> in PySide that implements some custom functionality that I'd like to reserve if possible.</p>
  
  <p>The functionality is as follows. I've subclassed <code>QUiLoader</code> and overridden the <code>createWidget()</code> method. My new implementation allows you to dynamically register widget promotions at application runtime. I can do this because the <code>createWidget()</code> method is responsible for instantiating the widgets from the ui file, after which (I believe) the standard QUiLoader implementation applies the specified properties from the ui file.</p>
  
  <p>My Question is, is there a similar method I could override in PyQt to dynamically set widget Promotion at runtime, rather than having to set it statically through Qt Designer and the ui file.</p>
  
  <p>P.S. I'm looking for a solution that involves minimal change to my existing code. For instance if I could replace my PySide <code>QUiLoader</code> subclass with a class that provides equivalent behaviour under PyQt, that would be ideal.</p>
  
  <p><strong>EDIT:</strong>
  The implementation would be used something like:</p>
  
  <pre><code>loader = UiLoader()
  loader.registerCustomPromotion("myWidgetNameInQtDesigner",ClassToPromoteTo)
  ui = loader.load('myUiFile.ui')
  </code></pre>
  
  <p>This is effectively what I have made with my subclass of <code>QUiLoader</code> in PySide. Any widget in the .ui file with the name <code>"myWidgetNameInQtDesigner"</code> would be instantiated as an instance of <code>ClassToPromoteTo</code>.</p>