[GH-ISSUE #64] Retrieve Dotnet Signal Arguments in QML #38

Open
opened 2026-05-05 11:00:39 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @ghost on GitHub (Sep 5, 2018).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/64

Hi, thank you for this wonderful project! It's awesome!
I wonder if it's possible to retrieve signal arguments in qml without using function(..). Ex:

QmlType {
    id: test
    test.onCustomSignal: {
        console.log(myFirstSignalArg); //myFirstArg is a named signal arg
    }
}

Maybe, the Signal would have to be declared like this:

Signal("customSignal", NetVariantType.String, "myFirstSignalArg")]

Is it possible already somehow?

Originally created by @ghost on GitHub (Sep 5, 2018). Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/64 Hi, thank you for this wonderful project! It's awesome! I wonder if it's possible to retrieve signal arguments in qml without using function(..). Ex: ``` QmlType { id: test test.onCustomSignal: { console.log(myFirstSignalArg); //myFirstArg is a named signal arg } } ``` Maybe, the Signal would have to be declared like this: ``` Signal("customSignal", NetVariantType.String, "myFirstSignalArg")] ``` Is it possible already somehow?
Author
Owner

@pauldotknopf commented on GitHub (Sep 5, 2018):

I don't think it's possible.

0ebef45/src/native/QmlNet/QmlNet/types/NetSignalInfo.cpp (L43)

f62f3c0/src/native/QmlNet/QmlNet/qml/NetValueMetaObject.cpp (L30)

Qt's QMetaObjectBuilder::addSignal doesn't have much documentation, but from what I've seen, it accepts a format like MethodName(Qstring, QVariant). I'll try to see if something like MethodName(Qstring testParam1, QVariant testParam2) works, but I don't think it does.

I don't have time ATM to look at this, as I am working on getting this project backed into my embedded Linux environment. I will update this issue when I get to it.

Also, feel free to hack around and see if what I mentioned works. PR's are welcome.

<!-- gh-comment-id:418713127 --> @pauldotknopf commented on GitHub (Sep 5, 2018): I don't _think_ it's possible. https://github.com/pauldotknopf/Qml.Net/blob/0ebef45/src/native/QmlNet/QmlNet/types/NetSignalInfo.cpp#L43 https://github.com/pauldotknopf/Qml.Net/blob/f62f3c0/src/native/QmlNet/QmlNet/qml/NetValueMetaObject.cpp#L30 Qt's ```QMetaObjectBuilder::addSignal``` doesn't have much documentation, but from what I've seen, it accepts a format like ```MethodName(Qstring, QVariant)```. I'll try to see if something like ```MethodName(Qstring testParam1, QVariant testParam2)``` works, but I don't think it does. I don't have time ATM to look at this, as I am working on getting this project backed into my embedded Linux environment. I will update this issue when I get to it. Also, feel free to hack around and see if what I mentioned works. PR's are welcome.
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#38
No description provided.