src/ChildWidget.cpp
// Put replaced rows back to original location
Put replaced rows back to original location
Put replaced rows back to original location
void ChildWidget::undoMoveBack(UndoItem& ui, bool bIsRedo) {
  if (DMESS > 10) qDebug() << Q_FUNC_INFO;
  int firstrow = ui.m_origrow;
  int secondrow = ui.m_extrarow;
  if (bIsRedo) {
    firstrow = ui.m_extrarow;
    secondrow = ui.m_origrow;
  }
  for (int i = 0; i < model->columnCount() - 1; i++) {
    model->setData(model->index(firstrow, i), ui.m_vdata[i]);
    model->setData(model->index(secondrow, i), ui.m_vextradata[i]);
  }
  updateModelItemBox(ui.m_origrow);
  updateModelItemBox(ui.m_extrarow);
  table->setCurrentIndex(model->index(firstrow, 0));
  table->setFocus();
  updateSelectionRects();
  if (bIsRedo)
    m_undostack.push(ui, false);
  else
    m_redostack.push(ui);
}
void ChildWidget :: undoMoveBack ( UndoItem & ui , bool bIsRedo ) { if ( DMESS > 10 ) qDebug ( ) << Q_FUNC_INFO ; int firstrow = ui . m_origrow ; int secondrow = ui . m_extrarow ; if ( bIsRedo ) { firstrow = ui . m_extrarow ; secondrow = ui . m_origrow ; } for ( int i = 0 ; i < model -> columnCount ( ) - 1 ; i ++ ) { model -> setData ( model -> index ( firstrow , i ) , ui . m_vdata [ i ] ) ; model -> setData ( model -> index ( secondrow , i ) , ui . m_vextradata [ i ] ) ; } updateModelItemBox ( ui . m_origrow ) ; updateModelItemBox ( ui . m_extrarow ) ; table -> setCurrentIndex ( model -> index ( firstrow , 0 ) ) ; table -> setFocus ( ) ; updateSelectionRects ( ) ; if ( bIsRedo ) m_undostack . push ( ui , false ) ; else m_redostack . push ( ui ) ; }
Put replaced rows back to original location
Put replaced rows back to original location