5package org.qtproject.qt.android.bindings;
7import android.app.Application;
9import java.lang.reflect.Field;
10import java.lang.reflect.Method;
11import java.util.ArrayList;
12import java.util.HashMap;
16 public final static String
QtTAG =
"Qt";
18 public static HashMap<String, ArrayList<Method>>
m_delegateMethods=
new HashMap<String, ArrayList<Method>>();
36 private static String activityClassName;
40 activityClassName = clazz.getCanonicalName();
42 ArrayList<Method> delegateMethods =
new ArrayList<Method>();
43 for (Method
m : listener.getClass().getMethods()) {
44 if (
m.getDeclaringClass().getName().startsWith(
"org.qtproject.qt.android"))
45 delegateMethods.add(
m);
48 ArrayList<Field> applicationFields =
new ArrayList<Field>();
50 if (
f.getDeclaringClass().getName().equals(
QtApplication.class.getName()))
51 applicationFields.add(
f);
54 for (Method delegateMethod : delegateMethods) {
56 clazz.getDeclaredMethod(delegateMethod.getName(), delegateMethod.getParameterTypes());
60 ArrayList<Method> delegateSet =
new ArrayList<Method>();
61 delegateSet.add(delegateMethod);
64 for (Field applicationField:applicationFields) {
65 if (applicationField.getName().equals(delegateMethod.getName())) {
67 applicationField.set(
null, delegateMethod);
68 }
catch (Exception
e) {
73 }
catch (Exception
e) { }
90 private static int stackDeep=-1;
96 StackTraceElement[]
elements = Thread.currentThread().getStackTrace();
97 if (-1 == stackDeep) {
99 if (
elements[
it].getClassName().equals(activityClassName)) {
114 result.invoked =
true;
125 }
catch (Exception
e) {
qsizetype length() const noexcept
static HashMap< String, ArrayList< Method > > m_delegateMethods
static Method dispatchKeyShortcutEvent
static Method onGenericMotionEvent
static final String QtTAG
static Method dispatchTouchEvent
static Method onTrackballEvent
static void setQtContextDelegate(Class<?> clazz, Object listener)
static Method dispatchGenericMotionEvent
static Method onKeyLongPress
static Object m_delegateObject
static Method onKeyMultiple
static Method dispatchTrackballEvent
static Method onTouchEvent
static Method onActivityResult
static Method onRequestPermissionsResult
static Method dispatchKeyEvent
static InvokeResult invokeDelegate(Object... args)
static Method dispatchPopulateAccessibilityEvent
static Object invokeDelegateMethod(Method m, Object... args)
static Method onKeyShortcut
QSet< QString >::iterator it
static QString methodName(const QDBusIntrospection::Method &method)
static void add(QPainterPath &path, const QWingedEdge &list, int edge, QPathEdge::Traversal traversal)
static const QTextHtmlElement elements[Html_NumElements]