MCPcopy Create free account
hub / github.com/Kitware/CMake / recordChange

Method recordChange

Source/QtDialog/QCMakeCacheView.cxx:702–725  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

700}
701
702void QCMakeCacheModelDelegate::recordChange(QAbstractItemModel* model,
703 QModelIndex const& index)
704{
705 QModelIndex idx = index;
706 QAbstractItemModel* mymodel = model;
707 while (qobject_cast<QAbstractProxyModel*>(mymodel)) {
708 idx = static_cast<QAbstractProxyModel*>(mymodel)->mapToSource(idx);
709 mymodel = static_cast<QAbstractProxyModel*>(mymodel)->sourceModel();
710 }
711 QCMakeCacheModel* cache_model = qobject_cast<QCMakeCacheModel*>(mymodel);
712 if (cache_model && idx.isValid()) {
713 QCMakeProperty prop;
714 idx = idx.sibling(idx.row(), 0);
715 cache_model->getPropertyData(idx, prop);
716
717 // clean out an old one
718 QSet<QCMakeProperty>::iterator iter = mChanges.find(prop);
719 if (iter != mChanges.end()) {
720 mChanges.erase(iter);
721 }
722 // now add the new item
723 mChanges.insert(prop);
724 }
725}

Callers 2

editorEventMethod · 0.95
setModelDataMethod · 0.80

Calls 5

isValidMethod · 0.80
eraseMethod · 0.80
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected