Skip to content
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

Consider if cxx_type and return_cxx_type are still required #289

Closed
ahayzen-kdab opened this issue Oct 3, 2022 · 3 comments · Fixed by #554
Closed

Consider if cxx_type and return_cxx_type are still required #289

ahayzen-kdab opened this issue Oct 3, 2022 · 3 comments · Fixed by #554
Assignees
Labels
🤔 discussion Feedback welcome
Milestone

Comments

@ahayzen-kdab
Copy link
Collaborator

ahayzen-kdab commented Oct 3, 2022

Do we still need the cxx_type and return_cxx_type ? If they can be removed then signal emits don't need a wrapper. And macro attribute parsing may be simpler. And the templates for converts can be removed.

@ahayzen-kdab ahayzen-kdab added the 🤔 discussion Feedback welcome label Oct 3, 2022
@ahayzen-kdab ahayzen-kdab added this to the 0.5 milestone Oct 3, 2022
@ahayzen-kdab ahayzen-kdab removed this from the 0.5 milestone Jan 9, 2023
@ahayzen-kdab ahayzen-kdab added this to the 0.5 milestone Jan 31, 2023
@ahayzen-kdab
Copy link
Collaborator Author

Workarounds if this was to be removed, eg if you have a UniquePtr / &T in Rust and T in C++

Properties

Create a getter/setter with UniquePtr / &T invokables in Rust, then create a subclass in C++ that defines the Q_PROPERTY, getter/setter/signal with T that wrap the Rust getter/setter

Invokables

Create an invokable using taking/returning the UniquePtr / &T in Rust, then create a subclass in C++ with a second invokable that wraps Rust invokable

Signals

Create the signal using UniquePtr in Rust, then create a subclass in C++ with a second signal that connects the first and does the conversion.

Inherit from base class

Create a C++ subclass of the base that has T, which exposes a method with UniquePtr / &T then Rust / CXX can bind to this.

@LeonMatthesKDAB @Be-ing Now that most Qt types are trivial and we can easily inherit from classes, can we see any other scenarios where our old cxx_type or return_cxx_type would be useful ? Or should we just remove it as it adds complexity to our generator code, the generated code, and it appears that the use cases for it can be worked around simply with a C++ proxy in the right place. And this is probably a small use case anyway ?

@LeonMatthesKDAB
Copy link
Collaborator

I'd like to do further testing with CXX-Qt in a real project before making decisions like this.
Hopefully I'll find time for my Markdown-combiner again, then I can report if I ever needed this.

But I suspect this can go to the chopping block.

@ahayzen-kdab
Copy link
Collaborator Author

I'd like to do further testing with CXX-Qt in a real project before making decisions like this. Hopefully I'll find time for my Markdown-combiner again, then I can report if I ever needed this.

But I suspect this can go to the chopping block.

My hope is that these are needed to rarely that the workarounds listed above using a bit of C++ are enough for the few use cases one might have. As this would reduce complexity on our side quite a lot :-)

@ahayzen-kdab ahayzen-kdab modified the milestones: 0.5, 0.6 Feb 6, 2023
@ahayzen-kdab ahayzen-kdab self-assigned this May 29, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue May 29, 2023
These aren't needed anymore as most Qt types are trivial.
This prevents us directly binding to things like signal later.
And these can all be worked around in C++ with proxies.

Closes KDAB#289
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue May 29, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue May 29, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue May 29, 2023
These aren't needed anymore as most Qt types are trivial.
This prevents us directly binding to things like signal later.
And these can all be worked around in C++ with proxies.

Closes KDAB#289
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue May 29, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue May 29, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue May 29, 2023
These aren't needed anymore as most Qt types are trivial.
This prevents us directly binding to things like signal later.
And these can all be worked around in C++ with proxies.

Closes KDAB#289
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue May 29, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue May 29, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue May 29, 2023
This is now unused as the type conversion has been removed.

Related to KDAB#289
ahayzen-kdab added a commit that referenced this issue May 29, 2023
These aren't needed anymore as most Qt types are trivial.
This prevents us directly binding to things like signal later.
And these can all be worked around in C++ with proxies.

Closes #289
ahayzen-kdab added a commit that referenced this issue May 29, 2023
ahayzen-kdab added a commit that referenced this issue May 29, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 2, 2023
This is now unused as the type conversion has been removed.

Related to KDAB#289
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 2, 2023
This is now unused as the type conversion has been removed.

Related to KDAB#289
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 5, 2023
This is now unused as the type conversion has been removed.

Related to KDAB#289
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 5, 2023
This is now unused as the type conversion has been removed.

Related to KDAB#289
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 7, 2023
This is now unused as the type conversion has been removed.

Related to KDAB#289
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 8, 2023
This is now unused as the type conversion has been removed.

Related to KDAB#289
ahayzen-kdab added a commit that referenced this issue Jun 9, 2023
This is now unused as the type conversion has been removed.

Related to #289
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤔 discussion Feedback welcome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants