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

Move #[signal] and #[inherit] to extern "RustQt" block #557

Closed
LeonMatthesKDAB opened this issue May 29, 2023 · 1 comment · Fixed by #580
Closed

Move #[signal] and #[inherit] to extern "RustQt" block #557

LeonMatthesKDAB opened this issue May 29, 2023 · 1 comment · Fixed by #580
Assignees
Labels
👷 refactor Something needs to change 🥳🎉 1.0 This issue is part of stabilization for 1.0 release

Comments

@LeonMatthesKDAB
Copy link
Collaborator

See target API in #555

This would unify use of inherit, and make it the same syntax, no matter whether you're inheriting a normal function or a signal.
Also, signals would no longer be an enum, but rather just functions, which also makes our code generation a lot simpler.

@LeonMatthesKDAB LeonMatthesKDAB added 🥳🎉 1.0 This issue is part of stabilization for 1.0 release 👷 refactor Something needs to change labels May 29, 2023
@ahayzen-kdab
Copy link
Collaborator

First stage of this would be to move

    #[cxx_qt::qsignals(RustSignals)]
    pub enum Connection<'a> {
        /// A Q_SIGNAL emitted when a connection occurs
        Connected {
            /// The url for the connection
            url: &'a QUrl,
        },
    }

to

    #[cxx_qt::qsignals]
    extern "C++" {
        fn connected(self: Pin<&mut qobject::RustSignals>, url: &'a QUrl);
    }

Which would bring the API to the same as the inherit block. Then the next stage would be to move both the inherit and signals into the extern "RustQt" block with attributes on each of the signals instead.

And by doing this initial move it also unblocks #556 as then we won't have the enum so properties can generate signals in the same function way.

@ahayzen-kdab ahayzen-kdab self-assigned this Jun 1, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 1, 2023
…inherit

Ensure that attributes on the extern block are empty,
otherwise unsafe detection can fail.

Ensure that attributes on the method as passed through,
otherwise doc lines don't work.

Related to KDAB#557
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 1, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 1, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 2, 2023
…inherit

Ensure that attributes on the extern block are empty,
otherwise unsafe detection can fail.

Ensure that attributes on the method as passed through,
otherwise doc lines don't work.

Related to KDAB#557
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 2, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 2, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 5, 2023
…inherit

Ensure that attributes on the extern block are empty,
otherwise unsafe detection can fail.

Ensure that attributes on the method as passed through,
otherwise doc lines don't work.

Related to KDAB#557
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 5, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 5, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 7, 2023
…inherit

Ensure that attributes on the extern block are empty,
otherwise unsafe detection can fail.

Ensure that attributes on the method as passed through,
otherwise doc lines don't work.

Related to KDAB#557
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 7, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 7, 2023
…inherit

Ensure that attributes on the extern block are empty,
otherwise unsafe detection can fail.

Ensure that attributes on the method as passed through,
otherwise doc lines don't work.

Related to KDAB#557
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 7, 2023
ahayzen-kdab added a commit that referenced this issue Jun 7, 2023
…inherit

Ensure that attributes on the extern block are empty,
otherwise unsafe detection can fail.

Ensure that attributes on the method as passed through,
otherwise doc lines don't work.

Related to #557
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 7, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 8, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👷 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