forked from sqlitebrowser/sqlitebrowser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEditTableDialog.h
69 lines (56 loc) · 1.4 KB
/
EditTableDialog.h
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef EDITTABLEDIALOG_H
#define EDITTABLEDIALOG_H
#include "sqlitetypes.h"
#include <QDialog>
class DBBrowserDB;
class QTreeWidgetItem;
namespace Ui {
class EditTableDialog;
}
class EditTableDialog : public QDialog
{
Q_OBJECT
public:
explicit EditTableDialog(DBBrowserDB* pdb, const QString& tableName, bool createTable, QWidget* parent = 0);
~EditTableDialog();
protected:
void keyPressEvent(QKeyEvent *evt);
private:
enum Columns {
kName = 0,
kType = 1,
kNotNull = 2,
kPrimaryKey = 3,
kAutoIncrement = 4,
kUnique = 5,
kDefault = 6,
kCheck = 7,
kForeignKey = 8
};
void updateColumnWidth();
void updateSqlText();
void moveCurrentField(bool down);
private slots:
virtual void populateFields();
virtual void addField();
virtual void removeField();
virtual void fieldSelectionChanged();
virtual void accept();
virtual void reject();
virtual void checkInput();
virtual void itemChanged(QTreeWidgetItem* item, int column);
virtual void updateTypes();
virtual void moveUp();
virtual void moveDown();
virtual void setWithoutRowid(bool without_rowid);
private:
Ui::EditTableDialog* ui;
DBBrowserDB* pdb;
QString curTable;
sqlb::Table m_table;
QStringList types;
QStringList fields;
bool m_bNewTable;
QString m_sRestorePointName;
};
#endif