| 238 | } |
| 239 | |
| 240 | void CFrmRecent::slotRefresh() |
| 241 | { |
| 242 | if(!m_pModel) return; |
| 243 | m_pModel->refresh(m_ParameterApp.GetRecentMenuMaxCount() << 1); |
| 244 | |
| 245 | //以下设置列宽函数必须要数据加载完成后使用,才能应用 |
| 246 | //See: https://blog.csdn.net/qq_40450386/article/details/86083759 |
| 247 | m_pTableView->resizeColumnsToContents(); //设置所有列宽度自适应内容 |
| 248 | |
| 249 | QItemSelectionModel* pSelect = m_pTableView->selectionModel(); |
| 250 | QModelIndexList lstIndex; |
| 251 | if(pSelect) |
| 252 | lstIndex = pSelect->selectedRows(); |
| 253 | if(m_pModel->rowCount() > 0 && lstIndex.isEmpty()) |
| 254 | { |
| 255 | m_pTableView->selectRow(0); |
| 256 | } |
| 257 | return; |
| 258 | } |
| 259 | |
| 260 | int CFrmRecent::InsertItem(COperate *c, QString& szFile) |
| 261 | { |
nothing calls this directly
no test coverage detected