[GH-ISSUE #194] Support for 'default' properties? #127

Open
opened 2026-05-05 11:06:01 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @DeanThomas1983 on GitHub (Apr 22, 2020).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/194

Hi, I've been watching this project for quite a while and it looks like a great solution to cross platform GUIs for C#. One thing I'm particulary interested in is being able to create a generic QML documents for use with C++, Python (PySide2), and C# models.

One thing I've not been able to work out so far with qml.net is if there is support for defining a 'default' property in a C# model. In C++ this would be achieved using:
Q_CLASSINFO("DefaultProperty", "content")

Is there any way to do this currently in qml.net? I'd guess you could use an attribute to define a default property, but wasn't able to see anything within the sources. This seems like a similar open issue: https://github.com/qmlnet/qmlnet/issues/84

If it isn't currently possible, I'd be interested in giving it a go.

Originally created by @DeanThomas1983 on GitHub (Apr 22, 2020). Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/194 Hi, I've been watching this project for quite a while and it looks like a great solution to cross platform GUIs for C#. One thing I'm particulary interested in is being able to create a generic QML documents for use with C++, Python (PySide2), and C# models. One thing I've not been able to work out so far with qml.net is if there is support for defining a 'default' property in a C# model. In C++ this would be achieved using: `Q_CLASSINFO("DefaultProperty", "content")` Is there any way to do this currently in qml.net? I'd guess you could use an attribute to define a default property, but wasn't able to see anything within the sources. This seems like a similar open issue: https://github.com/qmlnet/qmlnet/issues/84 If it isn't currently possible, I'd be interested in giving it a go.
Author
Owner

@pauldotknopf commented on GitHub (Apr 22, 2020):

That isn't currently supported.

How would it look? Something like this?

[ClassInfo("Prop", "Value")]
public class NetClass
{
}
<!-- gh-comment-id:617735005 --> @pauldotknopf commented on GitHub (Apr 22, 2020): That isn't currently supported. How would it look? Something like this? ```csharp [ClassInfo("Prop", "Value")] public class NetClass { } ```
Author
Owner

@DeanThomas1983 commented on GitHub (Apr 22, 2020):

Yeah, that was the way I was thinking it could work. I'll look into pulling the code to see if I can work out how it would be implemented.

<!-- gh-comment-id:617774596 --> @DeanThomas1983 commented on GitHub (Apr 22, 2020): Yeah, that was the way I was thinking it could work. I'll look into pulling the code to see if I can work out how it would be implemented.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/qmlnet#127
No description provided.