]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/proxguiqt.cpp
fix gui (plot) bugs (#604)
[proxmark3-svn] / client / proxguiqt.cpp
index dc8279b52ec340596c6420deb94634c561bd7457..ab0976cceb4442e3b157bbc1403ff1b18721329a 100644 (file)
@@ -269,6 +269,7 @@ int Plot::xCoordOf(int i, QRect r )
 int Plot::yCoordOf(int v, QRect r, int maxVal)
 {
        int z = (r.bottom() - r.top())/2;
+       if ( maxVal == 0 ) maxVal++;
        return -(z * v) / maxVal + z;
 }
 
@@ -579,6 +580,8 @@ Plot::Plot(QWidget *parent) : QWidget(parent), GraphStart(0), GraphPixelsPerPoin
        CursorBPos = 0;
 
        setWindowTitle(tr("Sliders"));
+
+       master = parent;
 }
 
 void Plot::closeEvent(QCloseEvent *event)
@@ -688,7 +691,7 @@ void Plot::keyPressEvent(QKeyEvent *event)
                        break;
 
                case Qt::Key_Q:
-                       this->hide();
+                       master->hide();
                        break;
 
                default:
Impressum, Datenschutz