Hi,

I am working on a project where we want to use QQmlFileFilter to load
different UIs for different products. It almost works as I want it to, but
I have one issue. Take the two files:

MyText.qml
+new/MyText.qml

As long as I re-implement MyText.qml in +new/MyText.qml everything just
works. What I would like to do instead is to implement the functionality I
want in MyText.qml and then only keep the "delta" in +new/MyText.qml, for
example like this:

import "../" as Base

Base.MyText {
    text: "+new text"
}

This does not work, Base.MyText will refer to +new/MyText.qml instead of
just MyText.qml.

One solution is to have a separate "Base" qml file that both the original
MyText.qml and +new/MyText.qml inherit , but I would like to avoid that if
possible.

Another solution is to put the "base" qml file in a +base folder, then I
can refer to the base version by doing import "+base" as Base. However,
because the QFileSelector wants the file without selectors to exist as well
(even if it is not used), I have to create an empty dummy file.

I have added my attempts to the repository
https://github.com/jesperhh/QmlFileSelectorTest if anyone wants to try them
out.

Thanks in advance!
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to