keyPressEvent QKeyEvent => lose keys / don't get all the events / running QMovie
-
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