Qt Quick Underscore.js: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
(No difference)

Revision as of 16:54, 14 January 2015

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: