Go to the documentation of this file.00001 #ifndef TEXTEDIT_H
00002 #define TEXTEDIT_H
00003
00004 #include <QTextEdit>
00005 #include <Qsci/qsciscintilla.h>
00006 #include <Qsci/qscilexer.h>
00007 #include <Qsci/qscilexersql.h>
00008
00009 QT_BEGIN_NAMESPACE
00010 class QCompleter;
00011 QT_END_NAMESPACE
00012
00014 class TextEdit : public QTextEdit
00015 {
00016 Q_OBJECT
00017
00018 public:
00019 TextEdit(QWidget *parent = 0);
00020 ~TextEdit();
00021
00022 void setCompleter(QCompleter *c);
00023 QCompleter *completer() const;
00024
00025 protected:
00026 void keyPressEvent(QKeyEvent *e);
00027 void focusInEvent(QFocusEvent *e);
00028
00029 private slots:
00030 void insertCompletion(const QString &completion);
00031
00032 private:
00033 QString textUnderCursor() const;
00034
00035 private:
00036 QCompleter *c;
00037 };
00039
00040 #endif // TEXTEDIT_H
00041