Important: Please read the Qt Code of Conduct -

How to remove a specific row from QML table

  • Hi,

    I am working with QML Tableview, I have created a model to fill data in the rows of QML Table. I am able to fill data succesfull in the table row when i press the "New row data" button, i am also able to remove the rows from the table using "Delete the row" tool button.

    Now i am facing following problems:

    I want to select the row which will be deleted by "delete the row" button, by using up and down buttons.
    So please tell me how i can select a table row entry using up and down tool button and how i can get the index of the selected row, so by pressing delete button i can delete that particular selected row from the table.

    @ToolButton {
    iconSource: "../createrow.png" "New row data"
    onClicked: {
    firstmodel.append({data1: "star", data2:"LASTNAME",data3:"NAME"})

                    tooltip: "create a new row" }
                ToolButton {
    iconSource: "../images/up.png"
    onClicked: window1.visible = !window1.visible "Go_upside in the table rows"
    tooltip: "go up" }

                ToolButton { "down"
                    iconSource: "../Down.png"
                    tooltip: Go_downside in the table rows." }
                ToolButton { "Delete the Row"
                    iconSource: "../delete.png"
                     tooltip: "go down."tooltip: "Delete the row"
                    onClicked: {

  • Moderators


    You could use "selection": properties like select and deselect on ToolButton clicked.

Log in to reply