fixed compilation of QZXingLive for platforms other than Android

This commit is contained in:
favoritas37 2017-03-16 16:26:48 +02:00
parent a69cd45ac6
commit f581e879de
3 changed files with 12 additions and 9 deletions

1
.gitignore vendored
View File

@ -25,3 +25,4 @@ debug/
.gradle
.idea
.build
.obj

View File

@ -12,10 +12,12 @@ CONFIG(debug, debug|release) {
}
HEADERS += \
application.h
application.h \
native.h
SOURCES += main.cpp \
application.cpp
application.cpp \
native.cpp
RESOURCES += qml.qrc
@ -30,12 +32,6 @@ include(deployment.pri)
android {
QT += androidextras
HEADERS += \
native.h
SOURCES += \
native.cpp
DISTFILES += \
android/AndroidManifest.xml \
android/gradle/wrapper/gradle-wrapper.jar \

View File

@ -1,9 +1,13 @@
#if defined(Q_OS_ANDROID)
#include <jni.h>
#endif //Q_OS_ANDROID
#include "native.h"
#include <QMetaObject>
QObject *NativeHelpers::application_p_ = 0;
#if defined(Q_OS_ANDROID)
// define our native static functions
// these are the functions that Java part will call directly from Android UI thread
static void onPermissionsGranted(JNIEnv * /*env*/, jobject /*obj*/)
@ -45,3 +49,5 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* /*reserved*/)
return JNI_VERSION_1_6;
}
#endif // Q_OS_ANDROID