mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-20 21:33:19 -07:00
fix gui (plot) bugs (#604)
G keypress event would cause a crash if no data Q keypress didn't work. Thanks to @iceman1001 for identifying and providing the fixes.
This commit is contained in:
parent
0000a4cda2
commit
e8924be8ba
2 changed files with 5 additions and 1 deletions
|
@ -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:
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
class Plot: public QWidget
|
||||
{
|
||||
private:
|
||||
QWidget *master;
|
||||
int GraphStart;
|
||||
double GraphPixelsPerPoint;
|
||||
int CursorAPos;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue