[SOLVED] how to initialize a property alias in QML



  • Hey guys,

    I'm wondering if there is a way to initialize property aliases?
    e.g.

    Item {
        property alias valueDisplayVisible: valueDisplay.visible // I want this to be false by default
    
        Rectangle {
            id: valueDisplay    
        }
    }
    

    CU
    mts



  • Hi,

    you can fix the initial value of the variable

    Item {
        property alias valueDisplayVisible: valueDisplay.visible // I want this to be false by default
    
        Rectangle {
            id: valueDisplay    
            visible: false
        }
    }
    


  • Ahh, sure!
    Thanks :-)
    Didn't thought it was that easy ;-)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.