Julieng031
17th April 2014, 11:46
Hello,
I am trying to position a QComboBox in a layout but I cannot succeed to do it, could you help me ?
Indeed, I have a QVBoxLayout in which I have added : a QLabel (visible), a QComboBox (visible) and a QWidget (not visible at the beginning). The result is that the QLabel and the QCombobox are positioned at the bottom of the QVBoxLayout. When I turn the QWidget to visible, both QLabel and QComboBox goes at the top (pushed by the QWidget).
Is there a way to have, from the beginning, the QLabel and the QComboBox positionned at the top. I have found "setAlignment(Qt::AlignTop)" for the QLabel but nothing for the QComboBox.
Thanks in advance.
Added after 5 minutes:
I found that : "setDirection(QBoxLayout::TopToBottom)", applied to the QVBoxLayout.
However, QLabel is now positionned in the middle and the QComboBox at the bottom of the QLayout.
I am trying to position a QComboBox in a layout but I cannot succeed to do it, could you help me ?
Indeed, I have a QVBoxLayout in which I have added : a QLabel (visible), a QComboBox (visible) and a QWidget (not visible at the beginning). The result is that the QLabel and the QCombobox are positioned at the bottom of the QVBoxLayout. When I turn the QWidget to visible, both QLabel and QComboBox goes at the top (pushed by the QWidget).
Is there a way to have, from the beginning, the QLabel and the QComboBox positionned at the top. I have found "setAlignment(Qt::AlignTop)" for the QLabel but nothing for the QComboBox.
Thanks in advance.
Added after 5 minutes:
I found that : "setDirection(QBoxLayout::TopToBottom)", applied to the QVBoxLayout.
However, QLabel is now positionned in the middle and the QComboBox at the bottom of the QLayout.