[Development] Platform Content Selection

Alan Alpert 416365416c at gmail.com
Wed Jan 9 17:25:33 CET 2013


On Wed, Jan 9, 2013 at 6:39 AM, Mohamed Fawzi <Fawzi.Mohamed at digia.com> wrote:
> In general I think that at least for development using several directories with sensible fallbacks is the way to go:
>
> One wants to have the possibility of overriding just some files on a platform, while still having other files coming from a default location.
>
> Alan's solution looks very comprehensive, but maybe a little too much, I would like to have something simpler.
>
> import paths can achieve basically what we want, so for example high_res/bla.qml will override bla.qml if the path is something like "high_res:." .
> This should work also for .js file lookup.
> I.e. I would only support top level directories that are sequentially checked, and if one wants to override bla/bla/b.qml on android he should create android/bla/bla/b.qml

There is no 'top-level' directories concept in QML. To do that on top
level directories would require the feature to be done by the
application or the platform/package. Which decreases the value of QML
as an interpreted language.

>
> Imho path based selection with well known platform dependent search paths is the correct way to handle several platforms, sometime even different devices.
>
> Thus better configurability of import paths (or resource lookups in general, possibly with a way to set them up at runtime), would be very welcome.
>
> the .qrc only approach looks a bit too verbose to me, but something like that might well be created implicitly.
>
>
> This approach does have some drawbacks:
> * it can make simple qmldir usage not feasible unless "precompiled" for that platform (for example with a .qrc), because you don't know which file to pick without knowing the platoform
> * in general duplicating files makes tooling more complex, as one wants to easily see if some change breaks other platforms, or something is missing, and in general it breaks some assumptions of the current code model.

These issues are mostly resolved if it's solved at the language level.
Any such feature would work with qmldir files and the file selection
would be easily accessible via tooling. It doesn't solve the generic
platform selection problem for tooling (platform selected content
might require platform specific libraries), but it would be trivial to
hook into a simulator.

--
Alan Alpert



More information about the Development mailing list