PDA

View Full Version : Alignment in QComboBox



Naami
26th May 2010, 12:33
Hi;:)
how can I set the QComboBox to be center aligned when I insert the value.

nikhilqt
26th May 2010, 13:38
Look into
QComboBox::SizeAdjustPolicy . You can use
QComboBox::AdjustToContents and can give spacing accordingly.

Naami
26th May 2010, 14:53
Hi; thanks ;


WindowSize=new QComboBox;// 2 4 16...
WindowSize->setEnabled(false);
QStringList sl;
for(int i=0, j=128; i<7; i++, j*=2)
sl<<QString::number(j);
WindowSize->addItems(sl);
WindowSize->setSizeAdjustPolicy(QComboBox::AdjustToContents);

this code isn't worked :confused: