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
messagehighlighter.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#ifndef MESSAGEHIGHLIGHTER_H
5#define MESSAGEHIGHLIGHTER_H
6
7#include <QtGui/QSyntaxHighlighter>
8
10
11class QTextEdit;
12
13/* Message highlighter based on HtmlSyntaxHighlighter from designer */
15{
17
18public:
20 void adjustColors();
21
22protected:
23 void highlightBlock(const QString &text) override;
24
25private:
26 enum Construct {
27 Entity,
28 Tag,
29 Comment,
30 Attribute,
31 Value,
32 Accelerator, // "Open &File"
33 Variable, // "Opening %1"
34 LastConstruct = Variable
35 };
36
37 enum State {
38 NormalState = -1,
39 InComment,
40 InTag
41 };
42
43 QTextCharFormat m_formats[LastConstruct + 1];
44};
45
46QT_END_NAMESPACE
47
48#endif // MESSAGEHIGHLIGHTER_H
bool eventFilter(QObject *object, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
ButtonWrapper(QWidget *wrapee, QWidget *relator)
QSize minimumSizeHint() const override
QSize sizeHint() const override
void setTranslation(const QString &text, bool userAction=false)
QString getTranslation() const
bool eventFilter(QObject *watched, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
void setMultiEnabled(bool enable)
void setEditingEnabled(bool enable)
void setTranslation(const QString &text, bool userAction=false)
void setEditingEnabled(bool enable)
void setVisualizeWhitespace(bool value)
bool event(QEvent *event) override
void setEditable(bool editable)
bool isDarkMode()
Definition globals.cpp:38
QString toPlainText(const QString &text)