Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. keyPressEvent QKeyEvent => lose keys / don't get all the events / running QMovie
Forum Updated to NodeBB v4.3 + New Features

keyPressEvent QKeyEvent => lose keys / don't get all the events / running QMovie

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
1 Posts 1 Posters 121 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.
  • S Offline
    S Offline
    Salvator
    wrote on last edited by Salvator
    #1

    Hi @all,
    I connect a BC-Code scanner to my Raspberry PI, when I scan, the data will arrived in the app as keyevent. That is working fine untill I start QMovie, when the movie (it is a small .gif about 100kb) is running I don't get all keys.
    The lost keys can be at begining, in the middle or at the end of the reading code.

    I catch the keys in the application::notify() - event, so I hoped to get all keyevents, also the focus will change between the widgets.

    bool CMyApp::notify(QObject *receiver, QEvent *event)
    {
      try
      {
        if (event->type() == QEvent::KeyPress)
        {
          QKeyEvent * keyevent = dynamic_cast<QKeyEvent *>(event);
          qDebug() << "keycode GO text >>" << keyevent->text();
          qDebug() << "keycode GO key >>" << keyevent->key();
          pMainWindow->MyKeyEvent(keyevent);
          return(true);
          ...
    

    the QMovie I start like this

    if(pDisplayStart->psMovie == nullptr)
    {
      pDisplayStart->psMovie = new QMovie(":/Animation/Test.gif");
    }
    pDisplayStart->psMovie->setSpeed(80);
    pDisplayStart->ui->label1->setMovie(pDisplayStart->psMovie);
    pDisplayStart->psMovie->start();
    

    What can I do to get all the keyevents?
    When the QMovie is stopped so I get all keys again.
    Thank you for helping hand.

    kind regards
    Salva

    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