Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-45916

qmllint fails for Qt Quick imports in JavaScript libraries

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 5.5.1
    • 5.4.1
    • Build tools: Other
    • None
    • Ubuntu 15.04 + Qt 5.4.1
    • 35bb082b2522262261858b685b7ebeb8c79cc189

    Description

      qmllint complains about the following import statement:

      .import QtQuick 2.4 as JSQtQuick with a SyntaxError in line 2 of this library

      .pragma library
      .import QtQuick 2.4 as JSQtQuick
      
      function createComponentOrThrow(url) {
          var component = Qt.createComponent(url);
      
          if(component.status !== JSQtQuick.Component.Ready)
          {
              if(component.status === JSQtQuick.Component.Error)
              {
                  var errorString1 = "Error: " + component.errorString()
                  console.error(errorString1);
                  throw errorString1
              }
              else
              {
                  var errorString2 = "Component not ready but not in Component.Error status"
                  console.error(errorString2)
                  throw errorString2
              }
          }
          return component
      }
      

      Attachments

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

        Activity

          People

            iamsergio Sergio Martins
            webmaster128 Simon Warta
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes