18 setAcceptRichText(
false);
20 myCompleter->setCompletionMode(QCompleter::PopupCompletion);
21 myCompleter->setCaseSensitivity(Qt::CaseInsensitive);
40 QTextEdit::keyPressEvent(e);
43 if (completionPrefix !=
myCompleter->completionPrefix()) {
45 if (!completionPrefix.isEmpty()) {
47 QRect cr = cursorRect();
48 cr.setWidth(
myCompleter->popup()->sizeHintForColumn(0) +
myCompleter->popup()->verticalScrollBar()->sizeHint().width());
55 QTextCursor tc = textCursor();
56 int extra = completion.length() -
myCompleter->completionPrefix().length();
57 tc.movePosition(QTextCursor::Left);
58 tc.movePosition(QTextCursor::EndOfWord);
59 tc.insertText(completion.right(extra));
65 int end = textCursor().position(), start = end - 1;
67 QChar
c = document()->characterAt(start);
68 if (
c ==
'.' ||
c.isLetter()) {
75 while (end < document()->characterCount()) {
76 QChar
c = document()->characterAt(end);