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

cxx-qt-gen: support for marking signals in the base class #415

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

ahayzen-kdab
Copy link
Collaborator

Closes #286

@ahayzen-kdab
Copy link
Collaborator Author

Currently this uses

#[cxx_qt::signals(MyObject)]
enum Signal {
    #[existing_cxx_name="dataChanged"]
    DataChanged
}

But maybe instead the cxx_name and existing should be split ? and is inherit or cxx_inherit a better name as it matches the #363 macro ?

#[cxx_qt::signals(MyObject)]
enum Signal {
    #[cxx_name="dataChanged"] 
    #[inherit]
    DataChanged
}

If you just use inherit then it can do the normal case conversion, and if you use cxx_name by itself then you can choose a different name for C++ than Rust.

@ahayzen-kdab ahayzen-kdab force-pushed the 286-signal-base branch 2 times, most recently from 72d91a7 to 46ee6fd Compare January 16, 2023 14:02
@ahayzen-kdab ahayzen-kdab changed the title WIP: cxx-qt-gen: support for marking signals in the base class cxx-qt-gen: support for marking signals in the base class Jan 16, 2023
@ahayzen-kdab
Copy link
Collaborator Author

Currently this uses

#[cxx_qt::signals(MyObject)]
enum Signal {
    #[existing_cxx_name="dataChanged"]
    DataChanged
}

But maybe instead the cxx_name and existing should be split ? and is inherit or cxx_inherit a better name as it matches the #363 macro ?

#[cxx_qt::signals(MyObject)]
enum Signal {
    #[cxx_name="dataChanged"] 
    #[inherit]
    DataChanged
}

If you just use inherit then it can do the normal case conversion, and if you use cxx_name by itself then you can choose a different name for C++ than Rust.

Changed :-)

@ahayzen-kdab ahayzen-kdab marked this pull request as ready for review January 16, 2023 14:38
@Be-ing
Copy link
Contributor

Be-ing commented Jan 24, 2023

Looks good besides picking some more specific naming in the example.

@Be-ing Be-ing merged commit 202889f into KDAB:main Feb 1, 2023
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.

Have an attribute on signals to say that that signal already exists
2 participants