MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / GetCheckState

Method GetCheckState

Src/CheckBoxHeader.cpp:45–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45Qt::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
65void CCheckBoxHeader::SetCheckable(int index, bool checkable, Qt::CheckState state)
66{

Callers

nothing calls this directly

Calls 1

isCheckableMethod · 0.80

Tested by

no test coverage detected