Highlights text in a QTextDocument.
#include <Workspace/Presentation/Logging/highlighting.h>
Inherits QSyntaxHighlighter.
◆ Highlighting()
◆ add()
- Parameters
-
highlighter | The highlighter to add. |
This function takes a copy of highlighter and adds it to the list held internally.
◆ enabled()
- Returns
- True if highlighting is enabled.
- See also
- setEnabled()
◆ getDefaultFormat()
QTextCharFormat & getDefaultFormat |
( |
| ) |
|
- Returns
- The default format from the TextManipulation object with which the highlighting is associated.
◆ getHighlighter()
- Parameters
-
index | The index of the highlighter to retrieve. It must refer to a valid index (no check is performed). |
- Returns
- The highlighter at the specified index. If any changes are made to the highlighter,
◆ getNumHighlighters()
unsigned getNumHighlighters |
( |
| ) |
const |
- Returns
- The number of highlighters currently defined.
◆ getTextManipulation()
◆ highlightBlock()
void highlightBlock |
( |
const QString & |
text | ) |
|
|
overrideprotected |
- Parameters
-
text | Contains the text the highlighter may have to highlight. |
highlightBlock() is called any time a contentsDirty() signal is sent from the document it is currently associated with. It will iterate through its list of individual Highlighter objects and apply them to the text if that highlighter is enabled. If this Highlighting object is itself disabled, then highlightBlock() will apply no highlighting.
◆ modified
◆ remove()
◆ setEnabled
void setEnabled |
( |
bool |
enabled | ) |
|
|
slot |
- Parameters
-
If enabled, syntax highlighting will be applied to the document according to the currently defined set of highlighting rules. Rules can be disabled individually, but the function here is a global control which can be used to disable all highlighting without disturbing the individual enabled states of each highlighter.
- See also
- getEnabled()
◆ setupContextMenu()
void setupContextMenu |
( |
QMenu * |
menu | ) |
|
- Parameters
-
menu | is the menu to use to provide highlighting options to the user |
◆ swapHighlighters()
void swapHighlighters |
( |
int |
index1, |
|
|
int |
index2 |
|
) |
| |