2
votes

I have a QWidget with following items aranged in a vertical layout:

- QWidget
  - QVBoxLayout
    - QPushButton
    - QPushButton
    - QPushButton
    - QListView
    - QComboBox

now, I would like to arrange the QComboBox in a horizontal alignment to one of the buttons. I gave the booton a maximumSize of 36 x 16777215 and it sits at the top left of the widget. How Do I get the combo box to align on the right side of it? Here's a screen shot of what I currently have:

QWidget

2

2 Answers

6
votes

Embed your combobox into an horizontallayout and add spacer https://doc.qt.io/archives/2.3/designer/chap4_2.html

0
votes

You can add a QWidget (or a QFrame) at the top of your vertical layout, then you give this widget (or frame) an horizontal layout and you put your button and your combox box inside this widget with the horizontal layout.