Pages
API Documentation
On this page

KSyntaxHighlighting::SyntaxHighlighter Class

A QSyntaxHighlighter implementation for use with QTextDocument. This supports partial re-highlighting during editing and tracks syntax-based code folding regions. More...

List of all members, including inherited members

Public Functions

Detailed Description

Member Function Documentation

[explicit] SyntaxHighlighter::SyntaxHighlighter(QObject *parent = nullptr)

[explicit] SyntaxHighlighter::SyntaxHighlighter(QTextDocument *document)

QTextBlock SyntaxHighlighter::findFoldingRegionEnd(const QTextBlock &startBlock) const

Finds the end of the folding region starting at startBlock. If multiple folding regions begin at startBlock, the end of the last/innermost one is returned. This returns an invalid block if no folding region end is found, which typically indicates an unterminated region and thus folding until the document end. This method performs a sequential search starting at startBlock for the matching folding region end, which is a potentially expensive operation.

See also startsFoldingRegion

bool SyntaxHighlighter::startsFoldingRegion(const QTextBlock &startBlock) const

Returns whether there is a folding region beginning at startBlock. This only considers syntax-based folding regions, not indention-based ones as e.g. found in Python.

See also findFoldingRegionEnd

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.