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

C++ name mappings doesn't consider shared types #402

Closed
ahayzen opened this issue Jan 1, 2023 · 0 comments
Closed

C++ name mappings doesn't consider shared types #402

ahayzen opened this issue Jan 1, 2023 · 0 comments
Assignees

Comments

@ahayzen
Copy link

ahayzen commented Jan 1, 2023

Note that if this was fixed one can nearly use Q_ENUM_NS to register CXX shared enum as a QML enum, however QML appears to be confused by the enum class T : ::std::intN_t (?). #34

#[cxx_qt::bridge]
mod ffi {
   #[namespace = "Enums"]
   enum MyEnum {
     Thing,
   }

   #[namespace = "Structs"]
   struct MyStruct;
}

If MyEnum or MyStruct are used in properties, invokables, signals, the generated C++ code does not write ::Enums::MyEnum but MyEnum.

This needs the same logic that has been done with namespace attributes on extern blocks.

This can be implemented with #390 where we move from having a combined map to having a cxx_name map and a namespace_map. (consider making a ParserMapping struct with maps inside).

@ahayzen-kdab ahayzen-kdab self-assigned this Jan 9, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jan 9, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jan 9, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jan 9, 2023
@Be-ing Be-ing closed this as completed in 85332dc Jan 9, 2023
przempore pushed a commit to przempore/cxx-qt that referenced this issue Mar 15, 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

No branches or pull requests

2 participants