| 43 | } |
| 44 | |
| 45 | Qt::CheckState CCheckBoxHeader::GetCheckState(int index) const |
| 46 | { |
| 47 | QStandardItemModel* pModel = qobject_cast<QStandardItemModel*>(this->model()); |
| 48 | if(pModel) { |
| 49 | QStandardItem* item = nullptr; |
| 50 | if(orientation() == Qt::Horizontal) |
| 51 | item = pModel->horizontalHeaderItem(index); |
| 52 | else |
| 53 | item = pModel->verticalHeaderItem(index); |
| 54 | if(item && item->isCheckable()) { |
| 55 | return item->checkState(); |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | auto it = m_CheckableSections.find(index); |
| 60 | if(m_CheckableSections.end() == it) |
| 61 | return Qt::Unchecked; |
| 62 | return *it; |
| 63 | } |
| 64 | |
| 65 | void CCheckBoxHeader::SetCheckable(int index, bool checkable, Qt::CheckState state) |
| 66 | { |
nothing calls this directly
no test coverage detected