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
21protected:
22 void highlightBlock(const QString &text) override;
23
24private:
25 enum Construct {
26 Entity,
27 Tag,
28 Comment,
29 Attribute,
30 Value,
31 Accelerator, // "Open &File"
32 Variable, // "Opening %1"
33 LastConstruct = Variable
34 };
35
36 enum State {
37 NormalState = -1,
38 InComment,
39 InTag
40 };
41
42 QTextCharFormat m_formats[LastConstruct + 1];
43};
44
45QT_END_NAMESPACE
46
47#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)
void setEditable(bool editable)
QObject * parent
Definition qobject.h:73
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
@ BinaryVariantSeparator
Definition translator.h:184
QString toPlainText(const QString &text)
Combined button and popup list for selecting options.