1
0
forked from BRT/arc
arc/views/device/EditBankDialog.h
slava dd66adf455 Add bank management functionality with UI and DAO improvements
Introduce `BankSettingsWindow` for managing bank data, added `EditBankDialog` for editing bank details, and created reusable `PaddedItemDelegate` for list padding. Refactor DAO to support fetching multiple applications by device ID for improved data handling. Adjust existing components to integrate new bank-related features.
2025-05-27 14:25:33 +07:00

49 lines
1.5 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include <QDialog>
#include <QFormLayout>
#include <QLineEdit>
#include <QCheckBox>
#include <QDialogButtonBox>
// 1) Определяем диалог
class BankEditDialog : public QDialog {
Q_OBJECT
public:
explicit BankEditDialog(QWidget *parent = nullptr) : QDialog(parent) {
setWindowTitle(tr("Введите данные"));
setModal(true); // делаем его модальным
// 2) Форма с полями
auto *form = new QFormLayout(this);
firstEdit = new QLineEdit(this);
secondEdit = new QLineEdit(this);
toggle = new QCheckBox(tr("Включено"), this);
form->addRow(tr("Первое поле:"), firstEdit);
form->addRow(tr("Второе поле:"), secondEdit);
form->addRow(QString(), toggle);
// 3) Кнопки OK / Cancel
auto *buttons = new QDialogButtonBox(
QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
Qt::Horizontal,
this
);
form->addRow(buttons);
connect(buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
}
QString firstValue() const { return firstEdit->text(); }
QString secondValue() const { return secondEdit->text(); }
bool toggled() const { return toggle->isChecked(); }
private:
QLineEdit *firstEdit;
QLineEdit *secondEdit;
QCheckBox *toggle;
};