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

Add support for extern "C++Qt" with type, fn, and signals #577

Closed
4 tasks done
ahayzen-kdab opened this issue Jun 7, 2023 · 2 comments · Fixed by #1084
Closed
4 tasks done

Add support for extern "C++Qt" with type, fn, and signals #577

ahayzen-kdab opened this issue Jun 7, 2023 · 2 comments · Fixed by #1084
Assignees
Labels
⬆️ feature New feature or request 👷 refactor Something needs to change 🥳🎉 1.0 This issue is part of stabilization for 1.0 release

Comments

@ahayzen-kdab
Copy link
Collaborator

ahayzen-kdab commented Jun 7, 2023

Our current generation is mostly about the extern "RustQt" side, once #557 is done we'll have extern "RustQt" with support for inherit and signals. Then #558 adds support for invokables and #559 for type and properties.

But we also want to support foreign types (eg type QButton), so we need to support extern "C++Qt".

  • Add support in parser phase for C++Qt
  • Add support in generation phases for a type that is foreign (it only needs to generate CXX bridges and the signal connect parts?)
  • Ensure that type QButton;, fn show(self: Pin<&mut QButton>);, #[qsignal] fn clicked(self: Pin<&mut QButton>) work, but note that qproperty, inherit, qinvokable should not work ?
  • Change connections to be DirectConnection by default and make choosing a connection type as an unsafe closure (as QueuedConnection could have a mutable reference to something and be executed at any time in the future)

Consider any notes from #527

@ahayzen-kdab ahayzen-kdab added 🥳🎉 1.0 This issue is part of stabilization for 1.0 release ⬆️ feature New feature or request 👷 refactor Something needs to change labels Jun 7, 2023
@ahayzen-kdab ahayzen-kdab changed the title Add support for extern "C++Qt with type, fn, and signals Add support for extern "C++Qt" with type, fn, and signals Jun 7, 2023
@ahayzen-kdab ahayzen-kdab self-assigned this Jul 20, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 26, 2023
This then allows us to easily parse extern "C++Qt" later.

Related to KDAB#577
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 26, 2023
This then allows us to easily parse extern "C++Qt" later.

Related to KDAB#577
Be-ing pushed a commit that referenced this issue Jul 26, 2023
This then allows us to easily parse extern "C++Qt" later.

Related to #577
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 26, 2023
This also simplifies extern "C++Qt" support later.

Related to KDAB#577
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 26, 2023
Rather than building the qualified mappings of the qobject
after already parsing them, do this inline. And build a
helper method to build a Path from two idents without parsing.

Related to KDAB#577
Be-ing pushed a commit that referenced this issue Jul 26, 2023
This also simplifies extern "C++Qt" support later.

Related to #577
Be-ing pushed a commit that referenced this issue Jul 26, 2023
Rather than building the qualified mappings of the qobject
after already parsing them, do this inline. And build a
helper method to build a Path from two idents without parsing.

Related to #577
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 27, 2023
This allows us to reuse it for extern "C++Qt" blocks later.

Related to KDAB#577
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 27, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 28, 2023
This allows us to reuse it for extern "C++Qt" blocks later.

Related to KDAB#577
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 28, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 28, 2023
This allows us to reuse it for extern "C++Qt" blocks later.

Related to KDAB#577
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 28, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 31, 2023
This simplifies the C++ source files as they can use the helper method.

This allows later for a templated signal connect that can use the
public helper method to lock the QObject.

Related to KDAB#577
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 31, 2023
This allows us to reuse it for extern "C++Qt" blocks later.

Related to KDAB#577
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 31, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 31, 2023
This simplifies the C++ source files as they can use the helper method.

This allows later for a templated signal connect that can use the
public helper method to lock the QObject.

Related to KDAB#577
Be-ing pushed a commit that referenced this issue Aug 1, 2023
This simplifies the C++ source files as they can use the helper method.

This allows later for a templated signal connect that can use the
public helper method to lock the QObject.

Related to #577
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Aug 1, 2023
This allows us to reuse it for extern "C++Qt" blocks later.

Related to KDAB#577
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Aug 1, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Aug 1, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Aug 24, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Aug 24, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Aug 24, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Aug 24, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Aug 24, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Aug 24, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Aug 24, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Aug 24, 2023
Be-ing pushed a commit to ahayzen-kdab/cxx-qt that referenced this issue Aug 24, 2023
Be-ing pushed a commit to ahayzen-kdab/cxx-qt that referenced this issue Aug 24, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Aug 25, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Sep 21, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Sep 21, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Oct 3, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Oct 4, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Oct 4, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Nov 15, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Nov 15, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Nov 17, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Nov 17, 2023
@LeonMatthesKDAB
Copy link
Collaborator

TODO: Check correct marker Traits (Send, Sync, etc.)

LeonMatthesKDAB added a commit to LeonMatthesKDAB/cxx-qt that referenced this issue Oct 1, 2024
The closures may be executed on a different thread, depending on where
the emitting object lives.

Also closes KDAB#577. We have determined that is indeed safe to queue a
deferred closure, as the closure will not be called if the object is
deleted, as we use the object itself as the context.
ahayzen-kdab pushed a commit to LeonMatthesKDAB/cxx-qt that referenced this issue Oct 2, 2024
The closures may be executed on a different thread, depending on where
the emitting object lives.

Also closes KDAB#577. We have determined that is indeed safe to queue a
deferred closure, as the closure will not be called if the object is
deleted, as we use the object itself as the context.
ahayzen-kdab pushed a commit that referenced this issue Oct 2, 2024
The closures may be executed on a different thread, depending on where
the emitting object lives.

Also closes #577. We have determined that is indeed safe to queue a
deferred closure, as the closure will not be called if the object is
deleted, as we use the object itself as the context.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⬆️ feature New feature or request 👷 refactor Something needs to change 🥳🎉 1.0 This issue is part of stabilization for 1.0 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants