On quinta-feira, 8 de novembro de 2012 09.57.05, Alan Alpert wrote: > qmlRegisterType(const char* url, const char *uri, int versionMajor, > int versionMinor, const char *qmlName). [...]
> This would allow for a platform component import which looks like this:
> if(platform=="desktoplinux")
> qmlRegisterType("/usr/share/desktop/components/Button.qml", uri,
> 2, 0, "Button");
> else if (platform=="meego")
> qmlRegisterType("/usr/share/meego/components/Button.qml", uri, 2,
> 0, "Button");
Please be careful with your uses of URL. You named the parameter "url" but
then you passed what looks like a path name. It's definitely not an absolute
URL, but it could be a relative one.
If the API accepts a relative URL, you need to define what it's relative to.
For example, it's relative to the $PWD at the time of the invocation of the
function. Or, another suggestion, is that it's relative to $PWD at the moment
of use.
My recommendation is that you do not allow relative URLs. Require them to be
absolute, in which case you'll need the "file:///" prefix.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
