Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
None
-
6.2
-
None
Description
Qt Android uses consecutive numbers starting from 1 as ids for View.setId(int) (variable m_surfaceId in src/plugins/platforms/android/androidjnimain.cpp). Additionally, the ids are used internally with an assumption that they are unique. It leads to unexpected behavior in some specific scenarios.
Exemplary situation leading to an undef behavior can be reproduced as follows:
- add native view using insertNativeView(id, ...) using id obtained via View.generateViewId()
- change coordinates of the added view using setSurfaceGeometry(id, ...)
As a result, geometry is changed for surface rendering Qt application not for just added native view because of the colliding ids.
My proposition is to use View.generateViewId() in androidjnimain.cpp for obtaining id, instead of relying on a private counter.