Qt Quick Underscore.js

From Qt Wiki
Revision as of 16:54, 14 January 2015 by Maintenance script (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Using Underscore.js library in Qt Quick

Underscore is a JavaScript library that provides a whole mess of useful functional programming helpers without extending any built-in objects.
(http://underscorejs.org/)

Unfortunately you cannot just import Underscore like:
due immutable root object [qt.io]

The workaround is to modify underscore.js so that it returned underscore object via special init function.

This is a diff output for Underscore.js version 1.4.4:

Now you can use it in your project:

Drawback of this approach is the following warning in application console: