G keypress event would cause a crash if no data
Q keypress didn't work.
Thanks to @iceman1001 for identifying and providing the fixes.
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;
}
CursorBPos = 0;
setWindowTitle(tr("Sliders"));
+
+ master = parent;
}
void Plot::closeEvent(QCloseEvent *event)
break;
case Qt::Key_Q:
- this->hide();
+ master->hide();
break;
default:
class Plot: public QWidget
{
private:
+ QWidget *master;
int GraphStart;
double GraphPixelsPerPoint;
int CursorAPos;