42 #ifndef QPLAINTEXTEDIT_P_H 43 #define QPLAINTEXTEDIT_P_H 56 #include "private/qabstractscrollarea_p.h" 57 #include "QtGui/qtextdocumentfragment.h" 58 #include "QtGui/qscrollbar.h" 59 #include "QtGui/qtextcursor.h" 60 #include "QtGui/qtextformat.h" 61 #include "QtGui/qmenu.h" 62 #include "QtGui/qabstracttextdocumentlayout.h" 63 #include "QtCore/qbasictimer.h" 64 #include "private/qtextcontrol_p.h" 67 #ifndef QT_NO_TEXTEDIT 118 void _q_repaintContents(
const QRectF &contentsRect);
121 {
return QPoint(point.
x() + horizontalOffset(), point.
y() + verticalOffset()); }
123 void _q_adjustScrollbars();
124 void _q_verticalScrollbarActionTriggered(
int action);
125 void ensureViewportLayouted();
126 void relayoutDocument();
131 {
return (q_func()->isRightToLeft() ? (hbar->maximum() - hbar->value()) : hbar->value()); }
133 qreal verticalOffset()
const;
136 { control->processEvent(e,
QPointF(horizontalOffset(), verticalOffset()), viewport); }
138 void updateDefaultTextOption();
159 void setTopLine(
int visualTopLine,
int dx = 0);
160 void setTopBlock(
int newTopBlock,
int newTopLine,
int dx = 0);
162 void ensureVisible(
int position,
bool center,
bool forceCenter =
false);
164 void updateViewport();
174 #ifdef QT_KEYPAD_NAVIGATION 178 void _q_cursorPositionChanged();
179 void _q_modificationChanged(
bool);
186 #endif // QT_NO_TEXTEDIT 188 #endif // QPLAINTEXTEDIT_P_H The QVariant class acts like a union for the most common Qt data types.
bool pageUpDownLastCursorYIsValid
void ensureCursorVisible()
Ensures that the cursor is visible by scrolling the text edit if necessary.
#define QT_END_NAMESPACE
This macro expands to.
void setLeft(qreal pos)
Sets the left edge of the rectangle to the given x coordinate.
QPoint mapToContents(const QPoint &point) const
void append(const QString &text)
The QPointF class defines a point in the plane using floating point precision.
qreal left() const
Returns the x-coordinate of the rectangle's left edge.
QPointer< QPlainTextDocumentLayout > documentLayoutPtr
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
WrapMode
This enum describes how text is wrapped in a document.
QVariant loadResource(int type, const QUrl &name)
QRectF blockBoundingRect(const QTextBlock &block) const
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
QTextCursor textCursor() const
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
QPlainTextEdit * textEdit
#define QT_BEGIN_NAMESPACE
This macro expands to.
MoveMode
If the anchor() is kept where it is and the position() is moved, the text in between will be selected...
The QRectF class defines a rectangle in the plane using floating point precision. ...
void insertFromMimeData(const QMimeData *source)
The QTextCursor class offers an API to access and modify QTextDocuments.
The QTextBlock class provides a container for text fragments in a QTextDocument.
void moveCursor(QTextCursor::MoveOperation op, QTextCursor::MoveMode mode=QTextCursor::MoveAnchor)
The QPlainTextEdit class provides a widget that is used to edit and display plain text...
QPlainTextEditControl(QPlainTextEdit *parent)
QRectF cursorRect(const QTextCursor &cursor) const
QRectF cursorRect() const
The QMimeData class provides a container for data that records information about its MIME type...
void sendControlEvent(QEvent *e)
Q_CORE_EXPORT QTextStream & center(QTextStream &s)
#define Q_DECLARE_PUBLIC(Class)
QTextOption::WrapMode wordWrap
QMimeData * createMimeDataFromSelection() const
uint showCursorOnInitialShow
QObject * parent() const
Returns a pointer to the parent object.
QTextBlock firstVisibleBlock() const
QPlainTextEditControl * control
The QPoint class defines a point in the plane using integer precision.
void ensureCursorVisible()
virtual QVariant loadResource(int type, const QUrl &name)
Loads the resource specified by the given type and name.
int y() const
Returns the y coordinate of this point.
bool canInsertFromMimeData(const QMimeData *source) const
int horizontalOffset() const
qreal pageUpDownLastCursorY
The QBasicTimer class provides timer events for objects.
int x() const
Returns the x coordinate of this point.
QBasicTimer autoScrollTimer
QPlainTextEdit::LineWrapMode lineWrap
The QEvent class is the base class of all event classes.
int hitTest(const QPointF &point, Qt::HitTestAccuracy=Qt::FuzzyHit) const