Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cxx-qt-gen: parse any #[property] attributes on struct fields
Later when Data and RustObj structs are merged, properties will be defined on the RustObj struct. This adds support for finding these properties in the parser phase.
- Loading branch information
1 parent
621a79f
commit bc56f89
Showing
5 changed files
with
169 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
|
||
pub mod cxxqtdata; | ||
pub mod parameter; | ||
pub mod property; | ||
pub mod qobject; | ||
pub mod signals; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com> | ||
// SPDX-FileContributor: Andrew Hayzen <andrew.hayzen@kdab.com> | ||
// | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
|
||
use syn::{Ident, Type, Visibility}; | ||
|
||
/// Describes a single property for a struct | ||
pub struct ParsedProperty { | ||
/// The [syn::Ident] of the property | ||
pub ident: Ident, | ||
/// The [syn::Type] of the property | ||
pub ty: Type, | ||
/// The [syn::Visiblity] of the property | ||
pub vis: Visibility, | ||
// TODO: later this will describe if the property has an attribute | ||
// stating that the a conversion in C++ needs to occur (eg UniquePtr<T> to T).. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters