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
qquicktextcontrol_p_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 LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QQUICKTEXTCONTROL_P_P_H
6#define QQUICKTEXTCONTROL_P_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include "QtGui/qtextdocumentfragment.h"
20#include "QtGui/qtextcursor.h"
21#include "QtGui/qtextformat.h"
22#include "QtGui/qtextobject.h"
23#include "QtGui/qabstracttextdocumentlayout.h"
24#include "QtCore/qbasictimer.h"
25#include "QtCore/qpointer.h"
26#include "private/qobject_p.h"
27
29
30class QMimeData;
31class QAbstractScrollArea;
32
34{
35public:
36 Q_DECLARE_PUBLIC(QQuickTextControl)
38
39 bool cursorMoveKeyEvent(QKeyEvent *e);
40
42
43 void setContent(Qt::TextFormat format, const QString &text);
44
45 void paste(const QMimeData *source);
46
47 void setCursorPosition(const QPointF &pos);
48 void setCursorPosition(int pos, QTextCursor::MoveMode mode = QTextCursor::MoveAnchor);
49
50 void repaintCursor();
51 inline void repaintSelection()
52 { repaintOldAndNewSelection(QTextCursor()); }
53 void repaintOldAndNewSelection(const QTextCursor &oldSelection);
54
55 void selectionChanged(bool forceEmitSelectionChanged = false);
56
58
59#if QT_CONFIG(clipboard)
61#endif
62
63 void _q_updateCursorPosChanged(const QTextCursor &someCursor);
64
65 void setBlinkingCursorEnabled(bool enable);
67
68 void extendWordwiseSelection(int suggestedNewPosition, qreal mouseXPosition);
69 void extendBlockwiseSelection(int suggestedNewPosition);
70
71 void _q_setCursorAfterUndoRedo(int undoPosition, int charsAdded, int charsRemoved);
72
73 QRectF rectForPosition(int position) const;
74
75 void keyPressEvent(QKeyEvent *e);
76 void keyReleaseEvent(QKeyEvent *e);
77 void mousePressEvent(QMouseEvent *event, const QPointF &pos);
78 void mouseMoveEvent(QMouseEvent *event, const QPointF &pos);
79 void mouseReleaseEvent(QMouseEvent *event, const QPointF &pos);
80 void mouseDoubleClickEvent(QMouseEvent *event, const QPointF &pos);
81 bool sendMouseEventToInputContext(QMouseEvent *event, const QPointF &pos);
82 void focusEvent(QFocusEvent *e);
83#if QT_CONFIG(im)
85#endif
86 void hoverEvent(QHoverEvent *e, const QPointF &pos);
87
88 void activateLinkUnderCursor(QString href = QString());
89
90#if QT_CONFIG(im)
91 bool isPreediting() const;
92 void commitPreedit();
93 void cancelPreedit();
94#endif
95
98
100
101 QTextDocument *doc;
109
111 ulong timestampAtLastDoubleClick = 0; // will only be set at a double click
112
113#if QT_CONFIG(im)
114 int preeditCursor;
115#endif
116
118
119 bool cursorOn : 1;
121 bool mousePressed : 1;
126 bool cursorVisible : 1; // used to hide the cursor in the preedit area
128 bool hasFocus : 1;
131 bool hasImState : 1;
137
140
142};
143
144QT_END_NAMESPACE
145
146#endif // QQuickTextControl_P_H
\inmodule QtCore\reentrant
Definition qpoint.h:231
bool cursorMoveKeyEvent(QKeyEvent *e)
void selectionChanged(bool forceEmitSelectionChanged=false)
void setCursorPosition(const QPointF &pos)
void _q_updateCursorPosChanged(const QTextCursor &someCursor)
void mouseMoveEvent(QMouseEvent *event, const QPointF &pos)
void extendWordwiseSelection(int suggestedNewPosition, qreal mouseXPosition)
void keyReleaseEvent(QKeyEvent *e)
void focusEvent(QFocusEvent *e)
QRectF rectForPosition(int position) const
void extendBlockwiseSelection(int suggestedNewPosition)
void setBlinkingCursorEnabled(bool enable)
void hoverEvent(QHoverEvent *e, const QPointF &pos)
void setCursorPosition(int pos, QTextCursor::MoveMode mode=QTextCursor::MoveAnchor)
void setContent(Qt::TextFormat format, const QString &text)
void repaintOldAndNewSelection(const QTextCursor &oldSelection)
void activateLinkUnderCursor(QString href=QString())
void mouseDoubleClickEvent(QMouseEvent *event, const QPointF &pos)
void paste(const QMimeData *source)
void mousePressEvent(QMouseEvent *event, const QPointF &pos)
Qt::TextInteractionFlags interactionFlags
void keyPressEvent(QKeyEvent *e)
void _q_setCursorAfterUndoRedo(int undoPosition, int charsAdded, int charsRemoved)
bool sendMouseEventToInputContext(QMouseEvent *event, const QPointF &pos)
void mouseReleaseEvent(QMouseEvent *event, const QPointF &pos)
QQuickTextEditMimeData(const QTextDocumentFragment &aFragment)
QVariant retrieveData(const QString &mimeType, QMetaType type) const override
Returns a variant with the given type containing data for the MIME type specified by mimeType.
QStringList formats() const override
Returns a list of formats supported by the object.
#define qApp
const int textCursorWidth