0

I am writting a javascript code editor with QPlainTextEdit, and now I am workding on code completion with QCompleter.The question is I don't know which string is a variable in the plaintext.I firstly detect the variable according to the keysword,such as

var variable = "something";
class people{};

but it wouldn't work correctly when user paste serveral lines or delete multi lines, or user just delete single character of a exist "variable"

var variabl = "something";

obviously I don't want QCompleter to popup both "variable" and "variabl". any solution ? thanks a lot.

relevant question

Lichard
  • 41
  • 5
  • It mostly depends on how you manage your data-model (the one of the QCompleter), please give more details about how it is done :) I don't understand your exact question, what's not working? – ymoreau Feb 28 '19 at 08:09
  • If you don't really need to reinvent... you know, [Scintilla](https://www.scintilla.org/) is nowadays the go-to implementation for such a purpose. There is even a QScintilla, but it's license is only GPL or commercial. – catalin Mar 01 '19 at 20:12

0 Answers0