[Qt-qml] QMLviewer silently fails to import plugin when shared library not found

Tico Ballagas ballagas at gmail.com
Thu Sep 30 21:13:12 CEST 2010


I was having issues debugging an import problem for a custom QDeclarativeExtensionPlugin.

The ultimate problem was that I forgot to install a required shared library used by my plugin.  However, qmlviewer reported the problem as follows:

# QML_IMPORT_TRACE=1 qmlviewer gesture.qml 
QDeclarativeImportDatabase::addImportPath "/usr/lib/qt4/imports" 
QDeclarativeImportDatabase::addImportPath "/usr/bin" 
QDeclarativeImportDatabase::addToImport 0x24d37c "." -1.-1 File as ""
QDeclarativeImportDatabase::add: loaded "/home/user/gestureEngineTest/qmldir" 
QDeclarativeImportDatabase::importPlugin ".home.user.gestureEngineTest" from "/home/user/gestureEngineTest/lib/libgestureengine.so" 
QDeclarativeImportDatabase::addToImport 0x24d37c "Qt" 4.7 Library as ""
file:///home/user/gestureEngineTest/gesture.qml:3:1: GestureEngine is not a type 
     GestureEngine { 

where GestureEngine is defined in libgestureengine.so, but it doesn't convey that the plugin import failed.  In fact, the trace leads you believe the plugin was successfully loaded.

It would be nice if qmlviewer displayed an error like the following:
error while loading shared libraries: libqt_gesture_lib.so.1: cannot open shared object file: No such file or directory







More information about the Qt-qml mailing list