Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-4773

Creator keyboard shortcuts need to be created as WindowShortcuts by default, not ApplicationShortcuts

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • Qt Creator 2.3.0
    • All Other Issues
    • None

      At the moment most Creator keyboard shortcuts are created with Qt::ApplicationShortcut ShortcutContext. Since most of Creator is in a single window interface, this doesn't really matter much. However muxcons (http://muxcons.sf.net) opens a separate window for talking to fshell, and has its own shortcuts, so it suddenly matters to get the contexts right. Because the ActionManager creates all its shortcuts with Qt::ApplicationShortcut context, muxcons is unable to for example use Ctrl-Tab to switch between fshell tabs - pressing Ctrl-Tab while the muxcons window is frontmost still pops up the editor file switch dialog.

      I've tested the following change:

      diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.cpp b/src/plugins/coreplugin/actionmanager/actionmanager
      index 48c46a8..ddd6a9c 100644
      --- a/src/plugins/coreplugin/actionmanager/actionmanager.cpp
      +++ b/src/plugins/coreplugin/actionmanager/actionmanager.cpp
      @@ -371,7 +371,7 @@ Action *ActionManagerPrivate::overridableAction(const Id &id)
               m_idCmdMap.insert(uid, a);
               m_mainWnd->addAction(a->action());
               a->action()->setObjectName(id);
      -        a->action()->setShortcutContext(Qt::ApplicationShortcut);
      +        a->action()->setShortcutContext(Qt::WindowShortcut);
               a->setCurrentContext(m_context);
           }
      

      Which seems to fix ctrl-tab and all the other shortcut keys that muxcons uses, and doesn't cause any problems for the rest of the UI as far as I can see.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            con Eike Ziller
            tomsci Tom Sutcliffe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes