QJniObject: specialize the QtJniTypes::Traits to treat it like jobject
It doesn't make a lot of sense to pass QJniObject instances into APIs, but to be able to consistently treat QJniObject as an object type we have to register it with the java/lang/Object signature. Change-Id: Ic40e2676186bf327fa92764da51404985f74b565 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 82254fa836a21b5ec450a4ec7635e72403dded18) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
6c3513f514
commit
43f0b1fcee
@ -825,6 +825,21 @@ template <typename T> struct Traits<JObject<T>> {
|
||||
static constexpr auto signature() { return Traits<T>::signature(); }
|
||||
static constexpr auto className() { return Traits<T>::className(); }
|
||||
};
|
||||
|
||||
template<>
|
||||
struct Traits<QJniObject>
|
||||
{
|
||||
static constexpr auto className()
|
||||
{
|
||||
return CTString("java/lang/Object");
|
||||
}
|
||||
|
||||
static constexpr auto signature()
|
||||
{
|
||||
return CTString("Ljava/lang/Object;");
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
// This cannot be included earlier as QJniArray is a QJniObject subclass, but it
|
||||
|
@ -35,15 +35,6 @@ struct QtJniTypes::Traits<QtJavaWrapper>
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct QtJniTypes::Traits<QJniObject>
|
||||
{
|
||||
static constexpr auto signature()
|
||||
{
|
||||
return QtJniTypes::CTString("Ljava/lang/Object;");
|
||||
}
|
||||
};
|
||||
|
||||
struct QtCustomJniObject : QJniObject {};
|
||||
|
||||
template<>
|
||||
|
Loading…
x
Reference in New Issue
Block a user