Hello,
I have made a very simple QML plugin following the chapter 6 tutorial which compiles fine, but I am not able to use it in my Symbian application.
Here is my folder structure:
\myApp
myApp.pro
\qml
main.qml
myPlugin
myPlugin.pro
myPlugin.cpp
myPlugin.h
\myApp
myApp.pro
\qml
main.qml
myPlugin
myPlugin.pro
myPlugin.cpp
myPlugin.h
To copy to clipboard, switch view to plain text mode
After plugin compilation for device and simulator using QtCreator I have :
\myApp
myApp.pro
\qml
main.qml
\myPlugin
myPlugin.pro
myPlugin.cpp
myPlugin.h
\myPlugin-build-simulator
qmldir
\debug
libmyPlugin.a
myPlugin.dll
\release
libmyPlugin.a
myPlugin.dll
\myPlugin-build-symbian
qmldir
\debug
libmyPlugin.a
myPlugin.dll
\release
libmyPlugin.a
myPlugin.dll
\myApp
myApp.pro
\qml
main.qml
\myPlugin
myPlugin.pro
myPlugin.cpp
myPlugin.h
\myPlugin-build-simulator
qmldir
\debug
libmyPlugin.a
myPlugin.dll
\release
libmyPlugin.a
myPlugin.dll
\myPlugin-build-symbian
qmldir
\debug
libmyPlugin.a
myPlugin.dll
\release
libmyPlugin.a
myPlugin.dll
To copy to clipboard, switch view to plain text mode
main.qml
import myPlugin 1.0
//...
import myPlugin 1.0
//...
To copy to clipboard, switch view to plain text mode
qmldir
plugin myPlugin
plugin myPlugin
To copy to clipboard, switch view to plain text mode
myPlugin.pro (generated by QtCreator, left untouched)
TEMPLATE = lib
TARGET = myPlugin
QT += declarative
CONFIG += qt plugin
TARGET = $$qtLibraryTarget($$TARGET)
uri = myPlugin
# Input
SOURCES += \
myPlugin_plugin.cpp \
myPlugin.cpp
HEADERS += \
myPlugin.h \
myPlugin_plugin.h
OTHER_FILES = qmldir
!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
copy_qmldir.target = $$OUT_PWD/qmldir
copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir
copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\"
QMAKE_EXTRA_TARGETS += copy_qmldir
PRE_TARGETDEPS += $$copy_qmldir.target
}
qmldir.files = qmldir
symbian {
TARGET.EPOCALLOWDLLDATA = 1
} else:unix {
maemo5 | !isEmpty(MEEGO_VERSION_MAJOR) {
installPath = /usr/lib/qt4/imports/$$replace(uri, \\., /)
} else {
installPath = $$[QT_INSTALL_IMPORTS]/$$replace(uri, \\., /)
}
qmldir.path = $$installPath
target.path = $$installPath
INSTALLS += target qmldir
}
TEMPLATE = lib
TARGET = myPlugin
QT += declarative
CONFIG += qt plugin
TARGET = $$qtLibraryTarget($$TARGET)
uri = myPlugin
# Input
SOURCES += \
myPlugin_plugin.cpp \
myPlugin.cpp
HEADERS += \
myPlugin.h \
myPlugin_plugin.h
OTHER_FILES = qmldir
!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
copy_qmldir.target = $$OUT_PWD/qmldir
copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir
copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\"
QMAKE_EXTRA_TARGETS += copy_qmldir
PRE_TARGETDEPS += $$copy_qmldir.target
}
qmldir.files = qmldir
symbian {
TARGET.EPOCALLOWDLLDATA = 1
} else:unix {
maemo5 | !isEmpty(MEEGO_VERSION_MAJOR) {
installPath = /usr/lib/qt4/imports/$$replace(uri, \\., /)
} else {
installPath = $$[QT_INSTALL_IMPORTS]/$$replace(uri, \\., /)
}
qmldir.path = $$installPath
target.path = $$installPath
INSTALLS += target qmldir
}
To copy to clipboard, switch view to plain text mode
The code for the plugin is similar to the tutorial : http://doc.qt.nokia.com/4.7-snapshot...6-plugins.html
I got the error "myPlugin module not installed"
How can I install the plugin to my app ?
Thanks
Bookmarks