1. Get the number of rows and columns of QTableView
ui->tableView->model()->rowCount(); //行数
ui->tableView->model()->columnCount(); //列数
2. QTableWidget gets the number of rows and columns
ui->tableWidget->rowCount(); //行数
ui->tableWidget->columnCount(); //列数