Loading...
Searching...
No Matches
GenericHighlighter Class Reference

The GenericHighlighter class provides a regexp-based programmable syntax highlighter.

`#include <generichighlighter.h>`

Inheritance diagram for GenericHighlighter:

## Classes

class | Rule
| The Rule class stores a syntax highlighting rule as a set of QRegularExpression patterns and a text format. More...

## Public Member Functions

| GenericHighlighter (QObject *parent_=nullptr)
| GenericHighlighter (const GenericHighlighter &other)
GenericHighlighter & | operator= (GenericHighlighter other)
GenericHighlighter & | operator+= (const GenericHighlighter &other)
Rule & | addRule ()
int | ruleCount () const
Rule & | rule (int idx)
const Rule & | rule (int idx) const
QList< Rule > | rules () const

## Protected Member Functions

void | highlightBlock (const QString &text) override

## Constructor & Destructor Documentation

## GenericHighlighter() [1/2]

GenericHighlighter | ( | QObject * | parent_ = nullptr | ) |

explicit

Construct a highlighter with an empty rule set.

## GenericHighlighter() [2/2]

GenericHighlighter | ( | const GenericHighlighter & | other | ) |

Construct a new highlighter using the rule set of other.

## Member Function Documentation

## operator=()

GenericHighlighter & operator= | ( | GenericHighlighter | other | ) |

Replace this highlighter's rule set with that of other.

## operator+=()

GenericHighlighter & operator+= | ( | const GenericHighlighter & | other | ) |

Concatenate other's rule set with this highlighter's rule set.

## addRule()

Rule & addRule | ( |  | ) |

Add a new rule to this highlighter, returning a reference to the new rule.

## ruleCount()

int ruleCount | ( |  | ) | const

Returns
  The number of rules in this highlighter.

## rule() [1/2]

Rule & rule | ( | int | idx | ) |

Returns
  A reference to the rule at the specified zero-based index.

## rule() [2/2]

const Rule & rule | ( | int | idx | ) | const

Returns
  A reference to the rule at the specified zero-based index.

## rules()

QList< Rule > rules | ( |  | ) | const

Returns
  An ordered list of this highlighter's rules.

The documentation for this class was generated from the following file:

- generichighlighter.h