25 Q_PROPERTY(SyntaxState syntaxState READ syntaxState)
29 enum SyntaxState { Empty, Busy, Invalid, Deprecated, Valid };
31 SyntaxState syntaxState()
const {
return syntax_state_; }
32 void setSyntaxState(SyntaxState state = Empty);
33 QString syntaxErrorMessage();
35 QString syntaxErrorMessageFull();
36 QString styleSheet()
const;
37 QString deprecatedToken();
39 void setCompleter(QCompleter *c);
40 QCompleter *completer()
const {
return completer_; }
41 void allowCompletion(
bool enabled);
43 static QString createSyntaxErrorMessageFull(
const QString &filter,
44 const QString &err_msg,
45 qsizetype loc_start,
size_t loc_length);
48 void setStyleSheet(
const QString &style_sheet);
50 void insertFilter(
const QString &filter);
53 bool checkDisplayFilter(QString filter);
54 void checkFieldName(QString field);
55 void checkCustomColumn(QString fields);
56 void checkInteger(QString number);
59 QCompleter *completer_;
60 QStringListModel *completion_model_;
61 void setCompletionTokenChars(
const QString &token_chars) { token_chars_ = token_chars; }
62 bool isComplexFilter(
const QString &filter);
63 virtual void buildCompletionList(
const QString &field_word,
const QString &preamble) { Q_UNUSED(field_word); Q_UNUSED(preamble); }
65 QPoint getTokenUnderCursor();
67 QStringList splitLineUnderCursor();
69 virtual bool event(QEvent *event);
70 void completionKeyPressEvent(QKeyEvent *event);
71 void completionFocusInEvent(QFocusEvent *event);
72 virtual void focusOutEvent(QFocusEvent *event);
73 virtual void paintEvent(QPaintEvent *event);
76 SyntaxState syntax_state_;
78 QString state_style_sheet_;
79 QString syntax_error_message_;
80 QString syntax_error_message_full_;
82 bool completion_enabled_;
85 void insertFieldCompletion(
const QString &completion_text);