Bug 309265

Summary: editable QCombobox cuts Text at top and bottom
Product: [Unmaintained] Necessitas Reporter: Martin Koller <martin>
Component: Android Qt4Assignee: BogDan Vatra <bogdan>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: qt
Priority: HI    
Version First Reported In: beta1   
Target Milestone: Beta 2   
Platform: Android   
OS: Android 4.x   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Martin Koller 2012-10-30 17:54:48 UTC
I'm using a QDialog which shows a QComboBox. On the Android device, the editable text is not shown completely as there is an area at the top and at the bottom which is cutted (so you just see a horizontal stripe of the text in the line edit).
It also does not help if I define a minimal height for this widget - the minimum size is simply ignored [ combo->setMinimumSize(QSize(0, 40)); ]



Reproducible: Always
Comment 1 Sebastian 2013-01-14 22:48:24 UTC
The problem is the StyleSheet of the ComboBox's LineEdit, which is private. To change the style I had to subclass the QCombobox and add this to it:

QLineEdit * MyComboBox::editor () const
{
    return this->lineEdit();
}

Now you can style the lineEdit of the editor:

comboBox->editor()->setStyleSheet(
                "padding-top: 0px; "
                "padding-bottom: 0px; "
                "margin:0px; "
                "color: rgb(90,31,0); "
                "background-color: rgb(253, 231,146); "
                );