delete main window on close

...and set AllPlot's parent so that it gets deleted, too.
This commit is contained in:
Sean Rhea
2009-09-20 21:34:27 -07:00
parent 0cbe39e834
commit bc16f3d0a4
3 changed files with 6 additions and 3 deletions

View File

@@ -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),

View File

@@ -53,7 +53,7 @@ class AllPlot : public QwtPlot
QVector<QwtPlotMarker*> d_mrk;
QList <AllPlotZoneLabel *> zoneLabels;
AllPlot();
AllPlot(QWidget *parent);
int smoothing() const { return smooth; }

View File

@@ -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