Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
htmlhighlighter_p.h
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
// Qt-Security score:significant reason:default
4
5
//
6
// W A R N I N G
7
// -------------
8
//
9
// This file is not part of the Qt API. It exists for the convenience
10
// of Qt Designer. This header
11
// file may change from version to version without notice, or even be removed.
12
//
13
// We mean it.
14
//
15
16
#
ifndef
HTMLHIGHLIGHTER_H
17
#
define
HTMLHIGHLIGHTER_H
18
19
#
include
<
QtGui
/
qsyntaxhighlighter
.
h
>
20
21
QT_BEGIN_NAMESPACE
22
23
class
QTextEdit;
24
25
namespace
qdesigner_internal
{
26
27
/* HTML syntax highlighter based on Qt Quarterly example */
28
class
HtmlHighlighter
:
public
QSyntaxHighlighter
29
{
30
Q_OBJECT
31
32
public
:
33
enum
Construct
{
34
Entity
,
35
Tag
,
36
Comment
,
37
Attribute
,
38
Value
,
39
LastConstruct
=
Value
40
};
41
42
HtmlHighlighter
(QTextEdit *textEdit);
43
44
void
setFormatFor
(Construct construct,
const
QTextCharFormat &format);
45
46
QTextCharFormat
formatFor
(Construct construct)
const
47
{
return
m_formats[construct]; }
48
49
protected
:
50
enum
State
{
51
NormalState
= -1,
52
InComment
,
53
InTag
54
};
55
56
void
highlightBlock
(
const
QString &text)
override
;
57
58
private
:
59
QTextCharFormat m_formats[
LastConstruct
+ 1];
60
};
61
62
}
// namespace qdesigner_internal
63
64
QT_END_NAMESPACE
65
66
#
endif
// HTMLHIGHLIGHTER_H
qdesigner_internal::HtmlHighlighter
Definition
htmlhighlighter_p.h:29
qdesigner_internal::HtmlHighlighter::HtmlHighlighter
HtmlHighlighter(QTextEdit *textEdit)
Definition
htmlhighlighter.cpp:16
qdesigner_internal::HtmlHighlighter::State
State
Definition
htmlhighlighter_p.h:50
qdesigner_internal::HtmlHighlighter::InTag
@ InTag
Definition
htmlhighlighter_p.h:53
qdesigner_internal::HtmlHighlighter::InComment
@ InComment
Definition
htmlhighlighter_p.h:52
qdesigner_internal::HtmlHighlighter::NormalState
@ NormalState
Definition
htmlhighlighter_p.h:51
qdesigner_internal::HtmlHighlighter::formatFor
QTextCharFormat formatFor(Construct construct) const
Definition
htmlhighlighter_p.h:46
qdesigner_internal::HtmlHighlighter::highlightBlock
void highlightBlock(const QString &text) override
Highlights the given text block.
Definition
htmlhighlighter.cpp:50
qdesigner_internal::HtmlHighlighter::setFormatFor
void setFormatFor(Construct construct, const QTextCharFormat &format)
Definition
htmlhighlighter.cpp:43
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qdesigner_internal
Auxiliary methods to store/retrieve settings.
Definition
buddyeditor.cpp:67
qttools
src
designer
src
lib
shared
htmlhighlighter_p.h
Generated on
for Qt by
1.18.0