コード例 #1
0
ファイル: Sheet.cpp プロジェクト: gitter-badger/qxAdm
void Sheet::insertRow(const RowId& newRowId /*= RowId()*/, const RowId& rowId /*= RowId()*/)
{
  const RowId theIdForTheNewRow = newRowId.isNull() ? RowId(QUuid::createUuid()) : newRowId;
  Q_ASSERT(!theIdForTheNewRow.isNull());

  const int index = rowId == RowId() ? m_rows.size() : findRow(rowId);
  Q_ASSERT(index >= 0);

  if (index >= 0)
  {
    m_rows.insert(index, theIdForTheNewRow);

    //initialize row
    Column* pColumn = NULL;
    foreach(pColumn, m_columns)
      pColumn->insertRow(theIdForTheNewRow, index);
  }
}