-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathScriptEdit.h
More file actions
37 lines (27 loc) · 733 Bytes
/
ScriptEdit.h
File metadata and controls
37 lines (27 loc) · 733 Bytes
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
#ifndef SCRIPTEDIT_H
#define SCRIPTEDIT_H
#include <QAbstractItemView>
#include <QStringListModel>
#include <QCompleter>
#include <QKeyEvent>
#include <QTextEdit>
class ScriptEdit : public QTextEdit
{
Q_OBJECT
public:
ScriptEdit(QWidget *parent = nullptr);
~ScriptEdit();
void setupCompleter(QObject* metaSpell);
QCompleter *completer() const;
protected:
void keyPressEvent(QKeyEvent *e);
void focusInEvent(QFocusEvent *e);
private slots:
void insertCompletion(const QString &completion);
private:
QString textUnderCursor() const;
private:
QCompleter* m_completer;
QStringListModel* m_completerModel;
};
#endif