我想從Qt 5.1.0 android安裝中導入TimeExample Qt Quick Extension Plugin。如何將qt5 qml插件部署到android?
libqmlqtimeexampleplugin.so
被成功地建立在build-plugins-Android_for_arm_GCC_4_6_Qt_5_1_0-Debug/imports
然後創建從Qt Creator的Qt的簡單應用Quick2(內置元件)。我應該添加到應用程序項目文件中以在輸出「.apk」包中獲取QML插件?
現在它說:
W/QT(23528):資產:/qml/TimeExampleTest/main.qml:2():資產:/qml/TimeExampleTest/main.qml:2:1 :模塊 「TimeExample」 未安裝
main.qml
import QtQuick 2.0
import TimeExample 1.0 // import types from the plugin
Rectangle {
width: 360
height: 360
Text {
text: qsTr("Hello World")
anchors.centerIn: parent
}
MouseArea {
anchors.fill: parent
onClicked: {
Qt.quit();
}
}
Clock { // this class is defined in QML (imports/TimeExample/Clock.qml)
Time { // this class is defined in C++ (plugin.cpp)
id: time
}
hours: time.hour
minutes: time.minute
}
}
TimeExampleTest.pro
folder_01.source = qml/TimeExampleTest
folder_01.target = qml
folder_02.source = /home/artem/Projects/Veedo/Test/build-plugins-Android_for_arm_GCC_4_6_Qt_5_1_0-Debug/imports/TimeExample
folder_02.target = imports
DEPLOYMENTFOLDERS = folder_01 folder_02
QML_IMPORT_PATH = /home/artem/Projects/Veedo/Test/build-plugins-Android_for_arm_GCC_4_6_Qt_5_1_0-Debug/imports/TimeExample
SOURCES += main.cpp
include(qtquick2applicationviewer/qtquick2applicationviewer.pri)
qtcAddDeployment()
OTHER_FILES += \
android/src/org/kde/necessitas/ministro/IMinistro.aidl \
android/src/org/kde/necessitas/ministro/IMinistroCallback.aidl \
android/src/org/qtproject/qt5/android/bindings/QtActivity.java \
android/src/org/qtproject/qt5/android/bindings/QtApplication.java \
android/AndroidManifest.xml \
android/version.xml \
android/res/values-ja/strings.xml \
android/res/values-rs/strings.xml \
android/res/values-zh-rTW/strings.xml \
android/res/values-fa/strings.xml \
android/res/values-ru/strings.xml \
android/res/values-fr/strings.xml \
android/res/values-ro/strings.xml \
android/res/values-el/strings.xml \
android/res/values-ms/strings.xml \
android/res/values-nb/strings.xml \
android/res/values-et/strings.xml \
android/res/values-pl/strings.xml \
android/res/values-pt-rBR/strings.xml \
android/res/values-es/strings.xml \
android/res/values-id/strings.xml \
android/res/values-de/strings.xml \
android/res/values-it/strings.xml \
android/res/values-zh-rCN/strings.xml \
android/res/values/strings.xml \
android/res/values/libs.xml \
android/res/layout/splash.xml \
android/res/values-nl/strings.xml
有趣的,但iirc有一個更直接的方法,我可以挖掘/嘗試一些代碼,如果你有興趣。 – mlvljr
我感興趣@mlvljr! – user981733
@ user981733好的,讓我看看在接下來的幾天,然後:) – mlvljr