views:

45

answers:

2

We have a designer creating a user interface for an application. The main window has several QStackedWidgets used for in place panel switching. What I'd like to be able to do is extract each individual panel that makes up each page of the QStackedWidget into it its own .ui file.

Is there an easy way to accomplish this from within Qt Designer, or are there any other tools to help accomplish this task short of redesigning all of the panels in their own .ui files?

+2  A: 

You can cut/paste each panel into a blank QWidget (created with File > New), and save these widgets in their own .ui file.

Luper Rouch
That almost works. It just doesn't copy the layout.
Grant Limberg
A: 

When you copy a widget(lets call it widgetA) that contains other widgets(calling them miniWidgets) then the miniWidgets should still be layed out. WidgetA still needs a relayout and in that case its very easy to add a layout since you can practically use any layout you want (i suggest vertical or horizontal). Just right click on the widget containing widgetA then select Layout->horizontal Layout and that should do the trick.

If there is more than one widget than needs relayout then you are not copying the panel correctly and should copy one that englobes more of the panel.

yan bellavance