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

Have a handle_init / handle_destroy function and trait #13

Closed
2 tasks
ahayzen-kdab opened this issue Dec 8, 2021 · 1 comment
Closed
2 tasks

Have a handle_init / handle_destroy function and trait #13

ahayzen-kdab opened this issue Dec 8, 2021 · 1 comment
Labels
⬆️ feature New feature or request

Comments

@ahayzen-kdab
Copy link
Collaborator

ahayzen-kdab commented Dec 8, 2021

Currently there is no way to perform any tasks at creation of the object that require access to the CppObj. (eg starting a background thread that takes the update_requester).

There also isn't a way to tidy up when the object is deconstructed, eg closing a thread / disconnect from db / network.

Add a HandleInit / HandleDestroy trait and method similar to handle_property_change, which is triggered by in the constructor / deconstructor of the object.

  • HandleInit / HandleConstructor trait
  • HandleDestroy / HandleDeconstructor trait
@ahayzen-kdab ahayzen-kdab added the ⬆️ feature New feature or request label Dec 8, 2021
@ahayzen-kdab ahayzen-kdab changed the title Have a handle_init function and trait Have a handle_init / handle_destroy function and trait Dec 9, 2021
@ahayzen-kdab ahayzen-kdab added this to the v0.2 milestone Dec 9, 2021
@ahayzen-kdab ahayzen-kdab modified the milestones: v0.2, v0.3 Jan 7, 2022
@ahayzen-kdab ahayzen-kdab removed this from the v0.3 milestone Jul 14, 2022
@ahayzen-kdab
Copy link
Collaborator Author

This is less relevant now, you can use the Default and Drop for Rust fields and properties. If you needed the C++ context. Then you could create a Rust invokable that is triggered by onCompleted/onDestructed.

ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 5, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 7, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 12, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 12, 2023
Be-ing pushed a commit that referenced this issue Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⬆️ feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant