[GH-ISSUE #119] Auto generating interop C++/C# code. #71

Open
opened 2026-05-05 11:03:25 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @pauldotknopf on GitHub (Apr 14, 2019).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/119

Right now, it is cumbersome to flesh out the boilerplate needed for some simple getters/setters.

I'd like to have another console project where we can define the interop API with C# models, and then generate the C++/C# to go back and forth.

SWIG does someting similar, but I'd prefer a home-grown approach that uses QSharedPointer and special Qt meta-system support.

Originally created by @pauldotknopf on GitHub (Apr 14, 2019). Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/119 Right now, it is cumbersome to flesh out the boilerplate needed for some simple getters/setters. I'd like to have another console project where we can define the interop API with C# models, and then generate the C++/C# to go back and forth. SWIG does someting similar, but I'd prefer a home-grown approach that uses ```QSharedPointer``` and special Qt meta-system support.
Author
Owner

@pauldotknopf commented on GitHub (Jul 18, 2019):

Note, this is for the internal interop only, not the classes defined in your implementation.

<!-- gh-comment-id:512658113 --> @pauldotknopf commented on GitHub (Jul 18, 2019): Note, this is for the internal interop only, not the classes defined in your implementation.
Author
Owner

@vadi2 commented on GitHub (Jul 18, 2019):

Would this mean that any Qt class would be available for use, instead of only ones marked as Q_INVOKABLE right now?

<!-- gh-comment-id:512678741 --> @vadi2 commented on GitHub (Jul 18, 2019): Would this mean that any Qt class would be available for use, instead of only ones marked as `Q_INVOKABLE` right now?
Author
Owner

@pauldotknopf commented on GitHub (Jul 18, 2019):

No, unfortunately. The properties/methods that are dynamically invokable must be made visible to the meta object system. This is only done via Q_PROPERTY and Q_INVOKABLE (or slots).

<!-- gh-comment-id:512791818 --> @pauldotknopf commented on GitHub (Jul 18, 2019): No, unfortunately. The properties/methods that are dynamically invokable must be made visible to the meta object system. This is only done via Q_PROPERTY and Q_INVOKABLE (or slots).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/qmlnet#71
No description provided.