diff options
author | Thiago Macieira <thiago@macieira.org> | 2013-10-03 11:54:25 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-10-03 12:13:48 -0700 |
commit | 8e81d3f10087fa7ac600dcb18cfebf27716c4209 (patch) | |
tree | 3f6fc136134fe7d4f14937617c29e380e7c6e124 /qt-ui/diveplanner.cpp | |
parent | f0f76056ac3982783ab3dfe94d77ba5d25e19957 (diff) | |
download | subsurface-8e81d3f10087fa7ac600dcb18cfebf27716c4209.tar.gz |
Make the classes generated by uic be real members of our classes
This means we don't have to new/delete them, which is a waste of
overhead.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r-- | qt-ui/diveplanner.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 12b2d54e9..917863968 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -855,37 +855,37 @@ void Button::mousePressEvent(QGraphicsSceneMouseEvent* event) emit clicked(); } -DivePlannerWidget::DivePlannerWidget(QWidget* parent, Qt::WindowFlags f): QWidget(parent, f), ui(new Ui::DivePlanner()) -{ - ui->setupUi(this); - ui->tableWidget->setTitle(tr("Dive Planner Points")); - ui->tableWidget->setModel(DivePlannerPointsModel::instance()); - ui->tableWidget->view()->setItemDelegateForColumn(DivePlannerPointsModel::GAS, new AirTypesDelegate(this)); - - connect(ui->tableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addStop())); - connect(ui->startTime, SIGNAL(timeChanged(QTime)), this, SLOT(startTimeChanged(QTime))); - connect(ui->ATMPressure, SIGNAL(textChanged(QString)), this, SLOT(atmPressureChanged(QString))); - connect(ui->bottomSAC, SIGNAL(textChanged(QString)), this, SLOT(bottomSacChanged(QString))); - connect(ui->decoStopSAC, SIGNAL(textChanged(QString)), this, SLOT(decoSacChanged(QString))); - connect(ui->highGF, SIGNAL(textChanged(QString)), this, SLOT(gfhighChanged(QString))); - connect(ui->lowGF, SIGNAL(textChanged(QString)), this, SLOT(gflowChanged(QString))); - connect(ui->highGF, SIGNAL(textChanged(QString)), this, SLOT(gfhighChanged(QString))); - connect(ui->lastStop, SIGNAL(toggled(bool)), this, SLOT(lastStopChanged(bool))); +DivePlannerWidget::DivePlannerWidget(QWidget* parent, Qt::WindowFlags f): QWidget(parent, f) +{ + ui.setupUi(this); + ui.tableWidget->setTitle(tr("Dive Planner Points")); + ui.tableWidget->setModel(DivePlannerPointsModel::instance()); + ui.tableWidget->view()->setItemDelegateForColumn(DivePlannerPointsModel::GAS, new AirTypesDelegate(this)); + + connect(ui.tableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addStop())); + connect(ui.startTime, SIGNAL(timeChanged(QTime)), this, SLOT(startTimeChanged(QTime))); + connect(ui.ATMPressure, SIGNAL(textChanged(QString)), this, SLOT(atmPressureChanged(QString))); + connect(ui.bottomSAC, SIGNAL(textChanged(QString)), this, SLOT(bottomSacChanged(QString))); + connect(ui.decoStopSAC, SIGNAL(textChanged(QString)), this, SLOT(decoSacChanged(QString))); + connect(ui.highGF, SIGNAL(textChanged(QString)), this, SLOT(gfhighChanged(QString))); + connect(ui.lowGF, SIGNAL(textChanged(QString)), this, SLOT(gflowChanged(QString))); + connect(ui.highGF, SIGNAL(textChanged(QString)), this, SLOT(gfhighChanged(QString))); + connect(ui.lastStop, SIGNAL(toggled(bool)), this, SLOT(lastStopChanged(bool))); // Creating the plan - connect(ui->buttonBox, SIGNAL(accepted()), plannerModel, SLOT(createPlan())); - connect(ui->buttonBox, SIGNAL(rejected()), plannerModel, SLOT(cancelPlan())); + connect(ui.buttonBox, SIGNAL(accepted()), plannerModel, SLOT(createPlan())); + connect(ui.buttonBox, SIGNAL(rejected()), plannerModel, SLOT(cancelPlan())); connect(plannerModel, SIGNAL(planCreated()), mainWindow(), SLOT(showProfile())); connect(plannerModel, SIGNAL(planCreated()), mainWindow(), SLOT(refreshDisplay())); connect(plannerModel, SIGNAL(planCanceled()), mainWindow(), SLOT(showProfile())); /* set defaults. */ - ui->startTime->setTime( QTime(1, 0) ); - ui->ATMPressure->setText( "1013" ); - ui->bottomSAC->setText("20"); - ui->decoStopSAC->setText("17"); - ui->lowGF->setText("30"); - ui->highGF->setText("75"); + ui.startTime->setTime( QTime(1, 0) ); + ui.ATMPressure->setText( "1013" ); + ui.bottomSAC->setText("20"); + ui.decoStopSAC->setText("17"); + ui.lowGF->setText("30"); + ui.highGF->setText("75"); setMinimumWidth(0); setMinimumHeight(0); |