summaryrefslogtreecommitdiffstats
path: root/examples/widgets/doc/src
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2023-12-13 19:16:14 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2023-12-19 06:05:56 +0100
commita5d14a9f5cfe41784960fe825609d91b9a18c17e (patch)
treed3b311a650c3b8d20e81eebbdcb2ead7395de185 /examples/widgets/doc/src
parenta5bccd2496e0e06edf864385c1865d3faca9d1ac (diff)
JNI API review: use has-a-QJniObject relationship for QtJniTypes types
Don't subclass QJniObject. It's not necessary, and gets us into UB territory due to QJniObject not having a virtual destructor. Also, rename the helper class to JObject, as Object is a valid Java class that one might want to be able to declare explicitly. Instead, give the declared QtJniTypes types a QJniObject member that they forward the calls to. That requires some duplication of APIs, but at the same time makes it unnecessary to explicitly remove the old QJniObject APIs that we want to ultimately deprecate. We need to specialize a few more of the conversion routines to handle such types now, as QJniObject is no longer a base class. To be able to do that we need to add a base class that we can test for, and that has the APIs that don't depend on the template parameter. Since we now need to know about QtJniTypes::JObject(Base) in the conversion routines that are implemented in qjniobject.h, we have to move these base types into that header as well. This reduces the qjnitypes.h header to the macros for declaring types and a few helpers for native methods, which is perhaps how it should be anyway. Pick-to: 6.7 Change-Id: If2052a79a108fdb62ca71c88f4fa04d9f5ea2c4b Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'examples/widgets/doc/src')
0 files changed, 0 insertions, 0 deletions