ActiveQT and action/keyboard event

  • Hello,

    I have a application (based on a QMainWindow) using QAction with shortcut.
    I convert this QWidget so that I can use it as a COM object. Everything works great EXCEPT two things :

    • refresh : as it is a video player, I need to update the timecode (displayed in a QLineEdit) every times a new frame is displayed. QWidget is setted to the correct value, but there is no visual update. UIUpdate append around every 500ms or everytimes my mouse move over the widget. I try to force update (with update() method, or by doing a sendMessage( ..., WM_PAINT, NULL, NULL ) on the QWidget windows handle, and on the QAxContainer windows handle but refresh is not done.

    • keyboard event (and then QAction). Qaction are not triggered, KeyPressEvent() is never called. If I give focus to the QLineEdit, then keyboard is working, but if I give focus to the QMainWindow (or other control), no keyboard event is received.

    This can be reproduced with the QSimpleAx sample. In the sample sample, simply add an action :
    @QAction *pAction = new QAction(tr("&test action..."), this);
    connect(pAction, SIGNAL(triggered()), this, SLOT(about()));
    setContextMenuPolicy( Qt::ActionsContextMenu );@

    Action will never be triggered by S key. Testing with stupid keypressevent implementation is never called :
    @virtual void keyPressEvent ( QKeyEvent * event )

    Do you have an idea to solve those two issue ? issues are the same in internet explorer 8 or testcontainer

    Thanks by advance !

Log in to reply