| 241 | } |
| 242 | |
| 243 | void CFrmActive::slotAddToFavorite() |
| 244 | { |
| 245 | QItemSelectionModel* pSelect = m_pTableView->selectionModel(); |
| 246 | QModelIndexList lstIndex = pSelect->selectedRows(); |
| 247 | foreach(auto index, lstIndex) |
| 248 | { |
| 249 | if(!index.isValid()) continue; |
| 250 | QVariant v = m_pModel->item(index.row(), m_nId)->data(); |
| 251 | COperate* c = v.value<COperate*>(); |
| 252 | if(!c) continue; |
| 253 | QString szName = c->Name(); |
| 254 | QIcon icon = c->Icon(); |
| 255 | QString szDescription = c->Description(); |
| 256 | QString szFile = c->GetSettingsFile(); |
| 257 | emit sigAddToFavorite(szFile, szName, szDescription, icon); |
| 258 | } |
| 259 | } |