From 6100681495fe927be684fc25b74c90baa495dea2 Mon Sep 17 00:00:00 2001 From: MrWh1teF0x <142975991+MrWh1teF0x@users.noreply.github.com> Date: Tue, 30 Apr 2024 20:06:59 +0300 Subject: [PATCH] add delete button to "AddHill" menu button --- main/add_objects_forms/add_hill_form.cpp | 10 +++++++++ main/add_objects_forms/add_hill_form.h | 1 + main/add_objects_forms/add_hill_form.ui | 26 +++++++++++++++++------- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/main/add_objects_forms/add_hill_form.cpp b/main/add_objects_forms/add_hill_form.cpp index fafb810..a159536 100644 --- a/main/add_objects_forms/add_hill_form.cpp +++ b/main/add_objects_forms/add_hill_form.cpp @@ -87,3 +87,13 @@ void AddHillForm::AddNewInputFields(size_t amount) { PointLineEdits(abscissa_line_edit, ordinate_line_edit)); } } + +void AddHillForm::on_deletePushButton_clicked() { + if (both_coords_point_line_edits_.size() > 3) { + both_coords_point_line_edits_.erase(both_coords_point_line_edits_.begin() + + both_coords_point_line_edits_.size() - + 1); + point_layouts_widgets_.erase(point_layouts_widgets_.begin() + + point_layouts_widgets_.size() - 1); + } +} diff --git a/main/add_objects_forms/add_hill_form.h b/main/add_objects_forms/add_hill_form.h index e75a44c..589f80f 100644 --- a/main/add_objects_forms/add_hill_form.h +++ b/main/add_objects_forms/add_hill_form.h @@ -38,6 +38,7 @@ class AddHillForm : public QDialog { void on_createPushButton_clicked(); void on_clearPushButton_clicked(); void on_newPushButton_clicked(); + void on_deletePushButton_clicked(); private: /** diff --git a/main/add_objects_forms/add_hill_form.ui b/main/add_objects_forms/add_hill_form.ui index 3ffdbe7..fd26d36 100644 --- a/main/add_objects_forms/add_hill_form.ui +++ b/main/add_objects_forms/add_hill_form.ui @@ -6,7 +6,7 @@ 0 0 - 280 + 420 310 @@ -24,7 +24,7 @@ - 280 + 500 310 @@ -44,10 +44,10 @@ - 0 + 10 0 - 280 - 310 + 401 + 311 @@ -64,8 +64,8 @@ 0 0 - 278 - 308 + 399 + 309 @@ -111,6 +111,18 @@ QPushButton::pressed{background-color: rgb(135, 135, 135);} + + + + QPushButton::hover{background-color: rgb(184, 184, 184);border: 1px solid #6f6f6f;} +QPushButton::pressed{background-color: rgb(135, 135, 135);} + + + + Delete point + + +