QmlDesigner: Don't create module import if later version exists

When creating nodes via 3D view context menu, later versions of
imported modules are also accepted rather than just the exact required
version specified in the ItemLibraryEntry. This fixes the issue of
adding duplicate import statements for the same module with different
versions.

Change-Id: Id8437a1817346839488bea7bf89529cc63f4849f
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Miikka Heikkinen
2022-10-24 14:18:48 +03:00
parent 920389a660
commit ccb0349453
@@ -249,7 +249,7 @@ void Edit3DWidget::onCreateAction()
QString::number(entry.majorVersion())
+ QLatin1Char('.')
+ QString::number(entry.minorVersion()));
if (!m_view->model()->hasImport(import))
if (!m_view->model()->hasImport(import, true, true))
m_view->model()->changeImports({import}, {});
int activeScene = m_view->rootModelNode().auxiliaryData("active3dScene@Internal").toInt();