PDA

View Full Version : Custom tab in QT4



khukman
13th August 2007, 16:39
I am wanting to create custom tabs (a little different functionality dependent on selection on main tab) for my application. Essentially, I want to create subclasses of the tab widget created in the Designer, and instantiate a certain one, as specified by a selection on the main tab. I can't seem to figure out how to get this accomplished using the designer. In looking at the code generated from the Designer, it looks like I could just substitute my class into the calls that create the individual tabs that are then added to the QTabWidget, but how do I do this without actually editing the Qt-generated code after the fact, and losing it when the UI changes? Will this have to be custom code? I want to maintain the ease of editing the dialogs/forms with the Designer.

Thanks!


Rob

jpn
13th August 2007, 16:53
See Using Custom Widgets with Qt Designer - Promoting Widgets (http://doc.trolltech.com/4.3/designer-using-custom-widgets.html#promoting-widgets). In short, choose "Promote to..." from the context menu of a child widget in designer.