[Development] QML import versions
Attila Csipa
qt at csipa.in.rs
Fri Sep 25 12:58:05 CEST 2015
On 9/24/2015 5:49 PM, Alan Alpert wrote:
> The point of versioning isn't to prevent different runtime outcomes,
> that's not possible as you have showed. But there's an implicit
> compile step when you run a QML file at program startup, and the
> versioning system prevents that from failing. Getting different values
> is a problem, yes. But those lines still ran, and you could
> theoretically use runtime error handling code. If there suddenly
> appears a type conflict in a QML file, the compilation stage *fails*
> and the QML code never reaches its own "runtime" to experience the
> different outcomes (we are in the runtime of the C++ application, but
> bailed on compilation of the QML files).
This feels somewhat self-imposed, though. Loader {} and
Qt.createComponent shows that, at least in theory, you can handle
compile-stage fails from within QML. There is no fine-grained-enough
mechanism to make real use of it (at best, you can use it as a crude way
of detecting Qt versions/modules), but that is exactly what prevents us
from feature-based QML code-path selection. I do wish we had a bit more
graceful way of (handling) failing in QML.
Best regards,
Attila
More information about the Development
mailing list