[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] Using custom components and Qt Designer with
From:       "Truls A. Tangstad" <kerfue+pykde () herocamp ! org>
Date:       2004-11-04 10:03:32
Message-ID: 20041104100331.GA25857 () herocamp ! org
[Download RAW message or body]

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:
> >
> > <snippet>
> > 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')
> >
> > </snippet>
> >
> > 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.

-- 
Truls A. Tangstad - <kerfue+pykde@h e r o c a m p.org>

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic