Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquicktextselection_p.h
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQUICKTEXTSELECTION_H
5#define QQUICKTEXTSELECTION_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <private/qtquickglobal_p.h>
19
20#include <QtQuick/qquicktextdocument.h>
21
22#include <QtQml/qqml.h>
23
24#include <QtGui/qtextcursor.h>
25
27
28class QFont;
30
31class Q_QUICK_EXPORT QQuickTextSelection : public QObject
32{
34
35 Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged FINAL)
36 Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged FINAL)
38 Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged FINAL)
39
42
43public:
44 explicit QQuickTextSelection(QObject *parent = nullptr);
45
46 QString text() const;
47 void setText(const QString &text);
48
49 QFont font() const;
50 void setFont(const QFont &font);
51
52 QColor color() const;
53 void setColor(QColor color);
54
55 Qt::Alignment alignment() const;
56 void setAlignment(Qt::Alignment align);
57
60 void fontChanged();
62 void alignmentChanged();
63
65 QTextCursor cursor() const;
66 void updateFromCharFormat(const QTextCharFormat &fmt);
67 void updateFromBlockFormat();
68
70 QTextCursor m_cursor;
71 QTextCharFormat m_charFormat;
72 QTextBlockFormat m_blockFormat;
73 QQuickTextControl *m_control = nullptr;
74};
75
77
79
80#endif // QQUICKTEXTSELECTION_H
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
\reentrant
Definition qfont.h:22
\inmodule QtCore
Definition qobject.h:103
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\reentrant \inmodule QtGui
Definition qtextcursor.h:30
QString text
void colorChanged()
QCursor cursor
void textChanged(const QString &newText)
uint alignment
Combined button and popup list for selecting options.
Definition qcompare.h:63
GLuint color
[2]
#define QML_DECLARE_TYPE(TYPE)
Definition qqml.h:19
#define QML_ANONYMOUS
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SIGNALS
QVideoFrameFormat::PixelFormat fmt
#define explicit
label setAlignment(Qt::AlignLeft|Qt::AlignTop)
[0]
myFilter setColor(QColor(128, 0, 0))
insertRed setText("insert red text")