PDA

View Full Version : How to align a QComboBox vertically on Mac OS X in Qt 4



AndyBrice
4th March 2015, 17:45
I have a horizontal layout containing a QLabel, QComboBox and QLineEdit. I looks fine on Windows. But on Mac OS X the QComboBox vertical alignment is off.

10987

(red lines added by me)

So I tried changing the QComboBox stylesheet:


lineEdit->setStyleSheet( "QLineEdit{ margin-top: 3px; }" );

That looks better:

10986


But the QLineEdit focus rectangle looks all wrong:

10988

(Note the gap at the top of the focus rect).

I know its not a big deal. But it looks wrong and its irking me!

I am using Qt 4.8.6 on Mac OS X 10.10.