PinTxO
27th October 2015, 11:57
Hi everyone.
I have the next problem. In runtime I create a QWidget with a QHBoxLayout layout and from the left to the right, I create a QLabel, a QSpacerItem, a QComboBox and a QPushButton. The idea is putting the label on the left and all the rest to the right. I put a minimum width to the combo but the spaceritem doesn't respect it doing it smaller than I want. Why?
The QSpacerItem:
auto headerSpacer = new QSpacerItem(0, 0, QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
The minimum width of the combo:
comboDevices->setMinimumWidth(500);
I have the next problem. In runtime I create a QWidget with a QHBoxLayout layout and from the left to the right, I create a QLabel, a QSpacerItem, a QComboBox and a QPushButton. The idea is putting the label on the left and all the rest to the right. I put a minimum width to the combo but the spaceritem doesn't respect it doing it smaller than I want. Why?
The QSpacerItem:
auto headerSpacer = new QSpacerItem(0, 0, QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
The minimum width of the combo:
comboDevices->setMinimumWidth(500);