Uploaded image for project: 'Qt Solutions'
  1. Qt Solutions
  2. QTSOLBUG-186

Windows MFC migration framework: qmfcapp::wineventFilter keypress deferring to toplevel obsolete?

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Next Major Release, Some Release
    • MFC Migration
    • None
    • Windows7 64Bit

    Description

      In qmfcapp.cpp there is a block that deals with deferring key up/down events to the toplevel HWND. This prevents a Qt dialog's shortcuts from being activated (e. g. a Buddy Label "N&ame", pressing Alt-a). Instead qmfcapp will try to delegate to the toplevel which doesn't work. It seems to me this code is completely unnecessary. All Menu actions on native toplevel windows work as expected in in Qt.5, so maybe this can be thrown out?

      {{if (widget) {
      HWND parent = (HWND)widget->winId();
      while(parent)

      { toplevel = parent; parent = GetParent(parent); }

      HMENU menu = toplevel ? GetMenu(toplevel) : 0;
      if (menu && GetFocus() == msg->hwnd) {
      if (msg->message == WM_SYSKEYUP && msg->wParam == VK_MENU)

      { // activate menubar on Alt-up and move focus away SetFocus(toplevel); SendMessage(toplevel, msg->message, msg->wParam, msg->lParam); widget->setFocus(); recursion = false; return TRUE; }

      else if (msg->message == WM_SYSKEYDOWN && msg->wParam != VK_MENU)

      { SendMessage(toplevel, msg->message, msg->wParam, msg->lParam); SendMessage(toplevel, WM_SYSKEYUP, VK_MENU, msg->lParam); recursion = false; return TRUE; }

      }
      }
      }}

      This is somewhat related to QTSOLBUG-183

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            jam Jakob Magiera
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes