[SOLVED] qbs: Error while executing JavaScriptCommand: ReferenceError: Can't find variable: TextFile



  • I have something like this in my qbs module file
    @
    Rule {
    ...
    prepare: {
    var cmd = new JavaScriptCommand();
    cmd.sourceCode = function() {
    var file = new TextFile(output.fileName, TextFile.WriteOnly);
    file.close();
    }
    return cmd;
    }
    }
    @
    I think it worked before, now during building I get
    "Error while executing JavaScriptCommand: ReferenceError: Can't find variable: TextFile".
    Opening for reading has the same effect. What's wrong?



  • Replying to my own question... This is the helpful answer I received in the qtcreator list:

    "The right place to ask this question is the qbs mailing list; see
    http://lists.qt-project.org/mailman/listinfo/qbs.
    Your problem is probably solved by importing qbs.TextFile at the top of
    your project file. This requirement was recently introduced for
    consistency. Similarly, the other import statement should now read
    "import qbs.FileInfo".

    Christian"


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.