Well I tried both engine.addImportPath("C:/Qt/4.7.0-beta1/imports/Qt/multimedia"); and engine.addPluginPath("C:/Qt/4.7.0-beta1/imports/Qt/multimedia"); and they do not change a thing. I still have to add the plugin by hand.
Looking at preexisting paths reveals: importPathList contains one item "C:/iwmake/build_mingw_opensource/imports" and pluginPathList also one item : "." Regards, Cristi Romain Pokrzywka wrote: > You can also try with > QDeclarativeEngine::addImportPath()/addPluginPath(), although QTDIR/imports > should be set by > default. Did you check what paths are returned by > QDeclarativeEngine::importPathList() and pluginPathList() ? > It seems like you're running your app locally on the desktop, but I know I've > had trouble when deploying on WinCE > because the standard paths weren't set correctly by qt during configuration, > so it's worth checking the output from > configure.exe too. > > Btw, thanks for the tip about QUrl::fromLocalFile(":/bla"), I was wondering > how I could get my qml files stored into > resources, and for some reason I didn't think fromLocalFile would work :) > I'm not sure it works inside the qml files directly though, ie. : Image { > source: ":/someimage.png" } > > Cheers > Romain > > On Wednesday 16 June 2010 09:58:13 Cristian Daniel Stamateanu wrote: >> Ok, got one step further, I added to my cpp code the following: >> >> ... >> QDeclarativeEngine engine; >> engine.importPlugin("C:/Qt/4.7.0-beta1/imports/Qt/multimedia/multimediad.dl >> l","Qt.multimedia"); ... >> ui->declarativeView->setSource(QUrl::fromLocalFile(":/qml/main.qml")); >> >> and now it seems to work, but it seems to me this is just a hack. There >> should be a nicer way without full paths and imports in my code. >> >> Regards, >> Cristi >> >> _______________________________________________ >> Qt-qml mailing list >> Qt-qml@trolltech.com >> http://lists.trolltech.com/mailman/listinfo/qt-qml > > > _______________________________________________ Qt-qml mailing list Qt-qml@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-qml