Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Using property alias to changes property values in separate qml files



  • Hey guys! I'm trying to change the value of a property I created in in "main.qml" from a different qml file "other.qml".
    ///////////////////////////////////
    main.qml
    ///////////////////////////////////

    ApplicationWindow {
    
    
    
        property alias mapFlags: window.mapFlag
        property alias trailFlags: window.trailFlag
        property alias logFlags: window.logFlag
        id: window
            width: 640
            height: 480
            visible: true
            title: qsTr("Stack")
            property bool trailFlag: false
            property bool mapFlag: true
            property bool logFlag: false
    

    ///////////////////////////////////
    other.qml
    ///////////////////////////////////

             onTrailClicked:
                {
                    logFLags:false
                    mapFLags:false
                    trailFLags:true
    

    Any help would be awesome, i tried to make this is as neat as possible while including all relevant info. I don't get any errors the flags just don't get set.



  • Do Assignation:
    logFLags = false
    mapFLags = false
    trailFLags= true
    Property binding wont work.


Log in to reply