IContentItem* CRootItem::addContentItem(string textWoPath, CCategoryItem* parent, int posInParent) throw (ExMalformedPatch) { CItemType itemType = getItemType(textWoPath); if(posInParent == -1) { posInParent = parent->numChildren(); } beginInsertItems(posInParent, 1, parent ); IContentItem* newItem = IContentItem::itemFactory( itemType, this, textWoPath, parent, posInParent); endInsertItems(); return newItem; }
IContentItem* CRootItem::addEmptyContentItem(CItemType type, CCategoryItem* parent, int posInParent) { if (parent == 0) { parent = m_base; } if(posInParent == -1) { posInParent = parent->numChildren(); } beginInsertItems(posInParent, 1, parent ); IContentItem* newItem = IContentItem::itemFactory( type, this, parent, posInParent); endInsertItems(); return newItem; }
IContentItem* CRootItem::addContentItem(IContentItem* item, CCategoryItem* parent, int posInParent) { if(posInParent == -1) { posInParent = parent->numChildren(); } beginInsertItems(posInParent, 1, parent ); parent->addChild(item, posInParent); setContentPtr(CItemType(item->type()), item, item->getHash()); endInsertItems(); return item; }
int PlaylistModel::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QAbstractItemModel::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: beginInsertItems((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; case 1: endInsertItems(); break; case 2: beginRemoveItems((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; case 3: endRemoveItems(); break; case 4: changeItems((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; default: ; } _id -= 5; } return _id; }
void QgsDataItem::emitEndInsertItems() { emit endInsertItems(); }