49 {
50
51 ui->gridLayout->removeItem(
ui->buttonsLayout);
52 ui->gridLayout->addItem(
53 ui->buttonsLayout,
ui->gridLayout->count() +
static_cast<int>(amount), 0);
54
55
56 auto old_size =
ui->gridLayout->count() - 1;
57 auto new_size =
ui->gridLayout->count() - 1 + amount;
58
59 for (size_t i = old_size; i < new_size; i++) {
60
63 "LayoutWidget");
66 static_cast<int>(i), 0);
67
68
69 QDoubleValidator* double_validator{new QDoubleValidator()};
70
71
72 QLabel* point_label = new QLabel(this);
73 point_label->setObjectName("point" + QString::number(i + 1) + "Label");
74 point_label->setText("Point " + QString::number(i + 1) + ":");
76
77
78 QLabel* abscissa_label = new QLabel(this);
79 abscissa_label->setObjectName("abscissa" + QString::number(i + 1) +
80 "Label");
81 abscissa_label->setText("X:");
83
84 QLineEdit* abscissa_line_edit = new QLineEdit(this);
85 abscissa_line_edit->setValidator(double_validator);
86 abscissa_line_edit->setObjectName("abscissa" + QString::number(i + 1) +
87 "LineEdit");
89
90
91 QLabel* ordinate_label = new QLabel(this);
92 ordinate_label->setObjectName("ordinate" + QString::number(i + 1) +
93 "Label");
94 ordinate_label->setText("Y:");
96
97 QLineEdit* ordinate_line_edit = new QLineEdit(this);
98 ordinate_line_edit->setValidator(double_validator);
99 ordinate_line_edit->setObjectName("ordinate" + QString::number(i + 1) +
100 "LineEdit");
102
103
106 }
107}
Структура из двух QLineEdit, относящихся к вводу координаты точки (чтобы не использовать std::pair<st...
Definition add_hill_form.h:24