Call function from frame in other QML file



  • How can i call a function from another file ?
    My Pyotherside Handler is executed for sure, but my function "antwortGetDialogs" isn't executed...

    I removed everything that isn't important for my question.
    Hope someone can help me

    this is my Main.qml :

    import QtQuick 2.2
    import io.thp.pyotherside 1.2
    import QtQuick.Controls 1.1

    ApplicationWindow {
    id: mainWindow

    StackView {
        id: view
        initialItem: frameDialogs
        anchors.fill: parent
    
        Component {
            id: frameDialogs
            Dialogs {id: dialogsWindow}
        }
    }
    
    Python {
        id: python
        Component.onCompleted: {
            addImportPath(Qt.resolvedUrl('./'));
            importModule('Main', function () {});
    
            setHandler("antwortGetDialogs", frameDialogs.Dialogs.antwortGetDialogs);
        }
    }
    

    }

    my Dialogs.qml :

    import QtQuick 2.2
    import io.thp.pyotherside 1.2
    import QtQuick.Controls 1.1

    Rectangle {
    id: window

    function antwortGetDialogs(item) {
        console.warn("func antwortGetDialogs")
    }
    

    }


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.