开发者

Extract a portion of a Qt .ui file into its own .ui file

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?


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜