From: Norbert Moutarde Date: Tue, 15 Mar 2016 20:18:01 +0000 (+0100) Subject: if a button has no action, the event go to the system X-Git-Url: https://git.nothing2do.fr/?a=commitdiff_plain;h=1cdc3b6019da0b72b2504910160762b8404d9a6b;p=diary-mobile.git if a button has no action, the event go to the system --- diff --git a/mainwindow.cpp b/mainwindow.cpp index 04af234..31b34dd 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -64,7 +64,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) //shell=new QProcess(this);a desperated attempt to get the output of my cmd, i've try Qprocess (but don't get it) valeur=new QMap; qDebug()<<"1' connect : "<value(QString("actionmenu")).toString(); + if(a!="")accepted=true; if(a!=lastprint){ beforeactionmenu=lastprint; action(a); }else{ action(beforeactionmenu); - }; - accepted=true; }else if(k==Qt::Key_Back){ const QString a=conf->value(QString("menuback"), QString("")).toString(); + if(a!="")accepted=true; if(a!=lastprint){ beforekeyback=lastprint; action(a); }else{ action(beforekeyback); - }; - accepted=true; }else if(k==Qt::Key_VolumeDown){ qDebug()<<"keyvolumdown"; const QString a=conf->value(QString("volumdown")).toString(); + if(a!="")accepted=true; if(a!=lastprint){ beforevolumedown=lastprint; action(a); }else{ action(beforevolumedown); - }; - accepted=true; }else if(k==Qt::Key_VolumeUp){ const QString a=conf->value(QString("volumup")).toString(); + if(a!="")accepted=true; if(a!=lastprint){ beforevolumeup=lastprint; action(a); }else{ action(beforevolumeup); - }; - accepted=true; }; event->setAccepted(accepted); }