Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Call function from frame in other QML file
Qt 6.11 is out! See what's new in the release blog

Call function from frame in other QML file

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 641 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BlueKenny
    wrote on last edited by BlueKenny
    #1

    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")
    }
    

    }

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved