src/ChildWidget.cpp
// Delete item as undo operation of add
Delete item as undo operation of add
Delete item as undo operation of add
void ChildWidget::undoDelete(UndoItem& ui, bool bIsRedo) {
  if (DMESS > 10) qDebug() << Q_FUNC_INFO;
  selectionModel->clearSelection();
  deleteModelItemBox(ui.m_origrow);
  model->removeRow(ui.m_origrow);
  int rows = model->rowCount();
  int newfocusrow = ui.m_origrow;
  if (newfocusrow > rows)
    newfocusrow = rows;
  table->setCurrentIndex(model->index(newfocusrow, 0));
  table->setFocus();
  updateSelectionRects();
  if (bIsRedo)
    m_undostack.push(ui, false);
  else
    m_redostack.push(ui);
}
void ChildWidget :: undoDelete ( UndoItem & ui , bool bIsRedo ) { if ( DMESS > 10 ) qDebug ( ) << Q_FUNC_INFO ; selectionModel -> clearSelection ( ) ; deleteModelItemBox ( ui . m_origrow ) ; model -> removeRow ( ui . m_origrow ) ; int rows = model -> rowCount ( ) ; int newfocusrow = ui . m_origrow ; if ( newfocusrow > rows ) newfocusrow = rows ; table -> setCurrentIndex ( model -> index ( newfocusrow , 0 ) ) ; table -> setFocus ( ) ; updateSelectionRects ( ) ; if ( bIsRedo ) m_undostack . push ( ui , false ) ; else m_redostack . push ( ui ) ; }
Delete item as undo operation of add
Delete item as undo operation of add