MCPcopy Create free account
hub / github.com/Zalafina/QKeyMapper / updateUndoRedoButtonsEnabled

Method updateUndoRedoButtonsEnabled

QKeyMapper/qmappingsequenceedit.cpp:312–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

310}
311
312void QMappingSequenceEdit::updateUndoRedoButtonsEnabled()
313{
314 if (!ui) {
315 return;
316 }
317
318 const bool canUndo = (!m_HistorySnapshots.isEmpty() && m_HistoryIndex > 0);
319 const bool canRedo = (!m_HistorySnapshots.isEmpty() && m_HistoryIndex >= 0 && m_HistoryIndex < (m_HistorySnapshots.size() - 1));
320
321 if (ui->undoButton) {
322 ui->undoButton->setEnabled(canUndo);
323 }
324 if (ui->redoButton) {
325 ui->redoButton->setEnabled(canRedo);
326 }
327}
328
329void QMappingSequenceEdit::ensureBaseSnapshotBeforeListChange()
330{

Callers

nothing calls this directly

Calls 2

isEmptyMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected