diff --git a/src/AllPlot.cpp b/src/AllPlot.cpp index 7a3e7985d..9bcb5b293 100644 --- a/src/AllPlot.cpp +++ b/src/AllPlot.cpp @@ -170,7 +170,8 @@ max(double a, double b) { if (a > b) return a; else return b; } #define MILES_PER_KM 0.62137119 #define FEET_PER_M 3.2808399 -AllPlot::AllPlot(): +AllPlot::AllPlot(QWidget *parent): + QwtPlot(parent), settings(NULL), unit(0), rideItem(NULL), diff --git a/src/AllPlot.h b/src/AllPlot.h index 23135e0bc..e8b83ac6a 100644 --- a/src/AllPlot.h +++ b/src/AllPlot.h @@ -53,7 +53,7 @@ class AllPlot : public QwtPlot QVector d_mrk; QList zoneLabels; - AllPlot(); + AllPlot(QWidget *parent); int smoothing() const { return smooth; } diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index d018a9e94..9748afe33 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -232,7 +232,7 @@ MainWindow::MainWindow(const QDir &home) : smoothSlider->maximum(), smoothLineEdit)); smoothLayout->addWidget(smoothSlider); - allPlot = new AllPlot(); + allPlot = new AllPlot(this); smoothSlider->setValue(allPlot->smoothing()); smoothLineEdit->setText(QString("%1").arg(allPlot->smoothing())); @@ -618,6 +618,8 @@ MainWindow::MainWindow(const QDir &home) : treeWidget->setCurrentItem(allRides->child(0)); } } + + setAttribute(Qt::WA_DeleteOnClose); } void