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) Change-Id: I1a4b2226cfecd139e36ab6386ea2fe868bd73f3f Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io> (cherry picked from commit 6643e97a89f06f0c32c3dff8b2c343eaa76c0e85) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
bb3f1cc62a
commit
45f361e97e
@ -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