Qt 的tableview对象有多种选择方式,知道某行或者列可以使用selectrow(int i)或者selectcolumn(int i)选中具体的行与列。
若想选择i行j列的格,需要先获取此cell的model index,使用setcurrentindex( index),选中某cell。
若想同时选中多个cell,需要将选择模式设置为multiselection,选择后再设置为其它需要的模式。
Qt 的tableview对象有多种选择方式,知道某行或者列可以使用selectrow(int i)或者selectcolumn(int i)选中具体的行与列。
若想选择i行j列的格,需要先获取此cell的model index,使用setcurrentindex( index),选中某cell。
若想同时选中多个cell,需要将选择模式设置为multiselection,选择后再设置为其它需要的模式。