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 <assam.boudjelthia@qt.io>
This commit is contained in:
parent
43e52253d5
commit
76bf2512e7
@ -105,7 +105,7 @@ public:
|
|||||||
|
|
||||||
If the interface is not registered, a warning is printed and an empty object is returned.
|
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>
|
ValidInterfaceType<Interface> = true>
|
||||||
auto callInterface(const char *func, Args... args)
|
auto callInterface(const char *func, Args... args)
|
||||||
{
|
{
|
||||||
|
@ -58,14 +58,14 @@ namespace QtAndroidInput
|
|||||||
void resetSoftwareKeyboard()
|
void resetSoftwareKeyboard()
|
||||||
{
|
{
|
||||||
AndroidBackendRegister *reg = QtAndroid::backendRegister();
|
AndroidBackendRegister *reg = QtAndroid::backendRegister();
|
||||||
reg->callInterface<QtJniTypes::QtInputInterface, void>("resetSoftwareKeyboard");
|
reg->callInterface<QtJniTypes::QtInputInterface>("resetSoftwareKeyboard");
|
||||||
qCDebug(lcQpaInputMethods) << "@@@ RESETSOFTWAREKEYBOARD";
|
qCDebug(lcQpaInputMethods) << "@@@ RESETSOFTWAREKEYBOARD";
|
||||||
}
|
}
|
||||||
|
|
||||||
void hideSoftwareKeyboard()
|
void hideSoftwareKeyboard()
|
||||||
{
|
{
|
||||||
AndroidBackendRegister *reg = QtAndroid::backendRegister();
|
AndroidBackendRegister *reg = QtAndroid::backendRegister();
|
||||||
reg->callInterface<QtJniTypes::QtInputInterface, void>("hideSoftwareKeyboard");
|
reg->callInterface<QtJniTypes::QtInputInterface>("hideSoftwareKeyboard");
|
||||||
qCDebug(lcQpaInputMethods) << "@@@ HIDESOFTWAREKEYBOARD";
|
qCDebug(lcQpaInputMethods) << "@@@ HIDESOFTWAREKEYBOARD";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ namespace QtAndroid
|
|||||||
#if QT_CONFIG(accessibility)
|
#if QT_CONFIG(accessibility)
|
||||||
void initializeAccessibility()
|
void initializeAccessibility()
|
||||||
{
|
{
|
||||||
m_backendRegister->callInterface<QtJniTypes::QtAccessibilityInterface, void>(
|
m_backendRegister->callInterface<QtJniTypes::QtAccessibilityInterface>(
|
||||||
"initializeAccessibility");
|
"initializeAccessibility");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,13 +48,13 @@ namespace QtAndroidMenu
|
|||||||
void resetMenuBar()
|
void resetMenuBar()
|
||||||
{
|
{
|
||||||
AndroidBackendRegister *reg = QtAndroid::backendRegister();
|
AndroidBackendRegister *reg = QtAndroid::backendRegister();
|
||||||
reg->callInterface<QtJniTypes::QtMenuInterface, void>("resetOptionsMenu");
|
reg->callInterface<QtJniTypes::QtMenuInterface>("resetOptionsMenu");
|
||||||
}
|
}
|
||||||
|
|
||||||
void openOptionsMenu()
|
void openOptionsMenu()
|
||||||
{
|
{
|
||||||
AndroidBackendRegister *reg = QtAndroid::backendRegister();
|
AndroidBackendRegister *reg = QtAndroid::backendRegister();
|
||||||
reg->callInterface<QtJniTypes::QtMenuInterface, void>("openOptionsMenu");
|
reg->callInterface<QtJniTypes::QtMenuInterface>("openOptionsMenu");
|
||||||
}
|
}
|
||||||
|
|
||||||
void showContextMenu(QAndroidPlatformMenu *menu, const QRect &anchorRect)
|
void showContextMenu(QAndroidPlatformMenu *menu, const QRect &anchorRect)
|
||||||
@ -75,7 +75,7 @@ namespace QtAndroidMenu
|
|||||||
QMutexLocker lock(&visibleMenuMutex);
|
QMutexLocker lock(&visibleMenuMutex);
|
||||||
if (visibleMenu == menu) {
|
if (visibleMenu == menu) {
|
||||||
AndroidBackendRegister *reg = QtAndroid::backendRegister();
|
AndroidBackendRegister *reg = QtAndroid::backendRegister();
|
||||||
reg->callInterface<QtJniTypes::QtMenuInterface, void>("closeContextMenu");
|
reg->callInterface<QtJniTypes::QtMenuInterface>("closeContextMenu");
|
||||||
pendingContextMenus.clear();
|
pendingContextMenus.clear();
|
||||||
} else {
|
} else {
|
||||||
pendingContextMenus.removeOne(menu);
|
pendingContextMenus.removeOne(menu);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user