FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
sqlitebrowser/src/sqltextedit.h at sqlb-3.2.x · sqlitebrowser/sqlitebrowser · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
sqlitebrowser
/
sqlitebrowser
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
2.4k
Star
24.5k
Code
Issues
825
Pull requests
17
Discussions
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
sqlitebrowser
/
src
/
sqltextedit.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
67 lines (53 loc) · 1.78 KB
Breadcrumbs
sqlitebrowser
/
src
/
sqltextedit.h
Copy path
File metadata and controls
67 lines (53 loc) · 1.78 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#
ifndef
SQLTEXTEDIT_H
#
define
SQLTEXTEDIT_H
#
include
<
QPlainTextEdit
>
class
QCompleter
;
class
QAbstractItemModel
;
/*
*
* @brief The SqlTextEdit class
* With basic table and fieldname auto completion.
* This class is based on the Qt custom completion example.
*/
class
SqlTextEdit
:
public
QPlainTextEdit
{
Q_OBJECT
public:
explicit
SqlTextEdit
(QWidget *parent =
0
);
virtual
~SqlTextEdit
();
void
setCompleter
(QCompleter* completer);
QCompleter*
completer
()
const
;
void
setDefaultCompleterModel
(QAbstractItemModel* model);
//
map that associates table -> field model
typedef
QMap<QString,QAbstractItemModel*> FieldCompleterModelMap;
QAbstractItemModel*
addFieldCompleterModel
(
const
QString& tablename, QAbstractItemModel *model);
void
insertFieldCompleterModels
(
const
FieldCompleterModelMap& fieldmap);
protected:
void
keyPressEvent
(QKeyEvent *e);
void
focusInEvent
(QFocusEvent *e);
void
resizeEvent
(QResizeEvent* event);
void
dropEvent
(QDropEvent* e);
void
lineNumberAreaPaintEvent
(QPaintEvent* event);
int
lineNumberAreaWidth
();
private:
class
LineNumberArea
:
public
QWidget
{
public:
LineNumberArea
(SqlTextEdit *editor) : QWidget(editor), parent(editor) {}
QSize
sizeHint
()
const
;
protected:
void
paintEvent
(QPaintEvent* event);
SqlTextEdit* parent;
};
LineNumberArea* lineNumberArea;
QString
identifierUnderCursor
()
const
;
private slots:
void
insertCompletion
(
const
QString& completion);
void
highlightCurrentLine
();
void
updateLineNumberAreaWidth
();
void
updateLineNumberArea
(
const
QRect& rect,
int
dy);
private:
QCompleter* m_Completer;
QAbstractItemModel* m_defaultCompleterModel;
FieldCompleterModelMap m_fieldCompleterMap;
};
#
endif
//
SQLTEXTEDIT_H
Back
|
FazBrowse Home
|
New Git URL