src/model.h

changeset 81
62373840e33a
parent 76
7c4a63a02632
child 111
1f42c03fafca
equal deleted inserted replaced
80:764381756899 81:62373840e33a
133 QModelIndex index = this->lookup(id); 133 QModelIndex index = this->lookup(id);
134 if (index_out != nullptr) 134 if (index_out != nullptr)
135 { 135 {
136 *index_out = index; 136 *index_out = index;
137 } 137 }
138 return static_cast<const R*>(this->objectAt(index)); 138 if (index.isValid())
139 {
140 return static_cast<const R*>(this->objectAt(index));
141 }
142 else
143 {
144 return nullptr;
145 }
139 } 146 }

mercurial