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
qtextcursor_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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 TEXTCURSOR_H
5#define TEXTCURSOR_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 <QtCore/qstring.h>
19
20namespace Utils {
21
22class TextDocument;
23class TextBlock;
24
26{
27public:
35
37
39
43
44 bool movePosition(MoveOperation op, MoveMode = MoveAnchor, int n = 1);
45 int position() const;
47 QString selectedText() const;
48 void clearSelection();
49 int anchor() const;
50 TextDocument *document() const;
51 void insertText(const QString &text);
52 TextBlock block() const;
53 int positionInBlock() const;
54 int blockNumber() const;
55
57
58 bool hasSelection() const;
59
60 void removeSelectedText();
61 int selectionEnd() const;
62
63 bool isNull() const;
64
65private:
66 TextDocument *m_document = nullptr;
67 int m_position = 0;
68 int m_anchor = 0;
69};
70} // namespace Utils
71
72#endif // TEXTCURSOR_H
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
int selectionEnd() const
bool movePosition(MoveOperation op, MoveMode=MoveAnchor, int n=1)
int blockNumber() const
bool hasSelection() const
int positionInBlock() const
TextBlock block() const
TextCursor(const TextBlock &block)
int anchor() const
void insertText(const QString &text)
int position() const
TextDocument * document() const
QString selectedText() const
void select(SelectionType selection)
bool isNull() const
QString text
n void setPosition(void) \n\
GLenum mode
GLfloat n
QItemSelection * selection
[0]