0

I have some troubles in using layouts. as you know Qt designer has some layouts by default but they cant help me. in the widgets bar in layouts section there are some customized layouts but I cant use them , they are actually do nothing when i insert them into my ui. now anyone can help me to use them? sorry if my english is not so good. its not my first language by the way.

Ezee
  • 4,214
  • 1
  • 14
  • 29
  • 1
    What names of 'customized' layouts you have tried? What do you mean that they do nothing? What behavior do you expect? – Ezee Sep 29 '14 at 13:59
  • I mean they are just empty spaces that do nothing. i can insert them to my ui but if I add a widget (like a push button) in them they don't act like a layout. they don't expand or don't keep the widget position. but what I want is I need to put my whole program in a layout in the corner of window and put another program in rest of empty spaces. –  Sep 29 '14 at 14:07

1 Answers1

0

Qt Designer doesn't support custom layouts yet. It has been requested, but no work has started on implementing this.

You can create a custom widget designer plug-in that uses your layout, although I don't think it will behave well in Qt Designer; see Adding Qt Designer Plugins.

You can derive from QLayout and implement everything by hand but Qt Designer won't support custom layouts.

Toby Speight
  • 27,591
  • 48
  • 66
  • 103
Jacob Krieg
  • 2,834
  • 15
  • 68
  • 140
  • if custom layouts are not supported in Qt designer why they are exist there? –  Sep 29 '14 at 13:58
  • Unless something happened in Qt 5.3.2 I don't see any customized layouts in my designer and I use Qt 5.3.1. In my designer I have only `Vertical Layout`, `Horizontal Layout`, `Grid Layout` and `Form Layout`. What Qt version are you using? Can you post a screenshot with your *customized layouts*? – Jacob Krieg Sep 29 '14 at 14:01
  • I bet he calls these 4 layouts 'customized' – Ezee Sep 29 '14 at 14:05
  • yes ezee is right. they are not customized? but when i right click in my window i can use these layouts. but in widget bar i can use them like widgets. i thought they are custom!! so what should i do??? –  Sep 29 '14 at 14:11
  • They are not custom, they are built in the `Designer`. As you can't use custom layouts in the designer you have 2 options: stick with the available layouts or make the widgets you need to use the layout custom. What you could also try is create custom `Qt Designer` plugin that is nothing but a `QWidget` using your custom layout. Although I can't say for sure as I didn't do it yet it is hard to believe that inside `Qt Designer` it will behave as you expect. – Jacob Krieg Sep 29 '14 at 14:17
  • thank you dear Jacob. now I know what to do. I thought this layouts are custom but now i get it. –  Sep 29 '14 at 14:23
  • Unfortunately they are not. I also spent a few hours some days ago till I figured it out. Hopefully they will add this feature in the future releases. – Jacob Krieg Sep 29 '14 at 14:27
  • Hop so. it will really help. –  Sep 29 '14 at 14:33