Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registering metatypes declared in OCaml #42

Open
Kakadu opened this issue Jan 30, 2017 · 6 comments
Open

Registering metatypes declared in OCaml #42

Kakadu opened this issue Jan 30, 2017 · 6 comments

Comments

@Kakadu
Copy link
Owner

Kakadu commented Jan 30, 2017

It should allow declaring types in OCaml

class MyMegaItem = object ... end
let () = registerMetaType_MyMegaItem ()

ad use them in QML

Item {
  MyMetaItem { ... }
}
@ghost
Copy link

ghost commented Jan 31, 2017

This is a good direction to go, given that QML is not meant to be bound to, but the other way around (QML encapsulating C++).

Could this approach benefit from @mrvn's work?

@Kakadu
Copy link
Owner Author

Kakadu commented Feb 1, 2017 via email

@Kakadu
Copy link
Owner Author

Kakadu commented Feb 14, 2017

Writing the status down in case I will not return back to this task.

I did some hacking in the branch declareMetaType. Good thing is that I simplified code generation a bit by using ppx_tools.metaquot ocamlfind package. Another good thing is that we are able to register generated class type in QML engine and use it without error.

The bad thing that is not yet usable in general. It is expected that we define good, useful, non-virtual ocaml class and allow C++ side to use methods from it. But at the moment everything is implemented in another way: ocaml object creates C++ object to use it. Need some more time to investigate it. Not sure when.

@ghost
Copy link

ghost commented Feb 15, 2017

What is the output of your approach? Some generated C++ files?

@Kakadu
Copy link
Owner Author

Kakadu commented Feb 15, 2017

Yeah, the same as before.

@Kakadu
Copy link
Owner Author

Kakadu commented Feb 25, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant