diff options
author | Petri Virkkunen <[email protected]> | 2025-05-22 15:10:52 +0300 |
---|---|---|
committer | Petri Virkkunen <[email protected]> | 2025-06-12 13:37:19 +0000 |
commit | 76bf2512e72d0620cdeecf183120a3546d850438 (patch) | |
tree | d802f8e7d837f1890c0ad9c4b9655673d89b078c | |
parent | 43e52253d59c606ceca00a999b28eaf96365bc5c (diff) |
Android: Add default template argument return type to AndroidBackendRegister
For AndroidBackendRegister::callInterface, it would be more convenient
to call simple functions without parameters, without being forced to
specify the void return type. Added a default void type argument for
the return type.
Change-Id: Ib7f631c172955cdf0b2e853155fd57c06bef9843
Reviewed-by: Assam Boudjelthia <[email protected]>
4 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/platforms/android/androidbackendregister.h b/src/plugins/platforms/android/androidbackendregister.h index 9c1975beecf..807e7e13194 100644 --- a/src/plugins/platforms/android/androidbackendregister.h +++ b/src/plugins/platforms/android/androidbackendregister.h @@ -105,7 +105,7 @@ public: If the interface is not registered, a warning is printed and an empty object is returned. */ - template <typename Interface, typename Ret, typename... Args, + template <typename Interface, typename Ret = void, typename... Args, ValidInterfaceType<Interface> = true> auto callInterface(const char *func, Args... args) { diff --git a/src/plugins/platforms/android/androidjniinput.cpp b/src/plugins/platforms/android/androidjniinput.cpp index 00e4b969f18..6d463e5f267 100644 --- a/src/plugins/platforms/android/androidjniinput.cpp +++ b/src/plugins/platforms/android/androidjniinput.cpp @@ -58,14 +58,14 @@ namespace QtAndroidInput void resetSoftwareKeyboard() { AndroidBackendRegister *reg = QtAndroid::backendRegister(); - reg->callInterface<QtJniTypes::QtInputInterface, void>("resetSoftwareKeyboard"); + reg->callInterface<QtJniTypes::QtInputInterface>("resetSoftwareKeyboard"); qCDebug(lcQpaInputMethods) << "@@@ RESETSOFTWAREKEYBOARD"; } void hideSoftwareKeyboard() { AndroidBackendRegister *reg = QtAndroid::backendRegister(); - reg->callInterface<QtJniTypes::QtInputInterface, void>("hideSoftwareKeyboard"); + reg->callInterface<QtJniTypes::QtInputInterface>("hideSoftwareKeyboard"); qCDebug(lcQpaInputMethods) << "@@@ HIDESOFTWAREKEYBOARD"; } diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp index bb8e6838220..db3798dc66d 100644 --- a/src/plugins/platforms/android/androidjnimain.cpp +++ b/src/plugins/platforms/android/androidjnimain.cpp @@ -183,7 +183,7 @@ namespace QtAndroid #if QT_CONFIG(accessibility) void initializeAccessibility() { - m_backendRegister->callInterface<QtJniTypes::QtAccessibilityInterface, void>( + m_backendRegister->callInterface<QtJniTypes::QtAccessibilityInterface>( "initializeAccessibility"); } diff --git a/src/plugins/platforms/android/androidjnimenu.cpp b/src/plugins/platforms/android/androidjnimenu.cpp index f6bf2718703..14a203c93dd 100644 --- a/src/plugins/platforms/android/androidjnimenu.cpp +++ b/src/plugins/platforms/android/androidjnimenu.cpp @@ -48,13 +48,13 @@ namespace QtAndroidMenu void resetMenuBar() { AndroidBackendRegister *reg = QtAndroid::backendRegister(); - reg->callInterface<QtJniTypes::QtMenuInterface, void>("resetOptionsMenu"); + reg->callInterface<QtJniTypes::QtMenuInterface>("resetOptionsMenu"); } void openOptionsMenu() { AndroidBackendRegister *reg = QtAndroid::backendRegister(); - reg->callInterface<QtJniTypes::QtMenuInterface, void>("openOptionsMenu"); + reg->callInterface<QtJniTypes::QtMenuInterface>("openOptionsMenu"); } void showContextMenu(QAndroidPlatformMenu *menu, const QRect &anchorRect) @@ -75,7 +75,7 @@ namespace QtAndroidMenu QMutexLocker lock(&visibleMenuMutex); if (visibleMenu == menu) { AndroidBackendRegister *reg = QtAndroid::backendRegister(); - reg->callInterface<QtJniTypes::QtMenuInterface, void>("closeContextMenu"); + reg->callInterface<QtJniTypes::QtMenuInterface>("closeContextMenu"); pendingContextMenus.clear(); } else { pendingContextMenus.removeOne(menu); |