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:
parent
461549c35a
commit
c5332859c8
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user