RSATom / QmlVlc

[ABANDONED] libvlc wrapper for Qt Quick 2/Qml
Other
139 stars 56 forks source link

Dynamic qml creation fails #48

Closed susron closed 8 years ago

susron commented 8 years ago

Using code in javascript to dynamically create a component containing QmlVlc never calls finishCreation ( no component.statusChanged event?)

: eg

var player;
var component;
function createPlayerObjects() {
    component = Qt.createComponent("player.qml");
    if (component.status == Component.Ready)
        finishCreation();
    else
        component.statusChanged.connect(finishCreation);
}

function finishCreation() {
    if (component.status == Component.Ready) {
        player = component.createObject(root, {"x": 0, "y": 0});
        if (player == null) {
            // Error Handling
            console.log("Error creating object");
        }
    } else if (component.status == Component.Error) {
        // Error Handling
        console.log("Error loading component:", component.errorString());
    }
}
RSATom commented 8 years ago

Did you try same code but without QmlVlc in player.qml? Do you see something in debug output?

susron commented 8 years ago

my fault ... forgot to RegisterQmlVlc();

sorry

RSATom commented 8 years ago

I'm glad you solved it.