https://github.com/diro/qml_underscorejs
Underscore.js for QML
https://github.com/diro/qml_underscorejs
Last synced: 14 days ago
JSON representation
Underscore.js for QML
- Host: GitHub
- URL: https://github.com/diro/qml_underscorejs
- Owner: diro
- Created: 2015-10-27T03:37:35.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-10-28T03:25:20.000Z (about 10 years ago)
- Last Synced: 2024-06-16T04:52:55.991Z (over 1 year ago)
- Language: JavaScript
- Size: 156 KB
- Stars: 7
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-qt-qml - qml_underscorejs - A port of underscore.js to Qt/QML. (JavaScript)
README
# qml_underscorejs
A port of underscore.js to Qt/QML.
The original Underscore. js will attach _ object to this object , but in QML we cannot add global object.
Please refer to:
http://doc.qt.io/qt-5/qtqml-javascript-hostenvironment.html#javascript-environment-restrictions
In this port, we attach _ object to the global object Qt, and then you could use all the underscore.js function in your QML.
# example
import "underscore.js" as Underscore
Item
{
...
enabled: Qt._.every([inptBoxIP, inptBoxUser, inptBoxPassword],
function f(e) {
return e.text !== ""
})
...
}