-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddElementDialog.h
More file actions
38 lines (31 loc) · 1.15 KB
/
AddElementDialog.h
File metadata and controls
38 lines (31 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once
#include "ui_AddElementWindow.h"
// Диалог добавления элемента
class AddElementDialog : public QDialog {
Q_OBJECT
public:
// Конструктор
AddElementDialog(QWidget *parent = nullptr);
// Получение единственного экземпляра класса
static AddElementDialog &getInstance(QWidget *parent = nullptr) {
static AddElementDialog *instance = new AddElementDialog(parent);
return *instance;
}
// Геттеры для номера элемента и его свойств
int getElementIndex() const { return elementIndex; }
const QStringList &getElementProperties() const {
return elementProperties;
}
private:
// Элементы интерфейса
Ui::AddElementDialog ui;
// Номер элемента
int elementIndex = -1;
// Свойства элемента
QStringList elementProperties;
private slots:
// Выбор элемента в списке
void on_elementsListWidget_itemSelectionChanged();
// Нажатие кнопки "ОК"
void on_okButton_clicked();
};