Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. ActiveQT and action/keyboard event
QtWS25 Last Chance

ActiveQT and action/keyboard event

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nicolas.bernard
    wrote on last edited by
    #1

    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);
    pAction->setShortcut(Qt::Key_S);
    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 )
    {
    about();
    }@

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

    Thanks by advance !
    Nicolas,

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved