Generalize runtime asset importer selection in QSSGAssetImportManager


The runtime scene import path, importFile(QUrl, Scene &), hardcoded the
plugin named "assimp" instead of selecting an importer by file extension
like the offline path already does. Use the same extension map here,
resolving local file and qrc URLs via QQmlFile and taking the extension
from the URL path so that a query string or fragment cannot be mistaken
for it. Since multiple plugins may claim the same extension, add a
virtual priority() to QSSGAssetImporter that decides which one wins,
keeping the first registered on a tie; this prepares for a native glTF
importer taking over the gltf and glb extensions with assimp remaining
available as a fallback.

Note that this narrows what the runtime path accepts. Assimp used to
sniff the format from the file contents, so anything its ReadFile()
recognized would load, whereas selection now goes through
AssimpImporter::inputExtensions(). That agrees with what RuntimeLoader
documents and with what QQuick3DRuntimeLoader::supportedExtensions()
already filtered to, but formats Qt never documented, such as 3ds,
blend, x and md5mesh, are now reported as Unsupported. Testing the new
path also turned up that QSSGSceneDesc::Scene::cleanup() dereferences a
null root, which is the state a rejected import leaves behind, so guard
it.

Task-number: QTBUG-148576
Change-Id: I631dfdaf064de2eb7a4a8c59b7d9e4f53e10096b
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
commit37506e448c250f830b6ac9c2c5e49467fabea7a2
parente6e3434c5e9a13bf81538335ad3250087e54d18d
authorAndy Nichols <andy.nichols@qt.io>
committerAndy Nichols <andy.nichols@qt.io>
commit timeFri, 28 Aug 2026 09:03:20 +0000