4#ifndef QPLAINTEXTEDIT_H
5#define QPLAINTEXTEDIT_H
7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtWidgets/qtextedit.h>
10#include <QtWidgets/qabstractscrollarea.h>
11#include <QtGui/qtextdocument.h>
12#include <QtGui/qtextoption.h>
13#include <QtGui/qtextcursor.h>
14#include <QtGui/qtextformat.h>
15#include <QtGui/qabstracttextdocumentlayout.h>
33 Q_PROPERTY(
bool tabChangesFocus READ tabChangesFocus WRITE setTabChangesFocus)
35 Q_PROPERTY(
bool undoRedoEnabled READ isUndoRedoEnabled WRITE setUndoRedoEnabled)
38 Q_PROPERTY(
bool readOnly READ isReadOnly WRITE setReadOnly)
40 Q_PROPERTY(
bool overwriteMode READ overwriteMode WRITE setOverwriteMode)
41 Q_PROPERTY(
qreal tabStopDistance READ tabStopDistance WRITE setTabStopDistance)
42 Q_PROPERTY(
int cursorWidth READ cursorWidth WRITE setCursorWidth)
43 Q_PROPERTY(Qt::TextInteractionFlags textInteractionFlags READ textInteractionFlags
44 WRITE setTextInteractionFlags)
46 Q_PROPERTY(
int maximumBlockCount READ maximumBlockCount WRITE setMaximumBlockCount)
47 Q_PROPERTY(
bool backgroundVisible READ backgroundVisible WRITE setBackgroundVisible)
48 Q_PROPERTY(
bool centerOnScroll READ centerOnScroll WRITE setCenterOnScroll)
64 void setPlaceholderText(
const QString &placeholderText);
65 QString placeholderText()
const;
70 bool isReadOnly()
const;
71 void setReadOnly(
bool ro);
73 void setTextInteractionFlags(Qt::TextInteractionFlags
flags);
74 Qt::TextInteractionFlags textInteractionFlags()
const;
80 bool tabChangesFocus()
const;
81 void setTabChangesFocus(
bool b);
89 {
return document()->isUndoRedoEnabled(); }
91 { document()->setUndoRedoEnabled(
enable); }
94 { document()->setMaximumBlockCount(maximum); }
96 {
return document()->maximumBlockCount(); }
99 LineWrapMode lineWrapMode()
const;
100 void setLineWrapMode(LineWrapMode
mode);
105 void setBackgroundVisible(
bool visible);
106 bool backgroundVisible()
const;
108 void setCenterOnScroll(
bool enabled);
109 bool centerOnScroll()
const;
111 bool find(
const QString &exp, QTextDocument::FindFlags options = QTextDocument::FindFlags());
112#if QT_CONFIG(regularexpression)
113 bool find(
const QRegularExpression &exp, QTextDocument::FindFlags options = QTextDocument::FindFlags());
117 {
return document()->toPlainText(); }
119 void ensureCursorVisible();
122#ifndef QT_NO_CONTEXTMENU
123 QMenu *createStandardContextMenu();
129 QRect cursorRect()
const;
133 bool overwriteMode()
const;
134 void setOverwriteMode(
bool overwrite);
136 qreal tabStopDistance()
const;
139 int cursorWidth()
const;
140 void setCursorWidth(
int width);
147 bool canPaste()
const;
151 int blockCount()
const;
159#ifndef QT_NO_CLIPBOARD
174 void appendHtml(
const QString &html);
178 void zoomIn(
int range = 1);
179 void zoomOut(
int range = 1);
196 virtual void keyPressEvent(
QKeyEvent *
e)
override;
197 virtual void keyReleaseEvent(
QKeyEvent *
e)
override;
202 virtual void mouseReleaseEvent(
QMouseEvent *
e)
override;
203 virtual void mouseDoubleClickEvent(
QMouseEvent *
e)
override;
204 virtual bool focusNextPrevChild(
bool next)
override;
205#ifndef QT_NO_CONTEXTMENU
208#if QT_CONFIG(draganddrop)
209 virtual void dragEnterEvent(QDragEnterEvent *
e)
override;
210 virtual void dragLeaveEvent(QDragLeaveEvent *
e)
override;
211 virtual void dragMoveEvent(QDragMoveEvent *
e)
override;
212 virtual void dropEvent(QDropEvent *
e)
override;
216 virtual void showEvent(
QShowEvent *)
override;
217 virtual void changeEvent(
QEvent *
e)
override;
218#if QT_CONFIG(wheelevent)
219 virtual void wheelEvent(QWheelEvent *
e)
override;
222 virtual QMimeData *createMimeDataFromSelection()
const;
230 virtual void scrollContentsBy(
int dx,
int dy)
override;
239 void zoomInF(
float range);
246 Q_PRIVATE_SLOT(d_func(),
void _q_verticalScrollbarActionTriggered(
int))
258 Q_PROPERTY(
int cursorWidth READ cursorWidth WRITE setCursorWidth)
267 int pageCount()
const override;
268 QSizeF documentSize()
const override;
273 void ensureBlockLayout(
const QTextBlock &block)
const;
275 void setCursorWidth(
int width);
276 int cursorWidth()
const;
278 void requestUpdate();
281 void documentChanged(
int from,
int ,
int charsAdded)
override;
285 void setTextWidth(
qreal newWidth);
286 qreal textWidth()
const;
The QFocusEvent class contains event parameters for widget focus events.
The QKeyEvent class describes a key event.
The QPaintEvent class contains event parameters for paint events.
The QPainter class performs low-level painting on widgets and other paint devices.
The QPlainTextDocumentLayout class implements a plain text layout for QTextDocument.
The QPlainTextEdit class provides a widget that is used to edit and display plain text.
void setMaximumBlockCount(int maximum)
QString documentTitle() const
void setUndoRedoEnabled(bool enable)
void cursorPositionChanged()
This signal is emitted whenever the position of the cursor changed.
int maximumBlockCount() const
void copyAvailable(bool b)
This signal is emitted when text is selected or de-selected in the text edit.
void selectionChanged()
This signal is emitted whenever the selection changes.
void undoAvailable(bool b)
This signal is emitted whenever undo operations become available (available is true) or unavailable (...
void blockCountChanged(int newBlockCount)
This signal is emitted whenever the block count changes.
void redoAvailable(bool b)
This signal is emitted whenever redo operations become available (available is true) or unavailable (...
LineWrapMode
\value NoWrap \value WidgetWidth
QString toPlainText() const
Returns the text of the text edit as plain text.
void setDocumentTitle(const QString &title)
void textChanged()
This signal is emitted whenever the document's content changes; for example, when text is inserted or...
void modificationChanged(bool)
This signal is emitted whenever the content of the document changes in a way that affects the modific...
void updateRequest(const QRect &rect, int dy)
This signal is emitted when the text document needs an update of the specified rect.
bool isUndoRedoEnabled() const
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore \reentrant
The QResizeEvent class contains event parameters for resize events.
The QShowEvent class provides an event that is sent when a widget is shown.
\macro QT_RESTRICTED_CAST_FROM_ASCII
\reentrant \inmodule QtGui
MoveMode
\value MoveAnchor Moves the anchor to the same position as the cursor itself.
MoveOperation
\value NoMove Keep the cursor where it is
\reentrant \inmodule QtGui
WrapMode
This enum describes how text is wrapped in a document.
void textChanged(const QString &newText)
Combined button and popup list for selecting options.
static jboolean cut(JNIEnv *, jobject)
static jboolean copy(JNIEnv *, jobject)
static jboolean paste(JNIEnv *, jobject)
static jboolean selectAll(JNIEnv *, jobject)
static QString toPlainText(const QString &text)
GLboolean GLboolean GLboolean b
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLsizei GLsizei GLfloat distance
GLint GLsizei GLsizei GLenum format
GLsizei GLsizei GLchar * source
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define QT_REQUIRE_CONFIG(feature)
myFilter draw(painter, QPoint(0, 0), originalPixmap)
edit textCursor().insertText(text)
[0]
const QByteArray plainText
\reentrant \inmodule QtGui
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent