Copy/Paste accelerators declared in VC++ table inactive in Qt widgets



  • Hi,

    I am working on a MFC application recently mixed with Qt 4.7.3/MFC migration framework 2.8.1.
    The MFC application resource file contains an accelerator table with standard Ctrl+C, Ctrl+V, Ctrl+X accelerators associated respectively to ID_EDIT_COPY, ID_EDIT_PASTE, ID_EDIT_CUT.
    All my Qt edition widgets derived from QLineEdit do not catch these accelerators except when there are used from a modal dialog (because Windows accelerators are not active in modal dialogs).
    After debugging inside the visible part of MFC, I found that CMDIFrameWnd::PreTranslateMessage (winmdi.cpp) calls ::TranslateAccelerator which returns TRUE and then prevents Qt from processing the keyboard message.
    If I remove these accelerators from the resource table, it works but that is not what I want because these accelerators are used in some other contexts (notably to copy/paste non-text data).

    Is this behaviour (or bug) well known or could it be a bug in my application (at MFC or Qt side)?
    And does anyone know a solution?

    Thanks in advance and regards.
    Pascal


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.