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/divecomputermanagementdialog.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/divecomputermanagementdialog.cpp')
-rw-r--r-- | qt-ui/divecomputermanagementdialog.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/qt-ui/divecomputermanagementdialog.cpp b/qt-ui/divecomputermanagementdialog.cpp index 946481087..77a046d1a 100644 --- a/qt-ui/divecomputermanagementdialog.cpp +++ b/qt-ui/divecomputermanagementdialog.cpp @@ -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(); } |