[Android]: Ensure clicking on the arrow shows the popup

This was a problem with editable comboboxes specifically as there is
an edit field area which is separate to the arrow. Giving a valid
rectangle for the arrow allows QComboBox to know that it was
clicked on.

Task-number: QTBUG-44931
Change-Id: Ie1d06a6631d6c7f5e813419a5e76f67ec9dcd7e8
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
This commit is contained in:
Andy Shaw 2015-03-08 21:33:02 +01:00
parent 156be54578
commit 8a60f57462

View File

@ -1811,6 +1811,10 @@ QRect QAndroidStyle::AndroidSpinnerControl::subControlRect(const QStyleOptionCom
{
if (sc == QStyle::SC_ComboBoxListBoxPopup)
return option->rect;
if (sc == QStyle::SC_ComboBoxArrow) {
const QRect editField = subControlRect(option, QStyle::SC_ComboBoxEditField, widget);
return QRect(editField.topRight(), QSize(option->rect.width() - editField.width(), option->rect.height()));
}
return AndroidControl::subControlRect(option, sc, widget);
}