Closed HertzDevil closed 4 years ago
@HertzDevil this is awesome, thanks! @Papierkorb the patch looks pretty good to me. When you get a chance please review it from your wider perspective, thanks!
Thank you for writing the code! Just got home from a vacation, please give me a day or two to review it. The summary on your post sounds good to me 👍
The new integration tests are still restricted to Qt signals, because no other processors emit Crystal wrappers expecting block arguments.
I added a comment to your most recent commit. A C++ method that takes a std::function<>
as last argument is supposed to turn into a block-receiving method in Crystal - But I'm fine with the placement of the test.
Besides the comment this LGTM, so afterwards I think it's ready to be merged :smile:
Wonderful, thanks!
Ya great job, thank you!
An attempt to fix #59, through a new
BlockOverloads
processor. For instance this isQt::ButtonGroup#on_button_toggled
, which has 2 overloads each taking two parameters in the block:Similar transformations may be applied even for non-Qt bindings, as long as block arguments are emitted somewhere (that's why the code sits in a new processor rather than in
Qt
).I have restricted this to methods that do not take non-block arguments, because I am unsure whether those type tags should be prepended at the start or inserted right before the block; the former resembles C++ function templates, while the latter places the tags closer to the block itself. Fortunately, all those ambiguous methods in the Qt bindings are precisely those
#on_SIGNAL
functions, which indeed take just the block argument.Bindgen::Call::TypeArgument
is there because I don't thinkArgument
really supports this_.class
usage. This may prove useful for function template instantiations in the future where type tags are similarly passed as regular arguments (template <class> bool QVariant::canConvert() const
for example).