From pykde Thu Nov 04 10:52:46 2004 From: "Phil Thompson" Date: Thu, 04 Nov 2004 10:52:46 +0000 To: pykde Subject: Re: [PyKDE] Using custom components and Qt Designer with Message-Id: <26588.82.68.80.137.1099565566.squirrel () 82 ! 68 ! 80 ! 137> X-MARC-Message: https://marc.info/?l=pykde&m=109956561118984 > On Thu, Nov 04, 2004 at 09:28:26AM -0000, Phil Thompson wrote: >> Truls A. Tangstad wrote: >> > I'd be quite happy with syntax such as this: >> > >> > >> > from uiloader import ModuleFactory >> > >> > mymodule = ModuleFactory('/path/to/ui/file/here.ui') >> > MyClass = mymodule.MyClass # if you really need the direct name >> > >> > my_object = MyClass("some", "happy", "parameters") >> > >> > # or if you really just need the class >> > mymodule = ModuleFactory('/path/to/ui/file/here.ui').MyClass >> > >> > # or if you'd really like a class factory too, for convinience >> > from uiloader import ClassFactory >> > MyClass = ClassFactory('/path/to/ui/file/here.ui', 'MyClass') >> > >> > >> > >> > Creating an implementation of ModuleFactory and ClassFactory should be >> > pretty straightforward as long as they use pyuic, which brings me to >> > my most important point: I _really_ want pyuic available as a module >> > in the pyqt-library, and not have to run it as a shell program. >> >> Yes, I've been thinking about this for Qt v4. Normally with a new major >> release of Qt (v1, v2 etc) I re-implement pyuic based on the new uic. >> This >> time I'm considering re-implementing it in Python which could then be >> run >> from the command line, or imported as a module. > > That would solve alot of our problems so I'd say go for it ;) > > Would it be viable to implement something like ModuleFactory and > ClassFactory as part of a future pyuic-module, or should that be in > the hands of us application developers? > > I can easily imagine a module-factory being just another function > available in a pyuic module, which would be very very cool. Yes, I'd be happy to add Python specific functionality. It being in a separate module clearly separates it from the regular Qt API. Of course, somebody else could take it on as a nice little project... Phil _______________________________________________ PyKDE mailing list PyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde