From pykde Wed Nov 03 20:32:01 2004 From: "Truls A. Tangstad" Date: Wed, 03 Nov 2004 20:32:01 +0000 To: pykde Subject: Re: [PyKDE] Using custom components and Qt Designer with Message-Id: <20041103203200.GB21697 () herocamp ! org> X-MARC-Message: https://marc.info/?l=pykde&m=109951400807754 On Wed, Nov 03, 2004 at 05:24:52PM +0000, Toby Dickenson wrote: > On Wednesday 03 November 2004 16:55, Truls A. Tangstad wrote: > > We use QWidgetFactory exclusively to generate the widgets runtime > > from the .ui-files, and using pyuic would put us back into > > gui-design stoneage again (gui mixed too much with other code, and > > hard to redesign components). > > Its always nice to hear about alternative techniques that make my > current standard practice look stoneage... do you have any public > documentation about how this works and why it is good? I've seen surprisingly little documentation or examples about the use of Qt Designer with QWidgetFactory, especially with PyQt. After we found out about it we've been using it extensively making GUI work exceptionally easier and code alot cleaner. We still have abit gui code mixed in, especially connecting signals from the .ui-files to local functions, but it's still alot better than before. The principle is pretty much equal to using libglade and the glade editor with GTK, which I experimented with before finding out about the Qt equivalent. > > Is there a way to use Qt Designer to embed python-created > > components into dialogs etc. when they are loaded with > > QWidgetFactory inty our python application? > > For the occasional custom widget on a pyuic form we either insert an > empty QFrame and manually create the widget inside it, or insert a > QLabel placeholder that gets manually replaced. All stoneage stuff I > guess.... Do you mean by altering the generated sourcecode, or by programmatically replacing the component? If it's the latter, I'd be interested in knowing how to remove a placeholder-widget (i.e. a QFrame) from a Qt Designer .ui-file at runtime, and replace it with a custom widget, as that would go a long way to solve my problem. -- Truls A. Tangstad - _______________________________________________ PyKDE mailing list PyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde