Fix QRect calculation in inputItemRectangle

Because of QRect's width and height are caluculated values, they got
spoiled after x and y values setting.

This bug affects, in particular, Android software keyboard appearance:
it could overlap focused input field.

Change-Id: I27ccca27111219818722951fe6f463388d76c702
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This commit is contained in:
Dmitry Chmerev 2017-01-10 20:11:04 +03:00 committed by Konstantin Ritt
parent 461549c35a
commit c5332859c8

View File

@ -354,10 +354,10 @@ static QRect inputItemRectangle()
? QHighDpiScaling::factor(window)
: QHighDpiScaling::factor(QtAndroid::androidPlatformIntegration()->screen());
if (pixelDensity != 1.0) {
rect.setX(rect.x() * pixelDensity);
rect.setY(rect.y() * pixelDensity);
rect.setWidth(rect.width() * pixelDensity);
rect.setHeight(rect.height() * pixelDensity);
rect.setRect(rect.x() * pixelDensity,
rect.y() * pixelDensity,
rect.width() * pixelDensity,
rect.height() * pixelDensity);
}
return rect;
}