示例#1
0
static QList<JObjectWrapper> convertJavaSequenceToCpp(JNIEnv *env, jobject javaSequence)
{
    jobjectArray array = qtjambi_collection_toArray(env, javaSequence);
    jsize arraySize = env->GetArrayLength(array);

    QList<JObjectWrapper> returned;
    for (int i=0; i<arraySize; ++i) {
        jobject javaElement = env->GetObjectArrayElement(array, i);
        JObjectWrapper wrapper = qtjambi_to_jobjectwrapper(env, javaElement);
        QTJAMBI_EXCEPTION_CHECK(env);
        returned << wrapper;
    }

    return returned;
}
// QDeclarativeListProperty::QtjambiDeclarativeListProperty(QObject * o, QList<QObject > & list)
extern "C" Q_DECL_EXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_org_qtjambi_qt_Declarative_QDeclarativeListProperty__1_1qt_1QDeclarativeListProperty_1QObject_1List__JLjava_util_List_2)
(JNIEnv *__jni_env,
 jobject __jni_object,
 jlong  o0,
 jobject list1)
{
    QTJAMBI_DEBUG_TRACE("(native) entering: QDeclarativeListProperty::QtjambiDeclarativeListProperty(QObject * o, QList<QObject > & list)");
    Q_UNUSED(__jni_env)
    Q_UNUSED(__jni_object)
    QObject*  __qt_o0 = (QObject* ) qtjambi_from_jlong(o0);
    QTJAMBI_EXCEPTION_CHECK(__jni_env);
    QList<QObject*> __qt_list1;
    StaticCache *sc = StaticCache::instance();
    sc->resolveQtJambiObject();
    if (list1 != 0) {
        jobjectArray __qt__array = qtjambi_collection_toArray(__jni_env, list1);
        jsize __qt__size = __jni_env->GetArrayLength(__qt__array);
        for (int i=0; i<__qt__size; ++i) {
            jobject __java_element = __jni_env->GetObjectArrayElement(__qt__array, i);
            __qt_list1 << qtjambi_to_qobject(__jni_env, __java_element);
            QTJAMBI_EXCEPTION_CHECK(__jni_env);
        }
    }
    QTJAMBI_EXCEPTION_CHECK(__jni_env);
    QTJAMBI_EXCEPTION_CHECK(__jni_env);
    QtJambiShell_QDeclarativeListProperty *__qt_this = new QtJambiShell_QDeclarativeListProperty((QObject* )__qt_o0, __qt_list1);
    QtJambiLink *__qt_java_link = qtjambi_construct_object(__jni_env, __jni_object, __qt_this, "QtjambiDeclarativeListProperty");
    if (!__qt_java_link) {
        qWarning("object construction failed for type: QtjambiDeclarativeListProperty");
        return;
    }
    __qt_java_link->setJavaOwnership(__jni_env, __jni_object);
    __qt_this->m_link = __qt_java_link;
    __qt_this->m_link->setCreatedByJava(true);
    __qt_this->m_vtable = qtjambi_setup_vtable(__jni_env,
                        __jni_object,
                        0, 0, 0, // no inconsistent functions
                        qtjambi_method_count,
                        qtjambi_method_names,
                        qtjambi_method_signatures
                        );
    QTJAMBI_DEBUG_TRACE("(native) -> leaving: QDeclarativeListProperty::QtjambiDeclarativeListProperty(QObject * o, QList<jobject > & list)");

}