Skip to content

Add shorthand for &self in RustQt blocks where the type can be inferred #1249

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

BenFordTytherington
Copy link
Collaborator

Allows Pin<&mut Self> and &self inside the bridge, as shorthand.

Copy link

codecov bot commented Apr 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (5d3b2de) to head (edc96d6).

Additional details and impacted files
@@            Coverage Diff             @@
##              main     #1249    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           73        74     +1     
  Lines        12634     12784   +150     
==========================================
+ Hits         12634     12784   +150     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@BenFordTytherington BenFordTytherington force-pushed the add-self-shorthand branch 4 times, most recently from 32371fd to e457080 Compare April 4, 2025 15:52
@BenFordTytherington BenFordTytherington marked this pull request as ready for review April 4, 2025 15:54
@BenFordTytherington BenFordTytherington force-pushed the add-self-shorthand branch 2 times, most recently from b97d362 to 8d63f02 Compare April 4, 2025 16:55
@BenFordTytherington
Copy link
Collaborator Author

Tried to implement in the qml_features example and there is a cxx error about there being multiple types in the block, even though there is only one qobject in the example, which may be because it adds the QObject import?

…here the type can be inferred

- If exactly one QObject is present in a block with a method, it will infer `Self` to represent that qobject
- Updates one of the examples to test this out
- QObjects, and invokables are now 2D Vecs, kept in their original block
- Adds some helper methods for iterating like they are still flat
@BenFordTytherington BenFordTytherington force-pushed the add-self-shorthand branch 2 times, most recently from 4d625b2 to 85d8ee3 Compare May 2, 2025 14:17
- Add function call to cxx-qt-build and cxx-qt-macro
- Inlining now happens after parsing and before structuring
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

Successfully merging this pull request may close these issues.

Support for shortand &self in bridge
2 participants