qtdeclarative/tests/auto/qml/qqmlcomponent
Fabian Kosmale 59bdfc6c52 QQmlComponent::loadFromModule: Improve error handling
Most importantly, fix the (attempted) loading of a non-existent inline
component: As soon as we have the compilation unit, we can simply check
whether the inline component exists via its name.
This avoids an assert down the line in beginCreate which assumes that at
this point the inlineComponentName has been properly vetted.
This also allows us to create a better error message, and to catch the
easy mistake of passing a file name instead of a type name to
createComponent.

Moreover, ensure that we do not claim that the inline component is ready
when only the outer component has been loaded – a direct connection to
the changed signals followed by a call to create would otherwise yield
surprising results.

Fixes: QTBUG-124225
Pick-to: 6.7
Change-Id: I6b1860f594a3060653e732b9570cc3bbff0c34a9
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-04-17 01:00:15 +02:00
..
data Defer automatic Window transient parent until component completion 2023-10-18 17:42:10 +02:00
plainqml loadFromModule: Properly handle QML only modules 2023-02-02 16:55:03 +00:00
CMakeLists.txt Make loadFromModule compatible with QQmlParserStatus 2024-03-14 11:41:59 +01:00
lifecyclewatcher.h Correct license for test files 2024-03-22 08:04:52 +01:00
tst_qqmlcomponent.cpp QQmlComponent::loadFromModule: Improve error handling 2024-04-17 01:00:15 +02:00