]> git.nothing2do.fr Git - diary-mobile.git/commitdiff
if a button has no action, the event go to the system
authorNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Tue, 15 Mar 2016 20:18:01 +0000 (21:18 +0100)
committerNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Tue, 15 Mar 2016 20:18:01 +0000 (21:18 +0100)
mainwindow.cpp

index 04af2346f2bb24f08e9264b3d9acecf10dd25f86..31b34ddcbb218947b6c455079e4224135719ff70 100644 (file)
@@ -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<QString, QString>;
     qDebug()<<"1' connect : "<<connect(signalmap, SIGNAL(mapped(const QString &)), this, SLOT(action(const QString &)));
-    //qDebug()<<"2' connect : "<<connect(this, SIGNAL(datafilled()), this, SLOT(start()));
+    qDebug()<<"2' connect : "<<connect(this, SIGNAL(datafilled()), this, SLOT(start()));
     //a desperated attempt to get the output of my cmd, i've try Qprocess (but don't get it)
     //qDebug()<<"3' connect : "<<connect(shell, SIGNAL(readyReadStandardOutput()), this, SLOT(shellReady()));
     label=new QLabel;
@@ -896,45 +896,41 @@ void MainWindow::keyReleaseEvent(QKeyEvent *event)
     if(deb)QMessageBox::information(this, trUtf8("key released", "box title to debug keyReleaseEvent"), "key : "+tmp);
     if (k==Qt::Key_Menu){
         const QString a=conf->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);
 }