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) 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
4#ifndef QTEXTCURSOR_P_H
5#define QTEXTCURSOR_P_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 for the convenience
12// of other Qt classes. 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 <QtGui/private/qtguiglobal_p.h>
19#include "qtextcursor.h"
20#include "qtextdocument.h"
21#include "qtextdocument_p.h"
22#include <private/qtextformat_p.h>
23#include "qtextobject.h"
24
26
27class Q_GUI_EXPORT QTextCursorPrivate : public QSharedData
28{
29public:
33
34 static inline QTextCursorPrivate *getPrivate(QTextCursor *c) { return c->d; }
35
36 enum AdjustResult { CursorMoved, CursorUnchanged };
37 AdjustResult adjustPosition(int positionOfChange, int charsAddedOrRemoved, QTextUndoCommand::Operation op);
38
39 void adjustCursor(QTextCursor::MoveOperation m);
40
41 void remove();
42 void clearCells(QTextTable *table, int startRow, int startCol, int numRows, int numCols, QTextUndoCommand::Operation op);
43 inline bool setPosition(int newPosition) {
44 Q_ASSERT(newPosition >= 0 && newPosition < priv->length());
45 bool moved = position != newPosition;
46 if (moved) {
47 position = newPosition;
48 currentCharFormat = -1;
49 }
50 return moved;
51 }
52 void setX();
53 bool canDelete(int pos) const;
54
55 void insertBlock(const QTextBlockFormat &format, const QTextCharFormat &charFormat);
57
58 inline QTextBlock block() const
59 { return QTextBlock(priv, priv->blockMap().findNode(position)); }
61 { return block().blockFormat(); }
62
63 QTextLayout *blockLayout(QTextBlock &block) const;
64
65 QTextTable *complexSelectionTable() const;
66 void selectedTableCells(int *firstRow, int *numRows, int *firstColumn, int *numColumns) const;
67
68 void setBlockCharFormat(const QTextCharFormat &format, QTextDocumentPrivate::FormatChangeMode changeMode);
69 void setBlockFormat(const QTextBlockFormat &format, QTextDocumentPrivate::FormatChangeMode changeMode);
70 void setCharFormat(const QTextCharFormat &format, QTextDocumentPrivate::FormatChangeMode changeMode);
71
72 void aboutToRemoveCell(int from, int to);
73
76
80 int anchor;
86};
87
89
90#endif // QTEXTCURSOR_P_H
\inmodule QtCore
Definition qshareddata.h:19
\reentrant
QTextBlock block() const
bool setPosition(int newPosition)
QTextDocumentPrivate * priv
QTextBlockFormat blockFormat() const
static QTextCursor fromPosition(QTextDocumentPrivate *d, int pos)
static QTextCursorPrivate * getPrivate(QTextCursor *c)
\reentrant \inmodule QtGui
Definition qtextcursor.h:30
MoveMode
\value MoveAnchor Moves the anchor to the same position as the cursor itself.
Definition qtextcursor.h:47
MoveOperation
\value NoMove Keep the cursor where it is
Definition qtextcursor.h:61
\reentrant
Definition qtextlayout.h:70
\reentrant
Definition qtexttable.h:63
Combined button and popup list for selecting options.
static const QMetaObjectPrivate * priv(const uint *data)
GLenum mode
const GLfloat * m
GLenum GLuint GLenum GLsizei length
GLint GLsizei GLsizei GLenum format
const GLubyte * c
GLfloat GLfloat p
[1]
GLenum GLenum GLsizei void * table
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
unsigned int uint
Definition qtypes.h:34
double qreal
Definition qtypes.h:187
settings remove("monkey")
p setX(p.x()+1)