Description
Summary of the issue
The autogenerated code from [Create Compoenent] have wrong version number as like below when the base QML file doesn't have version number in import statements.
ort QtQuick -1.-1
Reproducible steps
1. Create a base QML file which doesn't have version number in import statements. Following is the example
import QtQuick import QtQuick.Controls Rectangle{ id: parent_base Rectangle { id: rectangle_want_to_make_as_component x: 100 y: 100 width: 300 height: 100 color: "yellow" Text { x: 10 y: 10 text: "Hello Custom Component" } } }
2. Select the element you want to make it as a component. In the example above, select "rectangle_want_to_make_as_component".
4. Press Create Compoenent button on top right or select Create Component menu from context menu.
Expected result:
New component is created without any error
Actual result
import statement in the created QML have following statement and the compoenent is not loaded properly because of this:
import QtQuick -1.-1
Workaround
- If the original QML file have version number to QtQuick module, this problem doesn't occur. Following is the example
import QtQuick 6.5
- Even error appear in newly created QML, it works afer fixing the version number part of the import statement.