diff options
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r-- | qt-ui/maintab.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index f26a72a8a..2467dd0d7 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -93,17 +93,17 @@ void MainTab::on_addWeight_clicked() return; AddWeightsystemDialog dialog(this); - weightsystem_t *newWeightsystem = (weightsystem_t *) malloc(sizeof(weightsystem_t)); - newWeightsystem->description = ""; - newWeightsystem->weight.grams = 0; + weightsystem_t newWeightsystem; + newWeightsystem.description = ""; + newWeightsystem.weight.grams = 0; - dialog.setWeightsystem(newWeightsystem); + dialog.setWeightsystem(&newWeightsystem); int result = dialog.exec(); if (result == QDialog::Rejected) return; dialog.updateWeightsystem(); - weightModel->add(newWeightsystem); + weightModel->add(&newWeightsystem); } void MainTab::on_editWeight_clicked() |