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

javascript context scope has changed between scenegraph based version of QtQuick 1.1, and graphicsview based version

    XMLWordPrintable

Details

    Description

      When building the qtquick2-integration branch inside the qt-lighthouse rep, there is a change in how the scope of an imported javascript file works compared to qt-4.7. I think the best way to explain the bug is just to run the simple example below to trigger the bug:

      // ui.js
      var WIDTH = 240
      var HEIGHT = 230
      
      // tools.js
      function getWidth() {
          return UI.WIDTH
      }
      
      // main.qml
      import Qt 4.7
      import "ui.js" as UI
      import "tools.js" as Tools
      
      Text {
          width: UI.WIDTH
          height: UI.HEIGHT
          text: "Click to trigger bug!"
          MouseArea {
              anchors.fill: parent
              onClicked: console.debug(Tools.getWidth())
          }
      }
      

      Attachments

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

        Activity

          People

            aakenned Aaron Kennedy
            richard Richard Moe Gustavsen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes