Code Monkey home page Code Monkey logo

qml_zig's Introduction

QML-zig

GitHub All Releases GitHub release (latest by date) GitHub

Bindings are based on DOtherSide C bindings for QML Library is mostly feature-compliant with other bindings based on the library, but lacks some minor features and has quite a few bugs.

Preview

qml_zig

Build - Steps

Requirements

All software required for building.

  • Qt 5.15 or higher
  • Zig v0.12.0 or higher
  • CMake v3.2 or higher (DOtherSide build)

Question

Works on Qt6?

Maybe, check DOtherSide support!!

Instructions

# Clone repo
git clone --recursive https://github.com/kassane/qml_zig

# Open folder
cd qml_zig

# build DOtherSide
zig build cmake

# Build
zig build ExampleName -Doptimize=ReleaseSafe|-Doptimize=ReleaseFast|-Doptimize=ReleaseSmall

Examples

zig build Animated - Run an Animated Box

zig build Hello - Hello World, with Menu and Clickable Button

zig build Cells - Cells example from QML Tute, click a color to change the text

zig build Button - Button with 2-way comms to the Zig code

zig build Layouts - Layouts examples

zig build Splits - Splitview example

zig build Tables - Tableview example

Work in Progres Examples

zig build Particle - Particle system example

  • Needs QObject wrapper working yet, to pass zig objects to the QML side

Status

  • Basic initialization and execution
  • More Examples - thanks @zigster64!
  • Providing properties to QML files

TODO

  • QAbstractListModels
  • QObject - working progress
  • QStyle

qml_zig's People

Contributors

kassane avatar sreehax avatar zigster64 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

qml_zig's Issues

QObject support

Opened this issue up for discussion on the topic of completing :

  • QObject wrapper
  • Signals and Slots all working nicely

I have made a little bit of progress .. have managed to hack together some code that correctly sets up a zig struct as a QObject, passes the object to QML, and within the QML it can make method calls on the object.

So the basic wiring works - just needs a lot of work to make it work for the general case. Getting there.

Whilst QML can call Zig functions / object methods directly - I dont have actual Signal / Slot wiring working yet, or automatic Props. ie - when the Zig data changes, its not yet emitting signals that the QML should be picking up and updating the screen.

Difficulty is that on the zig side, we are literally "staring into the void" with the data, as everything is a C void*. I need to spend some time to understand the internals of all the Q classes :)

DOtherSide updates

Whats there in DOtherrSide is great, but there are pretty large gaps compared to the full QML API.

I have forked DOtherSide for now, and will attempt to fill in some gaps as I go, to add full support in Zig .. but its going to be a long process.

Basically, anything that isnt currently supported in DOtherSide, will put off trying to fix until we get 99% of the existing parts ported.

In terms of wrapping DOtherSide with a Zig API - its an interesting problem.

I really like the final API with the go-qml port, as you simply add Go objects to the QML and it just works. The implementation code is just horrible though, and not easy to port to Zig. Its mostly work to get around the fact that Go is not ABI compatible with C code.

The Rust binding is good to follow to get hints on what to do. However the user API that you end up with seems a bit convoluted.

Surprisingly, the D API looks great, and the implementation of DOtherSide is really clean and easy to follow. Wasnt expecting that !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.