Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 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.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded