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
4//
5// W A R N I N G
6// -------------
7//
8// This file is not part of the Qt API. It exists for the convenience
9// of Qt Designer. This header
10// file may change from version to version without notice, or even be removed.
11//
12// We mean it.
13//
14
15#ifndef HTMLHIGHLIGHTER_H
16#define HTMLHIGHLIGHTER_H
17
18#include <QtGui/qsyntaxhighlighter.h>
19
20QT_BEGIN_NAMESPACE
21
22class QTextEdit;
23
24namespace qdesigner_internal {
25
26/* HTML syntax highlighter based on Qt Quarterly example */
28{
30
31public:
40
41 HtmlHighlighter(QTextEdit *textEdit);
42
43 void setFormatFor(Construct construct, const QTextCharFormat &format);
44
45 QTextCharFormat formatFor(Construct construct) const
46 { return m_formats[construct]; }
47
48protected:
54
55 void highlightBlock(const QString &text) override;
56
57private:
58 QTextCharFormat m_formats[LastConstruct + 1];
59};
60
61} // namespace qdesigner_internal
62
63QT_END_NAMESPACE
64
65#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.