Copy/Paste multiple items from QTableView in pyqt4?

后端 未结 3 915
再見小時候
再見小時候 2020-12-18 15:46

We can select multiple items(partial rows and partial columns) from QTableView using self.tableView.setSelectionMode(QAbstractItemView.ExtendedSelection), but a

3条回答
  •  攒了一身酷
    2020-12-18 16:41

    QAbstractItemView.ExtendedSelection When the user selects an item in the usual way, the selection is cleared and the new item selected. However, if the user presses the Ctrl key when clicking on an item, the clicked item gets toggled and all other items are left untouched. If the user presses the Shift key while clicking on an item, all items between the current item and the clicked item are selected or unselected, depending on the state of the clicked item. Multiple items can be selected by dragging the mouse over them. you can also use

    QAbstractItemView.MultiSelection
    

提交回复
热议问题