Tour Preview

Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

Forums

OverviewFelgo 2 Support (Qt 5) › Connections: Cannot assign to non-existent property "onPageChanged"

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #18682

    Niyazi

    Hi,

    I am getting error on loader connection as:

    /Users/ntms/Library/Application Support/Felgo Live Client/myComponent/qml/Main.qml:16: <b>QML Connections: Cannot assign to non-existent property “onPageChanged”</b>

     

    import Felgo 3.0
    import QtQuick 2.10
    
    import "mainui"
    
    App {
        id: rootApp
    
        signal pageChanged(int page);
    
        Loader {
            id:rootLoader
            anchors.fill: parent
            source: "mainui/Page1.qml"
    
            Connections {
                target: rootLoader.item
                onPageChanged: {
                    switch(page)
                    {
                        case 1: rootLoader.source = "mainui/Page1.qml"; break;
                        case 2: rootLoader.source = "mainui/Page2.qml"; break;
                    }
                }
            }
        }
    
    } // APP
    

     

    #18687

    Marcin

    Hi Niyazi,
    I am a little confused on which signal are you trying to listen to.
    From code it looks like you want to react when mainui/Page1.qml or Page2.qml is changed.
    But you are listening to Page1.qml signal pageChanged.
    Are you sure that Page1.qml and Page2 send signal pageChanged?
    What type of object Page1/2.qml is?

    I see you added custom signal to your app pageChanged.
    If you want to react to that signal, in your Connections the target, should be: target: rootApp.

    #18691

    Niyazi
Viewing 3 posts - 1 through 3 (of 3 total)

RSS feed for this thread

You must be logged in to reply to this topic.