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>
This commit is contained in:
Thiago Macieira 2013-10-03 11:54:25 -07:00 committed by Dirk Hohndel
parent f0f76056ac
commit 8e81d3f100
22 changed files with 563 additions and 572 deletions

View file

@ -6,12 +6,11 @@
#include "../helpers.h"
DiveComputerManagementDialog::DiveComputerManagementDialog(QWidget* parent, Qt::WindowFlags f): QDialog(parent, f),
ui( new Ui::DiveComputerManagementDialog()),
model(0)
{
ui->setupUi(this);
ui.setupUi(this);
init();
connect(ui->tableView, SIGNAL(clicked(QModelIndex)), this, SLOT(tryRemove(QModelIndex)));
connect(ui.tableView, SIGNAL(clicked(QModelIndex)), this, SLOT(tryRemove(QModelIndex)));
}
void DiveComputerManagementDialog::init()
@ -19,7 +18,7 @@ void DiveComputerManagementDialog::init()
if (model)
delete model;
model = new DiveComputerModel(dcList.dcMap);
ui->tableView->setModel(model);
ui.tableView->setModel(model);
}
DiveComputerManagementDialog* DiveComputerManagementDialog::instance()
@ -32,8 +31,8 @@ DiveComputerManagementDialog* DiveComputerManagementDialog::instance()
void DiveComputerManagementDialog::update()
{
model->update();
ui->tableView->resizeColumnsToContents();
ui->tableView->setColumnWidth(DiveComputerModel::REMOVE, 22);
ui.tableView->resizeColumnsToContents();
ui.tableView->setColumnWidth(DiveComputerModel::REMOVE, 22);
layout()->activate();
}