Макет дизайнера QT внутри макета - PullRequest
0 голосов
/ 18 июня 2020

Я не могу спроектировать макет ниже в qt -designer

Итак, в главном окне у нас есть один горизонтальный макет, который имеет два вертикальных макета и каждый вертикальный макет имеет. * один горизонтальный макет, содержащий поле со списком и кнопку sh

И еще один виджет Listview

1 Ответ

2 голосов
/ 18 июня 2020

Так как вы не включили никакой информации о том, какие шаги вы выполнили, пытаясь создать этот макет, и каков был окончательный результат, невозможно сказать, где go что-то не так. Однако, чтобы создать макет, как описано в сообщении, вы можете сделать следующее.

Шаг 1: Добавить виджеты в форму

В новой форме в Qt Designer примерно поместите виджеты там, где вы хотите, чтобы они были в окончательной компоновке.

step one

Step 2: Add widgets to layouts

Add widgets to layouts starting with the deepest nested widgets. In this case that would be the comboboxes and push buttons. To add a push-button and combobox to a layout, select both push-button and combobox, either in the layout itself or in the object inspector, right-click on the selection and select lay out > lay out horizontally in the context menu.

step 2a

Repeat these steps for the other widgets and layouts. When adding the horizontal layout and the list view to a vertical layout, make sure you select the layout and not one of the widgets in the layout:

step 2a

Step 3: Set layout of main window

To set the layout of the main window, right-click either anywhere in the main area of the form outside of any child widget or on the MainWindow node in the object inspector and select layout > lay out horizontally. This should result in something like this

final layout

And the object tree in the object inspector will look something like this

конечное дерево объектов

...