Android: Warn user if backend register does not have requested interface
Just in case, warn user if they are trying to use callInterface on an interface that does not exist (probably has not been registered) Pick-to: 6.8 Change-Id: I1a4b2226cfecd139e36ab6386ea2fe868bd73f3f Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
This commit is contained in:
parent
959eaa88f2
commit
6643e97a89
@ -43,8 +43,12 @@ public:
|
||||
ValidInterfaceType<Interface> = true>
|
||||
auto callInterface(const char *func, Args... args)
|
||||
{
|
||||
if (const auto obj = getInterface<Interface>(); obj.isValid())
|
||||
if (const auto obj = getInterface<Interface>(); obj.isValid()) {
|
||||
return obj.template callMethod<Ret, Args...>(func, std::forward<Args>(args)...);
|
||||
} else {
|
||||
qWarning() << "No interface with className"
|
||||
<< QtJniTypes::Traits<Interface>::className() << "has been registered.";
|
||||
}
|
||||
|
||||
if constexpr (IsObjectType<Ret>::value)
|
||||
return Ret(QJniObject());
|
||||
|
Loading…
x
Reference in New Issue
Block a user