You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think it makes sense to try and provide an overly generalized solution that might be further extended in order to work with Qt. Instead, support should be built-in, especially considering this is a non-trivial thing to do even in this mode.
Without accounting for some basic interop problems, like extreme difficulty of inheritance #2 , wrapping methods #1 and other things that are most likely yet to be discovered, there are some Qt-specific problems, that make it harder to provide meaningful wrappers. Specifically - signal and slot mechanism, dynamic properties. Latter one is not as fundamental as slots, so it can be addressed sometimes later. Slots on the other hand are the most important feature, and I really need to consider how to approach them.
Generating list of existing signals and slots.
Proof Of Concept: Re-implementing Qt moc using libclang provides an implementation of a tool that can read and analyze C++ source code while keeping track of the signal/slot mechanism. The problem with implementation - despite the article name, it uses libtooling API, which is quite hard to wrap, and will require a lot more stability than just Qt libtooling wrappers #19.
The alternative solution is to rely on boost::wave capabilities once again, in order to keep track of all macros that have been expanded. Considering Qt is split into lots of very clean headers (one per class), running tree-sitter&boost::wave pipeline would be a lot faster.
It is possible to fork and modify tree-sitter grammar for C++, to allow for signals/slots to be included in the access_specifier rule pattern.
- ADDED ::
- Support for reading Qt signals, slots
- General C++ method, constructor handling
- NEXT ::
- Make a simplified test for Qt wrapper generator before going into
wrapping whole Qt library.
- #25
- ADDED ::
- Support for `__attribute__((annotate("qt_signal")))` annotation
detection for the libclang-based frontend.
- Get parent translation unit from any cursor
- REMOVED ::
- `.unit` field fron `WrapConf` value - when needed it can be retrieved
using `getParentTranslationUnit()`
- RELATED ::
- #25
After reading https://woboq.com/blog/verdigris-qt-without-moc.html I think it would be possible to use https://github.com/woboq/verdigris approach, either directly or via additional codegen. I would need to generate c++ classes at some point anyway, so it makes sense to extend on that approach. Although, generated header files could be processed my mic as well, but it would require separate build step after every class has been generated. Is it possible run nim compiler in steps? Generate cxx code, and then compile things separately.
I don't think it makes sense to try and provide an overly generalized solution that might be further extended in order to work with Qt. Instead, support should be built-in, especially considering this is a non-trivial thing to do even in this mode.
Without accounting for some basic interop problems, like extreme difficulty of inheritance #2 , wrapping methods #1 and other things that are most likely yet to be discovered, there are some Qt-specific problems, that make it harder to provide meaningful wrappers. Specifically - signal and slot mechanism, dynamic properties. Latter one is not as fundamental as slots, so it can be addressed sometimes later. Slots on the other hand are the most important feature, and I really need to consider how to approach them.
boost::wave
capabilities once again, in order to keep track of all macros that have been expanded. Considering Qt is split into lots of very clean headers (one per class), runningtree-sitter&boost::wave
pipeline would be a lot faster.access_specifier
rule pattern.Related
The text was updated successfully, but these errors were encountered: