Qt
6.x
The Qt SDK
Loading...
Searching...
No Matches
qsyntaxhighlighter.h
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4
#ifndef QSYNTAXHIGHLIGHTER_H
5
#define QSYNTAXHIGHLIGHTER_H
6
7
#include <QtGui/qtguiglobal.h>
8
9
#ifndef QT_NO_SYNTAXHIGHLIGHTER
10
11
#include <QtCore/qobject.h>
12
#include <QtGui/qtextobject.h>
13
14
QT_BEGIN_NAMESPACE
15
16
17
class
QTextDocument
;
18
class
QSyntaxHighlighterPrivate
;
19
class
QTextCharFormat
;
20
class
QFont
;
21
class
QColor
;
22
class
QTextBlockUserData
;
23
24
class
Q_GUI_EXPORT
QSyntaxHighlighter
:
public
QObject
25
{
26
Q_OBJECT
27
Q_DECLARE_PRIVATE(
QSyntaxHighlighter
)
28
public
:
29
explicit
QSyntaxHighlighter
(
QObject
*
parent
);
30
explicit
QSyntaxHighlighter
(
QTextDocument
*
parent
);
31
~QSyntaxHighlighter
();
32
33
void
setDocument(
QTextDocument
*doc);
34
QTextDocument
*document()
const
;
35
36
public
Q_SLOTS
:
37
void
rehighlight();
38
void
rehighlightBlock(
const
QTextBlock
&block);
39
40
protected
:
41
virtual
void
highlightBlock
(
const
QString
&
text
) = 0;
42
43
void
setFormat
(
int
start
,
int
count
,
const
QTextCharFormat
&
format
);
44
void
setFormat
(
int
start
,
int
count
,
const
QColor
&
color
);
45
void
setFormat
(
int
start
,
int
count
,
const
QFont
&
font
);
46
QTextCharFormat
format
(
int
pos
)
const
;
47
48
int
previousBlockState()
const
;
49
int
currentBlockState()
const
;
50
void
setCurrentBlockState(
int
newState
);
51
52
void
setCurrentBlockUserData(
QTextBlockUserData
*
data
);
53
QTextBlockUserData
*currentBlockUserData()
const
;
54
55
QTextBlock
currentBlock()
const
;
56
57
private
:
58
Q_DISABLE_COPY(
QSyntaxHighlighter
)
59
Q_PRIVATE_SLOT
(d_func(),
void
_q_reformatBlocks(
int
from,
int
charsRemoved,
int
charsAdded))
60
Q_PRIVATE_SLOT
(d_func(),
void
_q_delayedRehighlight())
61
};
62
63
QT_END_NAMESPACE
64
65
#endif
// QT_NO_SYNTAXHIGHLIGHTER
66
67
#endif
// QSYNTAXHIGHLIGHTER_H
QColor
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition
qcolor.h:31
QFont
\reentrant
Definition
qfont.h:20
QObject
\inmodule QtCore
Definition
qobject.h:90
QString
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition
qstring.h:127
QSyntaxHighlighterPrivate
Definition
qsyntaxhighlighter.cpp:23
QSyntaxHighlighter
\reentrant \inmodule QtGui
Definition
qsyntaxhighlighter.h:25
QSyntaxHighlighter::highlightBlock
virtual void highlightBlock(const QString &text)=0
Highlights the given text block.
QTextBlockUserData
\reentrant
Definition
qtextobject.h:151
QTextBlock
\reentrant
Definition
qtextobject.h:157
QTextCharFormat
\reentrant
Definition
qtextformat.h:382
QTextDocument
\reentrant \inmodule QtGui
Definition
qtextdocument.h:57
setFormat
widget setFormat(format)
text
QString text
Definition
doc_src_properties.cpp:102
newState
void newState(QList< State > &states, const char *token, const char *lexem, bool pre)
Definition
generate_keywords.cpp:280
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1545
color
Definition
qssgutils_p.h:103
count
GLenum GLenum GLsizei count
Definition
qopengles2ext.h:150
data
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
Definition
qopengles2ext.h:206
start
GLuint start
Definition
qopengles2ext.h:354
format
GLint GLsizei GLsizei GLenum format
Definition
qopengles2ext.h:206
Q_OBJECT
#define Q_OBJECT
Definition
qtmetamacros.h:117
Q_SLOTS
#define Q_SLOTS
Definition
qtmetamacros.h:44
Q_PRIVATE_SLOT
#define Q_PRIVATE_SLOT(d, signature)
Definition
qtmetamacros.h:46
pos
pos
[7]
Definition
src_corelib_io_qsettings.cpp:57
font
QFont font
Definition
src_gui_dialogs_qfontdialog.cpp:6
parent
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent
Definition
uiaclientinterfaces_p.h:209
qtbase
src
gui
text
qsyntaxhighlighter.h
Generated by
1.9.7