We can select multiple items(partial rows and partial columns) from QTableView using self.tableView.setSelectionMode(QAbstractItemView.ExtendedSelection)
, but after selecting some rows and columns(partial and partial) if I do CTRL+C and paste it in notepad it only pastes one item(one value from the tableView)?
My Code:
tab_table_view = QtGui.QWidget()
self.Tab.insertTab(0, tab_table_view, self.File_Name)
self.tableView = QtGui.QTableView(tab_table_view)
self.tableView.setGeometry(QtCore.QRect(0, 0, 721, 571))
self.model = QtGui.QStandardItemModel(self)
self.model.setSortRole(QtCore.Qt.UserRole)
self.tableView.setModel(self.model)
self.tableView.setSelectionMode(QAbstractItemView.ExtendedSelection) '''this helps for selecting multiple items but not able to copy and paste multiple values to a text/ excel (it only copies single value)'''
How can we do copy and paste multiple items?
.writerows(table)
throws errorTypeError: unicode argument expected, got str
now the confusing part is the variable table is a list, and its item is a list containing Unicode . – Fluxion