[GH-ISSUE #7] Support .NET events in Qml using signals/slots. #2

Closed
opened 2026-05-05 10:58:32 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @pauldotknopf on GitHub (Jul 15, 2018).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/7

Originally created by @pauldotknopf on GitHub (Jul 15, 2018). Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/7
Author
Owner

@pauldotknopf commented on GitHub (Jul 16, 2018):

I initially was going to fully support .NET events, but decided against it when thinking about it further.

Here is what I am thinking for the first pass.

[Signal("testSignal")]
public class TestQmlImport
{
    public TestQmlImport()
    {
        Qml.AttachToSignal(this, "testSignal", SignalRaised);
        Qml.RaiseSignal(this, "testSignal");
    }

    public void SignalRaised()
    {
        Console.WriteLine("This was raised on start, from .NET object");
        Console.WriteLine("Qml could also raised this signal if needed.");
    }
}
<!-- gh-comment-id:405345780 --> @pauldotknopf commented on GitHub (Jul 16, 2018): I initially was going to fully support .NET events, but decided against it when thinking about it further. Here is what I am thinking for the first pass. ```c# [Signal("testSignal")] public class TestQmlImport { public TestQmlImport() { Qml.AttachToSignal(this, "testSignal", SignalRaised); Qml.RaiseSignal(this, "testSignal"); } public void SignalRaised() { Console.WriteLine("This was raised on start, from .NET object"); Console.WriteLine("Qml could also raised this signal if needed."); } } ```
Author
Owner

@pauldotknopf commented on GitHub (Jul 20, 2018):

Tracking the attaching of delegates to slots via #18

<!-- gh-comment-id:406499165 --> @pauldotknopf commented on GitHub (Jul 20, 2018): Tracking the attaching of delegates to slots via #18
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#2
No description provided.