[GH-ISSUE #131] Support QQmlComponent and QuickView for interacting with QML Objects from C# #80

Closed
opened 2026-05-05 11:03:44 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @iWeaverMan on GitHub (May 13, 2019).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/131

https://doc.qt.io/qt-5/qtqml-cppintegration-interactqmlfromcpp.html

Originally created by @iWeaverMan on GitHub (May 13, 2019). Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/131 https://doc.qt.io/qt-5/qtqml-cppintegration-interactqmlfromcpp.html
Author
Owner

@pauldotknopf commented on GitHub (May 14, 2019):

I haven't actually tested a QmlComponent, but my understanding it that it is passed around as a QObject.

We support interacting with QObjects, by using the INetQObject type.

Try declaring a method with INetQObject as a parameter, and pass a QML component to it. I'd imagine that it would work.

<!-- gh-comment-id:492277484 --> @pauldotknopf commented on GitHub (May 14, 2019): I haven't actually tested a QmlComponent, but my understanding it that it is passed around as a QObject. We support interacting with QObjects, by using the INetQObject type. Try declaring a method with INetQObject as a parameter, and pass a QML component to it. I'd imagine that it would work.
Author
Owner

@pauldotknopf commented on GitHub (Jun 10, 2019):

With this:

Item {
   property int testprop: 4
}

I was able to interact with it via:

public class NetClass
{
    public void Method(INetQObject value)
    {
    }
}

Feel free to re-open if you have a repro.

<!-- gh-comment-id:500285775 --> @pauldotknopf commented on GitHub (Jun 10, 2019): With this: ```qml Item { property int testprop: 4 } ``` I was able to interact with it via: ```csharp public class NetClass { public void Method(INetQObject value) { } } ``` Feel free to re-open if you have a repro.
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#80
No description provided.