Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Undo/redo shortcuts
Qt 6.11 is out! See what's new in the release blog

Undo/redo shortcuts

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rivierakid
    wrote on last edited by
    #1

    Hi, I would like to implement an undo/redo mechanism into my app. I have created the stack:

    @m_undoStack = new QUndoStack(this);
    m_undoAction = m_undoStack->createUndoAction(this, QApplication::translate("MainWindowClass", "Undo"));
    m_undoAction->setShortcut(QKeySequence::Undo);
    ui.menuEdit->addAction(m_undoAction);
    /// ...@

    When the user choose "Undo" from app menu (or Ctrl+Z), it is working correctly. But if a QSpinBox has focus, then Ctrl+Z does nothing. It looks like that the spin box "has eaten" the shorcut.
    Thats very annoying...

    Any solution?
    Thanks

    Qt 5.1.0, MSVC 2012 x64

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rivierakid
      wrote on last edited by
      #2

      I can use an eventFilter for Ctrl+Z, but is there any better posibility?

      1 Reply Last reply
      0
      • P Offline
        P Offline
        poorBob
        wrote on last edited by
        #3

        [deleted] Sorry I didn't notice You answer...

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved