Uploaded image for project: 'Qt Design Studio'
  1. Qt Design Studio
  2. QDS-11533

Create component fails if the base QML file doesn't have version number in import statements

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • QDS 4.3.2
    • QDS 4.3.1
    • Wizards
    • None
    • All

    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.

       

       

       

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tjenssen Tim Jenssen
            takujikawata Takuji Kawata
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes