• Stars
    star
    106
  • Rank 325,871 (Top 7 %)
  • Language
    JavaScript
  • Created over 9 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A bridge library that allows to use React.js with QML

DEPRECATED. This project is no longer in active development.

react-qml

GitHub version Build Status Dependency Status Inline docs Code Climate

react-qml is a bridge library that allows to use React.js with QML.

Install

At the moment ReactQml requires special manual bundling before it can be used inside Qml, so you have to download javascript bundle manually from [releases pages|https://github.com/grassator/react-qml/releases].

After that place it in your QML root, and import by adding following line at the top your main.qml:

.import 'ReactQml.js' as React

Example

Usage of ReactQml is pretty straightforward β€” the only difference from web version is that you need to pass id of the qml item to React.render instead of DOM node. For example:

import QtQuick 2.4
import QtQuick.Controls 1.3
import "js/ReactQml.js" as React

ApplicationWindow {
    id: root
    title: qsTr("React QML")
    width: 300
    height: 300
    visible: true

    function reactRender(x, y) {
        var props = {
            x: 100,
            y: 100,
            width: 100,
            height: 100,
            color: '#000'
        };
        var childProps = {
            x: 25,
            y: 25,
            width: 50,
            height: 50,
            color: '#fff'
        };
        var child = React.createElement(React.Rectangle, childProps);
        React.render(React.createElement(React.Rectangle, props, child), root);
    }

    Component.onCompleted: {
        reactRender();
    }
}

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using gulp.

License

Copyright (c) 2015 Dmitriy Kubyshkin. Licensed under the MIT license.

More Repositories

1

canvas-text-editor-tutorial

Simple text editor using html5 canvas
JavaScript
291
star
2

mass

A compiler for a new language focusing on compile-time execution and no LLVM dependency.
C
281
star
3

win32-window-custom-titlebar

Win32 C99 / C++98 code for a custom title bar on Windows 10
C
124
star
4

bdd-for-c

A simple BDD library for the C language
C
103
star
5

insert-text-at-cursor

Fast crossbrowser insertion of text at cursor position in a textarea / input
JavaScript
71
star
6

webpack-extract-translation-keys

This plugin extracts translation keys for applications requiring runtime translations
JavaScript
38
star
7

qml-commonjs

Experiment in adding CommonJS support to QML.
JavaScript
28
star
8

php-flatfile-markdown-website

Simple Markdown-based Website Engine
PHP
24
star
9

happened

PubSub / Event Bus library
JavaScript
10
star
10

phpstorm-nature-theme

Light and pleasant theme for JetBrains PHPStorm
9
star
11

pama

Pattern Matching for JavaScript
JavaScript
7
star
12

rain

Auto-minimization tool for fluid images
C++
7
star
13

defer-for-c

Experimental function-level defer for pure C89
C
6
star
14

iamdee

Small AMD loader for inlining
TypeScript
6
star
15

jquery-brute-select

Simple stylizable custom select input implementation.
JavaScript
6
star
16

getting

TypeScript
5
star
17

react-stasis

Universally (isomorphically) render parts of your react tree only on backend
JavaScript
5
star
18

jquery-lightweight-colorpicker

A simple, scalable zero-configuration color picker for modern browsers
JavaScript
4
star
19

eskip.tmbundle

Syntax highlighting for eskip language for TextMate and Sublime Text
4
star
20

ExtremeCSS.tmbundle

Better CSS Bundle with power of mCSS bundle and spices like CSS3 properties and clever regexp substitutions
Ruby
4
star
21

karma-generic-preprocessor

Provides a way to define preprocessors inline in the karma configuration files.
JavaScript
4
star
22

batmanjs-address-book

Simple app to demonstrate power of Batman.js
CoffeeScript
3
star
23

kinetic-scroll

iOS-like scroll for webkit-based browsers
CoffeeScript
3
star
24

docpad-plugin-datefromfilename

DocPad plugin for specifying document dates at the beginning of their filenames
CoffeeScript
3
star
25

chrome-search-auto-focus

Auto-focuses search field when you start to type outside a form input
JavaScript
3
star
26

jdaughter

Typesafe JSON decoding for TypeScript
TypeScript
3
star
27

pixelmator-opacity-helper

Control brush opacity with number keys in Pixelmator
Objective-C
2
star
28

adventofcode2018

Haskell
2
star
29

benign

Provides a proxy-based object that tries to look like it does everything you want
TypeScript
2
star
30

safe-fetch

A fetch() wrapper that automatically takes care of CSRF protection
JavaScript
2
star
31

utf8string

An implementation of Utf8 based string in JavaScript
JavaScript
1
star
32

aa-tree-js

Implementation of AA Tree in JavaScript with D3.js visualization.
JavaScript
1
star
33

live-html

JavaScript
1
star
34

tpl-loader

JavaScript
1
star
35

qml-utils

Collection of useful qt qml native and js modules
C++
1
star
36

grunt-requirejs-karma-seed

Starting point for developing a web frontend component
JavaScript
1
star