All Projects → BrigJS → Brig

BrigJS / Brig

Licence: mit
User Interface Toolkits for Node.js

Labels

Projects that are alternatives of or similar to Brig

Qml Ui Animations
QML implementations of various UI concepts by various artists
Stars: ✭ 164 (-21.15%)
Mutual labels:  qml
Learnopengl Qt3d
QML/Qt3D version of http://learnopengl.com samples
Stars: ✭ 183 (-12.02%)
Mutual labels:  qml
Vodka
VOFA+ Plugins
Stars: ✭ 198 (-4.81%)
Mutual labels:  qml
Shell
🐚 QtQuick and Wayland shell for convergence
Stars: ✭ 168 (-19.23%)
Mutual labels:  qml
Wellchat
WellChat is a Application that is a WeChat-like APP by qml.好吧~原谅我的英语。这个一个使用qml来仿制安卓微信的Qt程序,可以运行在安卓上。
Stars: ✭ 174 (-16.35%)
Mutual labels:  qml
Browser
🌍 Cross-platform Material design web browser
Stars: ✭ 184 (-11.54%)
Mutual labels:  qml
Kirigami
A QtQuick based components set
Stars: ✭ 163 (-21.63%)
Mutual labels:  qml
Qtquickcontrols2
Qt Quick Controls 2
Stars: ✭ 203 (-2.4%)
Mutual labels:  qml
Qml
Introductions to key concepts in quantum machine learning, as well as tutorials and implementations from cutting-edge QML research.
Stars: ✭ 174 (-16.35%)
Mutual labels:  qml
Qml Rust
QML (Qt Quick) bindings for Rust language
Stars: ✭ 196 (-5.77%)
Mutual labels:  qml
Gcompris Qt
GCompris in Qt Quick
Stars: ✭ 169 (-18.75%)
Mutual labels:  qml
Telephant
A lightweight but modern Mastodon client for the desktop
Stars: ✭ 174 (-16.35%)
Mutual labels:  qml
Asyncfuture
Use QFuture like a Promise object
Stars: ✭ 193 (-7.21%)
Mutual labels:  qml
Zshelf
reMarkable app: Browse and download books from Z-Library
Stars: ✭ 166 (-20.19%)
Mutual labels:  qml
Qml Creative Controls
QML controls for creative applications and creative coding
Stars: ✭ 199 (-4.33%)
Mutual labels:  qml
Flat.qml
FlatUI by qml, 参考FlatUI设计的一套qml控件
Stars: ✭ 164 (-21.15%)
Mutual labels:  qml
Stratifyqml
Stratify Labs UI QML framework inspired by Twitter Bootstrap
Stars: ✭ 183 (-12.02%)
Mutual labels:  qml
Qtmvvm
A mvvm oriented library for Qt, to create Projects for Widgets and Quick in parallel
Stars: ✭ 205 (-1.44%)
Mutual labels:  qml
Projecteur
Linux Desktop Application for the Logitech Spotlight device (and similar devices) - Digital Laser Pointer
Stars: ✭ 199 (-4.33%)
Mutual labels:  qml
Qml Coding Guide
A collection of good practices when writing QML code
Stars: ✭ 196 (-5.77%)
Mutual labels:  qml

Brig

A user interface toolkit for Node.js, which is based on Qt for rendering. This project can be used to load and play QML file, make it possible to have a easy way to communicate between QML and Node.js for desktop application.

NPM

The JavaScript in QML is limited, so Brig

The JavaScript in QML is limited, which is used for QML components control only. If developer need more functions that something's like system calls(FileSystem, Socket, crypto ...etc) or using external libraries, C/C++ is the only way to make it.

In order to make QML application in pure JavaScript possible, Brig provides a way to use Node.js to extends QML without C/C++. That means developer can do more thing in QML with NPM modules and Node.js APIs.

Requirements

Ensure Qt 5+ tookits and Node.js 0.10+ are ready to go on your system.

For MacOSX user, no need to install Qt development environment for brig anymore. :-)

Known Issues

  • Failed to build brig for Qt 5.8+

Installation

Install module via NPM

npm install brig

Get Started

There is a simple way to go by loading existed QML file, so you can prepare a QML content like below:

Application.qml

import QtQuick 2.3
import QtQuick.Controls 1.0

ApplicationWindow {
	visible: true;
	color: 'black';
	title: 'Brig Demo';
	width: 640;
	height: 480;

	Text {
		anchors.centerIn: parent;
		text: 'Brig';
		font.family: 'Helvetica';
		font.bold: true;
		font.pointSize: 72;
		color: '#00ffcc';
		scale: 0;
		opacity: 0;

		Text {
			anchors.topMargin: 10;
			anchors.top: parent.bottom;
			anchors.horizontalCenter: parent.horizontalCenter;
			text: 'QML Application in Node.js';
			font.family: 'Helvetica';
			font.pointSize: 16;
			color: '#e6fffa';
		}

		Behavior on opacity {
			NumberAnimation {
				duration: 800;
				easing.type: Easing.OutCubic;
			}
		}

		Behavior on scale {
			NumberAnimation {
				duration: 1000;
				easing.type: Easing.OutBack;
			}
		}

		Component.onCompleted: {
			opacity = 1.0;
			scale = 1.0;
		}
	}
}

Then using Brig to load file in Node.js:

var Brig = require('brig');

var brig = new Brig();

brig.on('ready', function(brig) {

  // Loading QML file to play
  brig.open('Application.qml', function(err, window) {
    // window was opened
  });
});

Customized Type

(This is experimental feature, API might be changed in the next version)

You can create a customized type in order to expose some APIs or functionality from Node.js to QML, see below:

var myQmlType = brig.createType('MyItem', {
	property: {
		prop1: 123
	},
	method: {
		'readFile(a)': function(filename) {
			return require('fs').readFileSync(filename).toString();
		}
	},
	signal: [
		'test(a)'
	]
});

// Triggered when instance of customized type was created
myQmlType.on('instance-created', function(instance) {

	// Signals
	instance.on('test', function(a) {
		// test(a) signal was emitted
		console.log(a);
	});
});

In QML, we can import customized type with its type name and use it directly:

import Brig.MyItem 1.0

Usage:

MyItem {
	// attributes...
}

Examples

Some exmaples you can found which used brig:

Demonstration

Here is a great countdown timer with Brig for hackathon event to show off, you can click image to play YouTube video:

Countdown Timer (clicks to play video)

License

Licensed under the MIT License

Authors

Copyright(c) 2015-2017 Fred Chien <[email protected]>

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].