[QT] How to get the number of rows and columns of QTableView and QTableWidget

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();				//列数

Guess you like

Origin blog.csdn.net/Cappuccino_jay/article/details/125945587