qt获取tableview的列数
时间: 2023-11-17 13:08:27 浏览: 148
要获取QTableView的列数,可以使用以下代码:
ui->tableView->model()->columnCount();
这将返回QTableView中的列数。\[1\] \[2\]
#### 引用[.reference_title]
- *1* *3* [QT 之获得QTableView和QTableWidget的行数和列数](https://blog.csdn.net/my_angle2016/article/details/127432624)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [Qt 打印调试信息-怎样获取QTableWidget的行数和列数-读取QTableWidget表格中的数据](https://blog.csdn.net/qq_41854911/article/details/128066060)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文