MCPcopy Create free account
hub / github.com/KDE/kdevelop / insertRows

Method insertRows

plugins/projectfilter/filtermodel.cpp:199–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199bool FilterModel::insertRows(int row, int count, const QModelIndex& parent)
200{
201 Q_ASSERT(!parent.isValid());
202 Q_ASSERT(count == 1);
203 if (row == -1) {
204 // after end of list and we cannot just append either as then the
205 // later setData events will fails...
206 m_ignoredLastInsert = true;
207 return false;
208 }
209 m_ignoredLastInsert = false;
210 Q_ASSERT(row >= 0 && row <= m_filters.size());
211 Q_ASSERT(row + count - 1 <= m_filters.size());
212
213 beginInsertRows(parent, row, row + count - 1);
214 for (int i = 0; i < count; ++i) {
215 m_filters.insert(row + i, SerializedFilter());
216 }
217 endInsertRows();
218 return true;
219}
220
221bool FilterModel::removeRows(int row, int count, const QModelIndex& parent)
222{

Callers 1

addMethod · 0.45

Calls 4

SerializedFilterClass · 0.85
isValidMethod · 0.45
sizeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected