[PyQt] pyuic4 vs uic.loadUI
sebastianelsner at freenet.de
Tue Sep 28 21:10:49 BST 2010
Hmm interesting topic, I recently had to switch back from ui files to
py files because I couldnt get py2exe to package the ui files correctly
(Any help appreciated though)
Secondly using ui files I loose the comfort of auto-completion with
pydev and Eclipse, because pydev wouldnt know how to deal with the ui
xml data. If there is anybody out there having advice on that, I'd
gladly take it :)
Am 28.09.2010 21:46, schrieb fpp:
> On Tue, Sep 28, 2010 at 6:19 PM, pard<pardmeister at gmail.com> wrote:
>> I have found that some people use pyuic4 to compile their ui files and some
>> load them dynamically using loadUI.
>> Does anyone have the pro's and con's of each of these methods? What is the
>> recommended PyQT way of doing this?
> Thanks for starting the discussion, I've often wondered myself. I have
> no opinion one way or another, but since most seem to favour loadUI,
> I'll play the devil's advocate for pyuic4 :-)
> I can think of several reasons to prefer compiled ui files :
> 1) if you're using eric4 as an IDE, it does everything for you, so why not ?
> 2) on a reasonably recent PC, and for common UIs, the additional
> launch time, CPU& memory usage due to loadUI are probably not even
> measurable, compared to the Python, Qt and PyQt startup load.
> For extremely complex and widget-heavy UIs this might be less evident
> : parsing XML is not the most efficient thing in the world after all.
> And if we're running on mobile platforms with more limited
> power/CPU/RAM and slow Flash I/O, like Nokia's Symbian or Maemo
> smartphones, it could become quite perceptible.
> 3) during the early design phases, it's sometimes handy to be able to
> manually modify a generated Python UI file, just to check out the
> effect of some minor change, without having to do it in Designer
> (especially if it involves sizers :-)
> 4) if for some reason you wish or need to distribute only binaries, as
> sometimes happens, you can exclude the .ui source files and ship only
> the UI .pyc/pyo files.
> Dumb, yes, but not entirely impossible :-)
> PyQt mailing list PyQt at riverbankcomputing.com
More information about the PyQt