Ah, yes that's normal, the path should be the top-level imports folder, ie. :
engine.addImportPath("C:/Qt/4.7.0-beta1/imports");
and
engine.addPluginPath("C:/Qt/4.7.0-beta1/imports");
(the QML engine builds the full path from the "Qt.multimedia" name of the
plugin, similar to how java resolves imports)
> Looking at preexisting paths reveals:
> importPathList contains one item
> "C:/iwmake/build_mingw_opensource/imports"
> and pluginPathList also one item :
> "."
Yes that explains it, the default import path is wrong. I assume you built Qt
out-of-source, or that it's a pre-built
package.
I've seen similar behaviors with out-of-source builds and I think it's an
install/deployment bug, or rather something
they haven't figured yet. (ie. the import path should be the one from the
installation folder, not from the source
folder).
On Wednesday 16 June 2010 15:16:50 Cristian Daniel Stamateanu wrote:
> 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
> >> [email protected]
> >> http://lists.trolltech.com/mailman/listinfo/qt-qml
>
> _______________________________________________
> Qt-qml mailing list
> [email protected]
> http://lists.trolltech.com/mailman/listinfo/qt-qml
--
Romain Pokrzywka | [email protected] | Certified Qt Software Engineer & Trainer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - Qt Experts - Platform-independent software solutions
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Qt-qml mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-qml
