forked from sqlitebrowser/sqlitebrowser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEditDialog.h
More file actions
77 lines (62 loc) · 1.45 KB
/
EditDialog.h
File metadata and controls
77 lines (62 loc) · 1.45 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef EDITDIALOG_H
#define EDITDIALOG_H
#include <QDialog>
#include <QPersistentModelIndex>
class QHexEdit;
namespace Ui {
class EditDialog;
}
class EditDialog : public QDialog
{
Q_OBJECT
public:
explicit EditDialog(QWidget* parent = 0);
~EditDialog();
void setCurrentIndex(const QModelIndex& idx);
public slots:
virtual void setFocus();
virtual void reject();
void setReadOnly(bool ro);
void reloadSettings();
protected:
virtual void showEvent(QShowEvent* ev);
private slots:
void importData();
void exportData();
void setNull();
void updateApplyButton();
virtual void accept();
int checkDataType(const QByteArray& data);
void loadData(const QByteArray& data);
void toggleOverwriteMode();
void editModeChanged(int newMode);
void editTextChanged();
void updateCellInfo(const QByteArray& data);
QString humanReadableSize(double byteCount);
signals:
void recordTextUpdated(const QPersistentModelIndex& idx, const QByteArray& data, bool isBlob);
private:
Ui::EditDialog* ui;
QHexEdit* hexEdit;
QPersistentModelIndex currentIndex;
int dataSource;
int dataType;
bool textNullSet;
bool isReadOnly;
enum DataSources {
TextBuffer,
HexBuffer
};
enum DataTypes {
Binary,
Image,
Null,
Text
};
enum EditModes {
TextEditor = 0,
HexEditor = 1,
ImageViewer = 2
};
};
#endif