Uploaded image for project: 'Qt Visual Studio Tools'
  1. Qt Visual Studio Tools
  2. QTVSADDINBUG-1286

import.qml causes syntax errors

    XMLWordPrintable

Details

    • Windows

    Description

      In case there are QMLs that assigned IDs starting with a word "import", VS Tools adds the code lines related to the IDs to import.qml file (as module names?). That causes Syntax errors in some environments, as follows :

      main.qml

       

      import QtQuick 2.9
      import QtQuick.Window 2.2
      import QtQuick.Controls
      import QtQuick.Dialogs
      
      Window {
      visible: true
      width: 640
      height: 480
      
      Component.onCompleted: {
      importDialog.open() //★
      }
      
      FileDialog {
      id: importDialog
      }
      }
      example: main.qml

      import.qml

      import QtQuick 2.9
      import QtQuick.Window 2.2
      import QtQuick.Controls
      import QtQuick.Dialogs
      importDialog.open() //★
      QmlObject { }
      

       

      error message

      D:/solution/Project/Release/qt/qmake/import.qml(52,36): error GA404624D: Syntax error
      importDialog.open() 
      

       

      This issue was reported by a commercial user using VS2022 version 17.6.21 + Qt 6.8.1 + Qt VS Tools 3.3.1.1. This issue is affecting their project because they had to put a lot of time and effort in checking/analysing the issue.

      The reproducer and its MSBuild binary log are attached.

      Please note, the syntax error message will not be observed in this VS solution, while the unwanted code lines in import.qml are observed there.

      The solution where the syntax error was observed cannot be shared since it is including confidential information.

      Attachments

        1. msbuild.binlog
          434 kB
        2. bugReport.zip
          7.28 MB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            mecfc Miguel Costa
            hitoshiito Hitoshi Ito
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes