Sorting QML property based on coding convention



  • Hi,
    Does QtCreator have a tool to automatically sort Property to respect the coding convention? I know it exist for CSS language. Let's say I have:

    Image {
        source: "qrc:/Resources.png"
        fillMode: Image.PreserveAspectFit
        anchors.rightMargin: 20
        id: myId
        anchors.bottom: id.bottom
        anchors.right: id.right
        anchors.bottomMargin: 20
        width: parent.width *0.1
        MouseArea{
            anchors.fill: parent
            onClicked: {
                if(root.state=== modelData.index)
                    root.state= -1
                else
                    root.state= modelData.index
            }
        }
    }
    

    I would like to have a tool that would automatically sort the types in the file like something like this:

    Image {
        id: myId
    
        source: "qrc:/Resources.png"
        fillMode: Image.PreserveAspectFit
        width: parent.width *0.1
        anchors.bottom: id.bottom
        anchors.right: id.right
        anchors.bottomMargin: 20
        anchors.rightMargin: 20
       
        MouseArea{
            anchors.fill: parent
    
            onClicked: {
                if(root.state=== modelData.index)
                    root.state= -1
                else
                    root.state= modelData.index
            }
        }
    }
    

    Thanks!


Log in to reply