Remove sunken state for Android.

Only QLineEdit always sets the sunken state and on some Android devices
(e.g HTC) the line edit is painted as it is pressed.

Task-number: QTBUG-29565
Change-Id: I25031ffaadba85cae6b6ff17c0847cb706e23503
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
This commit is contained in:
BogDan Vatra 2013-10-17 16:52:29 +03:00 committed by The Qt Project
parent 9b9c63c27d
commit b01ec07a06

View File

@ -515,8 +515,15 @@ void QAndroidStyle::drawPrimitive(PrimitiveElement pe,
AndroidControlsHash::const_iterator it = itemType != QC_UnknownType
? m_androidControlsHash.find(itemType)
: m_androidControlsHash.end();
if (it != m_androidControlsHash.end())
it.value()->drawControl(opt, p, w);
if (it != m_androidControlsHash.end()) {
if (itemType != QC_EditText)
it.value()->drawControl(opt, p, w);
else {
QStyleOption copy(*opt);
copy.state &= ~QStyle::State_Sunken;
it.value()->drawControl(&copy, p, w);
}
}
else
QFusionStyle::drawPrimitive(pe, opt, p, w);
}