From: Norbert Moutarde Date: Sat, 26 Sep 2015 10:55:45 +0000 (+0200) Subject: I've reabilitate "accepted" in keyrelease X-Git-Url: https://git.nothing2do.fr/?a=commitdiff_plain;h=6914845377ccd6cb77abed1e1e4af25a9b34a9f8;p=diary-mobile.git I've reabilitate "accepted" in keyrelease --- diff --git a/mainwindow.cpp b/mainwindow.cpp index 329eb6e..4ba962a 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -838,23 +838,25 @@ void MainWindow::back(){ } void MainWindow::keyReleaseEvent(QKeyEvent *event) { - //static bool accepted=true; + static bool accepted=false; int k=event->key(); - qDebug()<<"key pressed="<value(QString("actionmenu"), QString("")).toString(); if(a!=""){ action(a); - //accepted=false; + accepted=true; } } else if(k==Qt::Key_Back){ const QString a=conf->value(QString("menuback"), QString("")).toString(); if(a!=""){ action(a); - //accepted=false; + accepted=true; } } else if(k==Qt::Key_VolumeDown){ @@ -862,17 +864,17 @@ void MainWindow::keyReleaseEvent(QKeyEvent *event) const QString a=conf->value(QString("volumdown")).toString(); if(a!=""){ action(a); - //accepted=false; + accepted=true; } } else if(k==Qt::Key_VolumeUp){ const QString a=conf->value(QString("volumup")).toString(); if(a!=""){ action(a); - //accepted=false; + accepted=true; } }; - event->setAccepted(true); + event->setAccepted(accepted); } void CLabel::SetTextToLabel(const QString& text) {