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



-- 
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

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-qml

Reply via email to