Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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
21QT_BEGIN_NAMESPACE
22
23class QTextEdit;
24
25namespace qdesigner_internal {
26
27/* HTML syntax highlighter based on Qt Quarterly example */
29{
31
32public:
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
49protected:
55
56 void highlightBlock(const QString &text) override;
57
58private:
59 QTextCharFormat m_formats[LastConstruct + 1];
60};
61
62} // namespace qdesigner_internal
63
64QT_END_NAMESPACE
65
66#endif // HTMLHIGHLIGHTER_H
QTextCharFormat formatFor(Construct construct) const
void highlightBlock(const QString &text) override
Highlights the given text block.
void setFormatFor(Construct construct, const QTextCharFormat &format)
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.