mirror of
https://github.com/qmlnet/qmlnet.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #101] Added interfaces to get notifications when a component is created/destroyed. #57
Labels
No labels
bug
enhancement
help wanted
help wanted
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/qmlnet#57
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pauldotknopf on GitHub (Dec 27, 2018).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/101
This will allow people to perform initialization, attach/deattach event handlers, etc.
@MaxMommersteeg commented on GitHub (Dec 27, 2018):
Would be of great value when added to Qml.Net. For my projects I currently add an
Initializefunction for all .NET types so I can call it manually from QML. Which feels a bit hacky.Currently scanning the code and am really curious on how you would add functionality like this.
One way might be leveraging QML's inheritance functionality. We could wrap every custom .NET object in a base QML type that does the following part:
@pauldotknopf commented on GitHub (Dec 27, 2018):
It would have to be done in
NetValueType<N>, which services as the entry point of created .NET types in QML. See here.But yeah, it looks like it might be difficult to attach to those specific signals without the user of private headers.
I posed the question of the Qt Forums here.
If that doesn't pan out, we should just use
NetValueType::NetValueTypeandNetValueType::~NetValueTypeand rename the above interfaces to indicate that they are just the constructor/deconstructor of the wrapping native type.@MaxMommersteeg commented on GitHub (Mar 6, 2019):
Does
dd79428e86mean this is ready? Would love to try this out on my so-called "controllers" to get rid of uglyInitializefunctions.@pauldotknopf commented on GitHub (Mar 6, 2019):
Yup. It isn't released yet though, you'd have to build from the latest bits.