How can I generate bindings for a custom class? #165
Closed
paul35621
started this conversation in
Show and tell
Replies: 1 comment
-
Excellent. Thank you for sharing it! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to implement a subclass of QAbstractItemModel in C++ instead of Java to get better performance. It would be nice if I can generate Java bindings for this class, but I'm struggling with this. I'm using Qt 6.5.1 and QtJambi 6.5.2 and I compiled the generator using Ant 1.10.14 and MSVC 19.29.30151.
When I run
QtJambiGenerator.exe nodemodel.h
I can read inmjb_rejected_classes.log
that NodeModel is not in the type system. So I figured that I need to put NodeModel in the type system some how and I made the file typesystem.qml.When I run
QtJambiGenerator.exe -t typesystem.qml nodemodel.h
I get aNo such file or directory: <QAbstractItemModel>
warning inreported_warnings.log
, so it seems I need to add an include path.Now I run
QtJambiGenerator.exe -I "C:\Qt\6.5.1\msvc2019_64\include;C:\Qt\6.5.1\msvc2019_64\include\QtCore" -t typesystem.qml nodemodel.h
, and it seems to work! The C++ and Java files that are generated look alright.I started writing this issue, convinced that I wouldn't get it working, but now it works. I'm posting it anyway so there is some documentation.
nodemodel.h
typesystem.qml
Beta Was this translation helpful? Give feedback.
All reactions