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

Path resolving in JavaScript incompatible with Qt 4.x

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.0.0
    • 5.0.0 RC 1
    • None
    • Linux Ubuntu 12.10 x86_64 using latest build from ppa:canonical-qt5-edgers/qt5-daily

    Description

      Path resolving in JavaScript is incompatible with Qt 4.x (4.8.3):

      I have a project that is working on Qt 4.8.3, folder structure as follows:

      Generic/
          DynCreator.js
      App1/
          Main.qml
          Comp.qml
      

      In 4.8 I included the DynCreator.js in Main.qml as:
      import "../Generic/DynCreator.js" as DynCreator

      DynCreator.js creates components dynamically with dynObject = Qt.createComponent("Comp.qml"); dynObject.createObject(parent);

      Qt 4.8 finds Comp.qml as it is same folder as the script that imported the JavaScript (Main.qml) but Qt 5.0 don't find the file as it resolves path relative to imported script location.

      So call was modified to: Qt.createComponent("../App1/Comp.qml") in 5.0 and it started working.

      If this not intentional behavior-change, this should be WELL documented in 5.0.

      Attachments

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

        Activity

          People

            aalpert Alan Alpert
            jartza Jari Tulilahti
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes