I can see at least one bug: the help page on
QSyntaxHighlighter
said that it has a function
virtual void highlightBlock(const QString & text) = 0;
This is the function which, by this document, keeps the class abstract, because it is
pure virtual, which is also often called
abstract function. This class is derived from
QObject
class which is non-abstract (can be considered
pseudo-abstrac), so, to have a concrete (non-abstract) class(es), you have to create a class derived from
QSyntaxHighlighter
and eventually override
QSyntaxHighlighter::highlightBlock
.
You haven't done that. Note that you just added this function:
void highlightblock(const QString &text);
This function
has nothing to do with virtual void
QSyntaxHighlighter::highlightBlock
,
it has different name.
So, you just created a brand-new non-virtual function, instead of overriding one which has to be overridden.
(I hope you know that C++ is case-sensitive; probably you simply misspelled the name.)
—SA