1

Getting this error message when running my QML application on Android. It's working fine in qmlscene, though.

Code looks like this:

main.qml:

ApplicationWindow {
    property Component loaderPage: LoaderPage {
        onGotoPage: changePage(page)
    }

    property Component loginPage: LoginPage {
        onGotoPage: changePage(page)
    }

    function changePage(page) {
        switch (page) {
            case "login":
                stackView.push({item: loginPage});
                break;
            default:
                print("panic!")
        }
    }

    StackView {
        id: stackView
        initialItem: loaderPage
    }
}

Page.qml:

Item {
    signal gotoPage (string page)
}

LoaderPage.qml:

Page {
    id: loaderPage

    // Triggered by some event:
    function() {
        loaderPage.gotoPage("login");
    }
}

Can anyone explain why it's complaining about a recursive call?

I'm working with QtQuick 2.3 and QtQuick.Controls 1.2.

snøreven
  • 1,904
  • 2
  • 19
  • 39
  • Please, provide ready-to-use minimal project, so everyone can test it on his side. Also, can you explain what is your function `function()` inside Page related to (is there any error with function naming)? – NG_ Feb 15 '15 at 12:40

1 Answers1

0

this error still persists in QtQuick.Controls 2.2 lower, moving to 2.5 and higher should resolve it.

imad kimouche
  • 133
  • 1
  • 1
  • 10