-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Expand file tree
/
Copy pathAddRecordDialog.h
More file actions
52 lines (39 loc) · 1.03 KB
/
AddRecordDialog.h
File metadata and controls
52 lines (39 loc) · 1.03 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef ADDRECORDDIALOG_H
#define ADDRECORDDIALOG_H
#include "sql/ObjectIdentifier.h"
#include <QDialog>
class DBBrowserDB;
class QTreeWidgetItem;
namespace Ui {
class AddRecordDialog;
}
class QAbstractButton;
class AddRecordDialog : public QDialog
{
Q_OBJECT
public:
explicit AddRecordDialog(DBBrowserDB& pdb, const sqlb::ObjectIdentifier& tableName, QWidget* parent = nullptr, const std::vector<std::string>& pseudo_pk = {});
~AddRecordDialog() override;
protected:
void keyPressEvent(QKeyEvent *evt) override;
private:
enum Columns {
kName = 0,
kType = 1,
kValue = 2,
};
void updateSqlText();
void populateFields();
void setDefaultsStyle(QTreeWidgetItem* item);
private slots:
void accept() override;
void itemChanged(QTreeWidgetItem* item, int column);
void help();
void buttonBoxClicked(QAbstractButton* button);
private:
Ui::AddRecordDialog* ui;
DBBrowserDB& pdb;
sqlb::ObjectIdentifier curTable;
std::vector<std::string> pseudo_pk;
};
#endif