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 :

Qt Code:
  1. QAction *pAction = new QAction(tr("&test action..."), this);
  2. pAction->setShortcut(Qt::Key_S);
  3. connect(pAction, SIGNAL(triggered()), this, SLOT(about()));
  4. setContextMenuPolicy( Qt::ActionsContextMenu );
To copy to clipboard, switch view to plain text mode 
Action will never be triggered by S key. Testing with stupid keypressevent implementation is never called :

Qt Code:
  1. virtual void keyPressEvent ( QKeyEvent * event )
  2. {
  3. about();
  4. }
To copy to clipboard, switch view to plain text mode 
Do you have an idea to solve those two issue ? issues are the same in internet explorer 8 or testcontainer

Thanks by advance !

Need to add.

App is well refreshing when set in out-process.
I resolved a part of the keyboard by setting a windows hook, parse vk key and doing QApplication::sendEvent(...) to the widget. But QAction shortcut are not triggered.

Question, is there a way to use the QKeyMapper_private to convert windows virtual key to Qt::KeyEvent ?

Thanks again...